diff options
38 files changed, 1052 insertions, 768 deletions
@@ -1,6 +1,6 @@ -DOXYGEN Version 1.2.15-20020430 +DOXYGEN Version 1.2.15-20020512 Please read the installation section of the manual for instructions. -------- -Dimitri van Heesch (30 April 2002) +Dimitri van Heesch (12 May 2002) @@ -1,4 +1,4 @@ -DOXYGEN Version 1.2.15_20020430 +DOXYGEN Version 1.2.15_20020512 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) (30 April 2002) +Dimitri van Heesch (dimitri@stack.nl) (12 May 2002) @@ -1 +1 @@ -1.2.15-20020430 +1.2.15-20020512 diff --git a/addon/doxmlparser/include/doxmlintf.h b/addon/doxmlparser/include/doxmlintf.h index 5c051dd..d0d3c2a 100644 --- a/addon/doxmlparser/include/doxmlintf.h +++ b/addon/doxmlparser/include/doxmlintf.h @@ -1,3 +1,18 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2002 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. + * + */ + #ifndef _DOXMLINTF_H #define _DOXMLINTF_H @@ -480,7 +495,8 @@ class IMember virtual const IString * name() const = 0; virtual bool isConst() const = 0; virtual bool isVolatile() const = 0; - virtual IParamIterator *params() const = 0; + virtual IParamIterator *parameters() const = 0; + virtual IParamIterator *templateParameters() const = 0; virtual ILinkedTextIterator *initializer() const = 0; virtual ILinkedTextIterator *exceptions() const = 0; virtual IMemberReferenceIterator *references() const = 0; @@ -507,27 +523,79 @@ class IMemberIterator virtual void release() = 0; }; +/*! \brief The interface to a section in the object model. + * + * A compound can have a number of sections, where each + * section contains a set of members with the properties implied by + * the section kind. The kind() method returns the kind of the section. + * The members of the section can be accessed via members(). Apart + * from using kind(), some of the individual properties of the section can + * also be inspected via isStatic(), isPublic(), isProtected() and + * isPrivate(). + */ class ISection { public: - enum SectionKind { Invalid=0, - UserDefined, - PubTypes, PubFuncs, PubAttribs, PubSlots, - Signals, DCOPFuncs, Properties, - PubStatFuncs, PubStatAttribs, - ProTypes, ProFuncs, ProAttribs, ProSlots, - ProStatFuncs, ProStatAttribs, - PriTypes, PriFuncs, PriAttribs, PriSlots, - PriStatFuncs, PriStatAttribs, - Friend, Related, Defines, Prototypes, Typedefs, - Enums, Functions, Variables - }; + /*! Possible section types */ + enum SectionKind + { Invalid=0, + UserDefined, //!< A user defined member group + PubTypes, //!< Public member typedefs + PubFuncs, //!< Public member functions + PubAttribs, //!< Public member attributes + PubSlots, //!< Public Qt Slots + Signals, //!< Qt Signals + DCOPFuncs, //!< KDE-DCOP interface functions + Properties, //!< IDL properties + PubStatFuncs, //!< Public static member functions + PubStatAttribs, //!< Public static attributes + ProTypes, //!< Protected member typedefs + ProFuncs, //!< Protected member functions + ProAttribs, //!< Protected member attributes + ProSlots, //!< Protected slots + ProStatFuncs, //!< Protected static member functions + ProStatAttribs, //!< Protected static member attributes + PriTypes, //!< Private member typedefs + PriFuncs, //!< Private member functions + PriAttribs, //!< Private member attributes + PriSlots, //!< Private Qt slots + PriStatFuncs, //!< Private static member functions + PriStatAttribs, //!< Private static member attributes + Friend, //!< Friends + Related, //!< Function marked as related + Defines, //!< Preprocessor defines + Prototypes, //!< Global function prototypes + Typedefs, //!< Global typedefs + Enums, //!< Enumerations + Functions, //!< Global functions + Variables //!< Global variables + }; + + /*! Returns a string representation of the value returned by kind() */ virtual const IString * kindString() const = 0; + + /*! Returns what kind of section this is */ virtual SectionKind kind() const = 0; + + /*! Returns an iterator for the members of this section */ virtual IMemberIterator *members() const = 0; + + /*! Returns \c true if this section contains statics */ virtual bool isStatic() const = 0; + + /*! Returns \c true if this section belongs to a + * public section of a class + */ virtual bool isPublic() const = 0; + + /*! Returns \c true if this section belongs to a + * private section of a class + */ virtual bool isPrivate() const = 0; + + /*! Returns \c true if this section belongs to a + * protected section of a class + * */ virtual bool isProtected() const = 0; }; @@ -542,6 +610,31 @@ class ISectionIterator virtual void release() = 0; }; +/*! \brief The interface to a compound in the object model. + * + * A compound has a name which can be obtained via the name() method + * and a unique id, which is return via the id() method. + * A compound consists zero or more members which are grouped into sections. + * The sections() method can be used to access the individual sections. + * Alternatively, members can be obtained by name or id. There are + * different types of compounds. The kind() method returns what kind of + * compound this is. Depending on the return value one can dynamically + * cast an interface pointer to an more specialised interface that provides + * additional methods. + * Example: + * \code + * ICompound *comp=...; + * if (comp->kind()==ICompound::Class) + * { + * IClass *cls = dynamic_cast<IClass*>(comp); + * // use methods of IClass + * } + * \endcode + * The documentation that is provided by a compound is available via + * the briefDescription() and detailedDescription() methods. + * To avoid excessive memory usage, release() should be called (once) on each + * compound interface pointer that is no longer needed. + */ class ICompound { public: @@ -634,14 +727,16 @@ class IRelatedCompoundIterator virtual void release() = 0; }; +/*! \brief The interface to a class in the object model. + */ class IClass : public ICompound { public: virtual IGraph *inheritanceGraph() const = 0; virtual IGraph *collaborationGraph() const = 0; - virtual IRelatedCompoundIterator *baseClasses() const = 0; - virtual IRelatedCompoundIterator *derivedClasses() const = 0; - virtual ICompoundIterator *nestedClasses() const = 0; + virtual IRelatedCompoundIterator *baseCompounds() const = 0; + virtual IRelatedCompoundIterator *derivedCompounds() const = 0; + virtual ICompoundIterator *nestedCompounds() const = 0; // TODO: // class: @@ -653,35 +748,56 @@ class IClass : public ICompound // locationBodyEndLine() }; +/*! \brief The interface to a struct in the object model. + */ class IStruct : public ICompound { + public: + virtual ICompoundIterator *nestedCompounds() const = 0; + virtual IRelatedCompoundIterator *baseCompounds() const = 0; + virtual IRelatedCompoundIterator *derivedCompounds() const = 0; }; +/*! \brief The interface to a union in the object model. + */ class IUnion : public ICompound { + public: + virtual ICompoundIterator *nestedCompounds() const = 0; }; +/*! \brief The interface to a Java/IDL interface in the object model. + */ class IInterface : public ICompound { + public: + virtual IRelatedCompoundIterator *baseCompounds() const = 0; + virtual IRelatedCompoundIterator *derivedCompounds() const = 0; }; +/*! \brief The interface to a Java/IDL exception in the object model. + */ class IException : public ICompound { }; +/*! \brief The interface to a namespace in the object model. + */ class INamespace : public ICompound { - // namespace: - // ICompound *innerNamespaces() - // ICompoundIterator *innerClasses() + public: + virtual ICompoundIterator *nestedCompounds() const = 0; }; +/*! \brief The interface to a file in the object model. + */ class IFile : public ICompound { public: virtual IGraph *includeDependencyGraph() const = 0; virtual IGraph *includedByDependencyGraph() const = 0; virtual IDocProgramListing *source() const = 0; + virtual ICompoundIterator *nestedCompounds() const = 0; // file: // includes() @@ -690,14 +806,20 @@ class IFile : public ICompound // ICompoundIterator *innerClasses() }; +/*! \brief The interface to a group in the object model. + */ class IGroup : public ICompound { + public: + virtual ICompoundIterator *nestedCompounds() const = 0; // group: // Title() // innerFile() // innerPage() }; +/*! \brief The interface to a page in the object model. + */ class IPage : public ICompound { }; diff --git a/addon/doxmlparser/src/compoundhandler.cpp b/addon/doxmlparser/src/compoundhandler.cpp index b6c6235..62275ce 100644 --- a/addon/doxmlparser/src/compoundhandler.cpp +++ b/addon/doxmlparser/src/compoundhandler.cpp @@ -145,13 +145,15 @@ CompoundHandler::CompoundHandler(const QString &xmlDir) : m_brief(0), m_detailed(0), m_programListing(0), m_xmlDir(xmlDir), m_refCount(1), m_memberDict(257), m_memberNameDict(257), m_mainHandler(0), m_inheritanceGraph(0), m_collaborationGraph(0), - m_includeDependencyGraph(0), m_includedByDependencyGraph(0) + m_includeDependencyGraph(0), m_includedByDependencyGraph(0), + m_hasTemplateParams(FALSE) { m_superClasses.setAutoDelete(TRUE); m_subClasses.setAutoDelete(TRUE); m_sections.setAutoDelete(TRUE); m_memberNameDict.setAutoDelete(TRUE); - m_innerClasses.setAutoDelete(TRUE); + m_innerCompounds.setAutoDelete(TRUE); + m_templateParams.setAutoDelete(TRUE); addStartHandler("doxygen"); addEndHandler("doxygen"); @@ -190,6 +192,20 @@ CompoundHandler::CompoundHandler(const QString &xmlDir) addStartHandler("innerclass",this,&CompoundHandler::startInnerClass); addEndHandler("innerclass"); + addStartHandler("innernamespace",this,&CompoundHandler::startInnerNamespace); + addEndHandler("innernamespace"); + + addStartHandler("innerfile",this,&CompoundHandler::startInnerFile); + addEndHandler("innerfile"); + + addStartHandler("innergroup",this,&CompoundHandler::startInnerGroup); + addEndHandler("innergroup"); + + addStartHandler("templateparamlist"); + addEndHandler("templateparamlist"); + + addStartHandler("param",this,&CompoundHandler::startParam); + addEndHandler("param"); } CompoundHandler::~CompoundHandler() @@ -259,7 +275,30 @@ void CompoundHandler::endCompoundName() void CompoundHandler::startInnerClass(const QXmlAttributes& attrib) { - m_innerClasses.append(new QString(attrib.value("refid"))); + m_innerCompounds.append(new QString(attrib.value("refid"))); +} + +void CompoundHandler::startInnerNamespace(const QXmlAttributes& attrib) +{ + m_innerCompounds.append(new QString(attrib.value("refid"))); +} + +void CompoundHandler::startInnerFile(const QXmlAttributes& attrib) +{ + m_innerCompounds.append(new QString(attrib.value("refid"))); +} + +void CompoundHandler::startInnerGroup(const QXmlAttributes& attrib) +{ + m_innerCompounds.append(new QString(attrib.value("refid"))); +} + +void CompoundHandler::startParam(const QXmlAttributes& attrib) +{ + m_hasTemplateParams = TRUE; + ParamHandler *ph = new ParamHandler(this); + ph->startParam(attrib); + m_templateParams.append(ph); } void CompoundHandler::addSuperClass(const QXmlAttributes& attrib) @@ -445,19 +484,19 @@ IGraph *CompoundHandler::includedByDependencyGraph() const return m_includedByDependencyGraph; } -IRelatedCompoundIterator *CompoundHandler::baseClasses() const +IRelatedCompoundIterator *CompoundHandler::baseCompounds() const { return new RelatedCompoundIterator(m_superClasses); } -IRelatedCompoundIterator *CompoundHandler::derivedClasses() const +IRelatedCompoundIterator *CompoundHandler::derivedCompounds() const { return new RelatedCompoundIterator(m_subClasses); } -ICompoundIterator *CompoundHandler::nestedClasses() const +ICompoundIterator *CompoundHandler::nestedCompounds() const { - return new CompoundIdIterator(m_mainHandler,m_innerClasses); + return new CompoundIdIterator(m_mainHandler,m_innerCompounds); } IDocProgramListing *CompoundHandler::source() const @@ -465,3 +504,8 @@ IDocProgramListing *CompoundHandler::source() const return m_programListing; } +IParamIterator *CompoundHandler::templateParameters() const +{ + return m_hasTemplateParams ? new ParamIterator(m_templateParams) : 0; +} + diff --git a/addon/doxmlparser/src/compoundhandler.h b/addon/doxmlparser/src/compoundhandler.h index bc725e3..ae567b6 100644 --- a/addon/doxmlparser/src/compoundhandler.h +++ b/addon/doxmlparser/src/compoundhandler.h @@ -31,6 +31,7 @@ class GraphHandler; class MemberHandler; class CompoundHandler; class SectionHandler; +class ParamHandler; class RelatedCompound : public IRelatedCompound @@ -92,6 +93,10 @@ class CompoundHandler : public IClass, virtual void startIncludeDependencyGraph(const QXmlAttributes& attrib); virtual void startIncludedByDependencyGraph(const QXmlAttributes& attrib); virtual void startInnerClass(const QXmlAttributes& attrib); + virtual void startInnerNamespace(const QXmlAttributes& attrib); + virtual void startInnerFile(const QXmlAttributes& attrib); + virtual void startInnerGroup(const QXmlAttributes& attrib); + virtual void startParam(const QXmlAttributes& attrib); virtual void addref() { m_refCount++; } CompoundHandler(const QString &dirName); @@ -111,14 +116,16 @@ class CompoundHandler : public IClass, IDocRoot *detailedDescription() const; IMember *memberById(const char *id) const; IMemberIterator *memberByName(const char *name) const; + IParamIterator *templateParameters() const; void release(); // IClass implementation IGraph *inheritanceGraph() const; IGraph *collaborationGraph() const; - IRelatedCompoundIterator *baseClasses() const; - IRelatedCompoundIterator *derivedClasses() const; - ICompoundIterator *nestedClasses() const; + IRelatedCompoundIterator *baseCompounds() const; + IRelatedCompoundIterator *derivedCompounds() const; + ICompoundIterator *nestedCompounds() const; + ICompoundIterator *nestedGroup() const; // IFile implementation IGraph *includeDependencyGraph() const; @@ -129,6 +136,7 @@ class CompoundHandler : public IClass, QList<RelatedCompound> m_superClasses; QList<RelatedCompound> m_subClasses; QList<SectionHandler> m_sections; + QList<ParamHandler> m_templateParams; DocHandler *m_brief; DocHandler *m_detailed; ProgramListingHandler *m_programListing; @@ -147,8 +155,9 @@ class CompoundHandler : public IClass, GraphHandler *m_collaborationGraph; GraphHandler *m_includeDependencyGraph; GraphHandler *m_includedByDependencyGraph; - QList<QString> m_innerClasses; + QList<QString> m_innerCompounds; ProgramListingHandler *m_source; + bool m_hasTemplateParams; }; diff --git a/addon/doxmlparser/src/doxmlintf.h b/addon/doxmlparser/src/doxmlintf.h index 5c051dd..d0d3c2a 100644 --- a/addon/doxmlparser/src/doxmlintf.h +++ b/addon/doxmlparser/src/doxmlintf.h @@ -1,3 +1,18 @@ +/****************************************************************************** + * + * $Id$ + * + * + * Copyright (C) 1997-2002 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. + * + */ + #ifndef _DOXMLINTF_H #define _DOXMLINTF_H @@ -480,7 +495,8 @@ class IMember virtual const IString * name() const = 0; virtual bool isConst() const = 0; virtual bool isVolatile() const = 0; - virtual IParamIterator *params() const = 0; + virtual IParamIterator *parameters() const = 0; + virtual IParamIterator *templateParameters() const = 0; virtual ILinkedTextIterator *initializer() const = 0; virtual ILinkedTextIterator *exceptions() const = 0; virtual IMemberReferenceIterator *references() const = 0; @@ -507,27 +523,79 @@ class IMemberIterator virtual void release() = 0; }; +/*! \brief The interface to a section in the object model. + * + * A compound can have a number of sections, where each + * section contains a set of members with the properties implied by + * the section kind. The kind() method returns the kind of the section. + * The members of the section can be accessed via members(). Apart + * from using kind(), some of the individual properties of the section can + * also be inspected via isStatic(), isPublic(), isProtected() and + * isPrivate(). + */ class ISection { public: - enum SectionKind { Invalid=0, - UserDefined, - PubTypes, PubFuncs, PubAttribs, PubSlots, - Signals, DCOPFuncs, Properties, - PubStatFuncs, PubStatAttribs, - ProTypes, ProFuncs, ProAttribs, ProSlots, - ProStatFuncs, ProStatAttribs, - PriTypes, PriFuncs, PriAttribs, PriSlots, - PriStatFuncs, PriStatAttribs, - Friend, Related, Defines, Prototypes, Typedefs, - Enums, Functions, Variables - }; + /*! Possible section types */ + enum SectionKind + { Invalid=0, + UserDefined, //!< A user defined member group + PubTypes, //!< Public member typedefs + PubFuncs, //!< Public member functions + PubAttribs, //!< Public member attributes + PubSlots, //!< Public Qt Slots + Signals, //!< Qt Signals + DCOPFuncs, //!< KDE-DCOP interface functions + Properties, //!< IDL properties + PubStatFuncs, //!< Public static member functions + PubStatAttribs, //!< Public static attributes + ProTypes, //!< Protected member typedefs + ProFuncs, //!< Protected member functions + ProAttribs, //!< Protected member attributes + ProSlots, //!< Protected slots + ProStatFuncs, //!< Protected static member functions + ProStatAttribs, //!< Protected static member attributes + PriTypes, //!< Private member typedefs + PriFuncs, //!< Private member functions + PriAttribs, //!< Private member attributes + PriSlots, //!< Private Qt slots + PriStatFuncs, //!< Private static member functions + PriStatAttribs, //!< Private static member attributes + Friend, //!< Friends + Related, //!< Function marked as related + Defines, //!< Preprocessor defines + Prototypes, //!< Global function prototypes + Typedefs, //!< Global typedefs + Enums, //!< Enumerations + Functions, //!< Global functions + Variables //!< Global variables + }; + + /*! Returns a string representation of the value returned by kind() */ virtual const IString * kindString() const = 0; + + /*! Returns what kind of section this is */ virtual SectionKind kind() const = 0; + + /*! Returns an iterator for the members of this section */ virtual IMemberIterator *members() const = 0; + + /*! Returns \c true if this section contains statics */ virtual bool isStatic() const = 0; + + /*! Returns \c true if this section belongs to a + * public section of a class + */ virtual bool isPublic() const = 0; + + /*! Returns \c true if this section belongs to a + * private section of a class + */ virtual bool isPrivate() const = 0; + + /*! Returns \c true if this section belongs to a + * protected section of a class + * */ virtual bool isProtected() const = 0; }; @@ -542,6 +610,31 @@ class ISectionIterator virtual void release() = 0; }; +/*! \brief The interface to a compound in the object model. + * + * A compound has a name which can be obtained via the name() method + * and a unique id, which is return via the id() method. + * A compound consists zero or more members which are grouped into sections. + * The sections() method can be used to access the individual sections. + * Alternatively, members can be obtained by name or id. There are + * different types of compounds. The kind() method returns what kind of + * compound this is. Depending on the return value one can dynamically + * cast an interface pointer to an more specialised interface that provides + * additional methods. + * Example: + * \code + * ICompound *comp=...; + * if (comp->kind()==ICompound::Class) + * { + * IClass *cls = dynamic_cast<IClass*>(comp); + * // use methods of IClass + * } + * \endcode + * The documentation that is provided by a compound is available via + * the briefDescription() and detailedDescription() methods. + * To avoid excessive memory usage, release() should be called (once) on each + * compound interface pointer that is no longer needed. + */ class ICompound { public: @@ -634,14 +727,16 @@ class IRelatedCompoundIterator virtual void release() = 0; }; +/*! \brief The interface to a class in the object model. + */ class IClass : public ICompound { public: virtual IGraph *inheritanceGraph() const = 0; virtual IGraph *collaborationGraph() const = 0; - virtual IRelatedCompoundIterator *baseClasses() const = 0; - virtual IRelatedCompoundIterator *derivedClasses() const = 0; - virtual ICompoundIterator *nestedClasses() const = 0; + virtual IRelatedCompoundIterator *baseCompounds() const = 0; + virtual IRelatedCompoundIterator *derivedCompounds() const = 0; + virtual ICompoundIterator *nestedCompounds() const = 0; // TODO: // class: @@ -653,35 +748,56 @@ class IClass : public ICompound // locationBodyEndLine() }; +/*! \brief The interface to a struct in the object model. + */ class IStruct : public ICompound { + public: + virtual ICompoundIterator *nestedCompounds() const = 0; + virtual IRelatedCompoundIterator *baseCompounds() const = 0; + virtual IRelatedCompoundIterator *derivedCompounds() const = 0; }; +/*! \brief The interface to a union in the object model. + */ class IUnion : public ICompound { + public: + virtual ICompoundIterator *nestedCompounds() const = 0; }; +/*! \brief The interface to a Java/IDL interface in the object model. + */ class IInterface : public ICompound { + public: + virtual IRelatedCompoundIterator *baseCompounds() const = 0; + virtual IRelatedCompoundIterator *derivedCompounds() const = 0; }; +/*! \brief The interface to a Java/IDL exception in the object model. + */ class IException : public ICompound { }; +/*! \brief The interface to a namespace in the object model. + */ class INamespace : public ICompound { - // namespace: - // ICompound *innerNamespaces() - // ICompoundIterator *innerClasses() + public: + virtual ICompoundIterator *nestedCompounds() const = 0; }; +/*! \brief The interface to a file in the object model. + */ class IFile : public ICompound { public: virtual IGraph *includeDependencyGraph() const = 0; virtual IGraph *includedByDependencyGraph() const = 0; virtual IDocProgramListing *source() const = 0; + virtual ICompoundIterator *nestedCompounds() const = 0; // file: // includes() @@ -690,14 +806,20 @@ class IFile : public ICompound // ICompoundIterator *innerClasses() }; +/*! \brief The interface to a group in the object model. + */ class IGroup : public ICompound { + public: + virtual ICompoundIterator *nestedCompounds() const = 0; // group: // Title() // innerFile() // innerPage() }; +/*! \brief The interface to a page in the object model. + */ class IPage : public ICompound { }; diff --git a/addon/doxmlparser/src/memberhandler.cpp b/addon/doxmlparser/src/memberhandler.cpp index 31b5d84..018dfbd 100644 --- a/addon/doxmlparser/src/memberhandler.cpp +++ b/addon/doxmlparser/src/memberhandler.cpp @@ -159,6 +159,9 @@ MemberHandler::MemberHandler(IBaseHandler *parent) addStartHandler("location",this,&MemberHandler::startLocation); addEndHandler("location"); + addStartHandler("templateparamlist",this,&MemberHandler::startTemplateParamList); + addEndHandler("templateparamlist",this,&MemberHandler::endTemplateParamList); + m_type.setAutoDelete(TRUE); m_initializer.setAutoDelete(TRUE); m_exception.setAutoDelete(TRUE); @@ -172,6 +175,8 @@ MemberHandler::MemberHandler(IBaseHandler *parent) m_defLine=0; m_bodyStart=0; m_bodyEnd=0; + m_insideTemplateParamList=FALSE; + m_hasTemplateParamList=FALSE; } MemberHandler::~MemberHandler() @@ -313,7 +318,14 @@ void MemberHandler::startParam(const QXmlAttributes& attrib) { ParamHandler *paramHandler = new ParamHandler(this); paramHandler->startParam(attrib); - m_params.append(paramHandler); + if (m_insideTemplateParamList) + { + m_templateParams.append(paramHandler); + } + else + { + m_params.append(paramHandler); + } } void MemberHandler::startEnumValue(const QXmlAttributes& attrib) @@ -323,6 +335,17 @@ void MemberHandler::startEnumValue(const QXmlAttributes& attrib) m_enumValues.append(evh); } +void MemberHandler::startTemplateParamList(const QXmlAttributes&) +{ + m_insideTemplateParamList = TRUE; + m_hasTemplateParamList = TRUE; +} + +void MemberHandler::endTemplateParamList() +{ + m_insideTemplateParamList = FALSE; +} + void MemberHandler::initialize(MainHandler *mh) { { diff --git a/addon/doxmlparser/src/memberhandler.h b/addon/doxmlparser/src/memberhandler.h index f95fa58..abbe27c 100644 --- a/addon/doxmlparser/src/memberhandler.h +++ b/addon/doxmlparser/src/memberhandler.h @@ -106,6 +106,8 @@ class MemberHandler : public IMember, public BaseHandler<MemberHandler> virtual void startInitializer(const QXmlAttributes& attrib); virtual void startException(const QXmlAttributes& attrib); virtual void startEnumValue(const QXmlAttributes& attrib); + virtual void startTemplateParamList(const QXmlAttributes &attrib); + virtual void endTemplateParamList(); MemberHandler(IBaseHandler *parent); virtual ~MemberHandler(); @@ -136,8 +138,10 @@ class MemberHandler : public IMember, public BaseHandler<MemberHandler> that->m_typeString = LinkedTextHandler::toString(m_type); return &m_typeString; } - virtual IParamIterator *params() const + virtual IParamIterator *parameters() const { return new ParamIterator(m_params); } + virtual IParamIterator *templateParameters() const + { return m_hasTemplateParamList ? new ParamIterator(m_templateParams) : 0; } virtual IMemberReferenceIterator *references() const { return new MemberReferenceIterator(m_references); } virtual IMemberReferenceIterator *referencedBy() const @@ -186,6 +190,7 @@ class MemberHandler : public IMember, public BaseHandler<MemberHandler> DocHandler *m_brief; DocHandler *m_detailed; QList<ParamHandler> m_params; + QList<ParamHandler> m_templateParams; QList<MemberReference> m_references; QList<MemberReference> m_referencedBy; MemberReference *m_reimplements; @@ -198,6 +203,8 @@ class MemberHandler : public IMember, public BaseHandler<MemberHandler> bool m_isVolatile; LinkedTextHandler *m_linkedTextHandler; QList<EnumValueHandler> m_enumValues; + bool m_insideTemplateParamList; + bool m_hasTemplateParamList; }; class MemberIterator : public BaseIterator<IMemberIterator,IMember,MemberHandler> diff --git a/addon/doxmlparser/test/main.cpp b/addon/doxmlparser/test/main.cpp index 31beab8..47854b2 100644 --- a/addon/doxmlparser/test/main.cpp +++ b/addon/doxmlparser/test/main.cpp @@ -432,6 +432,27 @@ void DumpGraph(IGraph *graph) } +void DumpParamList(IParamIterator *pli,int indent) +{ + QString indentStr; + indentStr.fill(' ',indent); + IParam *par; + for (pli->toFirst();(par=pli->current());pli->toNext()) + { + ILinkedTextIterator *lti = par->type(); + QString parType = linkedTextToString(lti); + lti->release(); + lti = par->defaultValue(); + QString defVal = linkedTextToString(lti); + lti->release(); + printf("%sParam type=%s decl_name=%s def_name=%s defvalue=%s\n", + indentStr.data(), parType.latin1(), + par->declarationName()->latin1(), + par->definitionName()->latin1(), + defVal.latin1()); + } +} + int main(int argc,char **argv) { if (argc!=2) @@ -471,19 +492,8 @@ int main(int argc,char **argv) linkedTextToString(lti).latin1(),mem->name()->latin1()); lti->release(); - IParamIterator *pli = mem->params(); - IParam *par; - for (pli->toFirst();(par=pli->current());pli->toNext()) - { - lti = par->type(); - QString parType = linkedTextToString(lti); - lti->release(); - lti = par->defaultValue(); - QString defVal = linkedTextToString(lti); - lti->release(); - printf(" Param type=%s name=%s defvalue=%s\n", - parType.latin1(), par->definitionName()->latin1(),defVal.latin1()); - } + IParamIterator *pli = mem->parameters(); + DumpParamList(pli,6); pli->release(); IMemberReferenceIterator *mri = mem->references(); IMemberReference *mr; @@ -513,6 +523,14 @@ int main(int argc,char **argv) } evi->release(); + pli = mem->templateParameters(); + if (pli) + { + printf(" Template parameters\n"); + DumpParamList(pli,8); + pli->release(); + } + IDoc *doc = mem->briefDescription(); if (doc) { @@ -557,7 +575,7 @@ int main(int argc,char **argv) DumpGraph(cls->collaborationGraph()); printf("==== base classes ==== \n"); - IRelatedCompoundIterator *bcli = cls->baseClasses(); + IRelatedCompoundIterator *bcli = cls->baseCompounds(); IRelatedCompound *bClass; for (bcli->toFirst();(bClass=bcli->current());bcli->toNext()) { @@ -568,7 +586,7 @@ int main(int argc,char **argv) bcli->release(); printf("==== derived classes ==== \n"); - IRelatedCompoundIterator *dcli = cls->derivedClasses(); + IRelatedCompoundIterator *dcli = cls->derivedCompounds(); IRelatedCompound *dClass; for (dcli->toFirst();(dClass=dcli->current());dcli->toNext()) { diff --git a/doc/docblocks.doc b/doc/docblocks.doc index 9cb89e0..e0c9161 100644 --- a/doc/docblocks.doc +++ b/doc/docblocks.doc @@ -120,7 +120,7 @@ Here is an example: <li>If \ref cfg_javadoc_autobrief "JAVADOC_AUTOBRIEF" is set to YES in the configuration file, then using JavaDoc style comment blocks will automatically start a brief description which ends at the - first dot. Here is an example: + first dot followed by a space or new line. Here is an example: \verbatim /** Brief description which ends at this dot. Details follow diff --git a/doc/language.doc b/doc/language.doc index 58a92ec..8ed1c95 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -25,7 +25,7 @@ Doxygen has built-in support for multiple languages. This means that the text fragments that doxygen generates can be produced in languages other than English (the default) at configuration time. -Currently (version 1.2.15-20020421), 26 languages +Currently (version 1.2.15-20020430), 26 languages are supported (sorted alphabetically): Brazilian Portuguese, Chinese, Chinesetraditional, Croatian, Czech, Danish, Dutch, English, Finnish, French, diff --git a/doc/starting.doc b/doc/starting.doc index 6015ffe..1c483e5 100644 --- a/doc/starting.doc +++ b/doc/starting.doc @@ -198,9 +198,9 @@ During parsing the following steps take place: <ul> <li> The special commands inside the documentation are executed. See section \ref commands for an overview of all commands. -<li> If a line starts with some whitespace followed by one or more asterixes +<li> If a line starts with some whitespace followed by one or more asterisks (<tt>*</tt>) and then optionally more whitespace, - then all whitespace and asterixes are removed. + then all whitespace and asterisks are removed. <li> All resulting blank lines are treated as a paragraph separators. This saves you from placing new-paragraph commands yourself in order to make the generated documentation readable. diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index c468fe6..3afc291 100644 --- a/packages/rpm/doxygen.spec +++ b/packages/rpm/doxygen.spec @@ -1,6 +1,6 @@ Summary: A documentation system for C/C++. Name: doxygen -Version: 1.2.15_20020430 +Version: 1.2.15_20020512 Release: 1 Epoch: 1 Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz diff --git a/src/Makefile.in b/src/Makefile.in index e791c61..fcb5f70 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -53,6 +53,6 @@ clean: Makefile.libdoxygen Makefile.doxygen Makefile.doxytag Makefile.doxysearch distclean: clean -$(RM) scanner.cpp doc.cpp code.cpp config.cpp pre.cpp ce_lex.cpp \ ce_parse.cpp ce_parse.h doxytag.cpp tag.cpp \ - declinfo.cpp defargs.cpp + declinfo.cpp defargs.cpp commentcnv.cpp FORCE: diff --git a/src/classdef.cpp b/src/classdef.cpp index 822cc3d..31ea207 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -596,22 +596,22 @@ void ClassDef::setIncludeFile(FileDef *fd,const char *includeName,bool local) } // TODO: fix this: a nested template class can have multiple outer templates -ArgumentList *ClassDef::outerTemplateArguments() const -{ - int ti; - ClassDef *pcd=0; - int pi=0; - if (m_tempArgs) return m_tempArgs; - // find the outer most class scope - while ((ti=name().find("::",pi))!=-1 && - (pcd=getClass(name().left(ti)))==0 - ) pi=ti+2; - if (pcd) - { - return pcd->templateArguments(); - } - return 0; -} +//ArgumentList *ClassDef::outerTemplateArguments() const +//{ +// int ti; +// ClassDef *pcd=0; +// int pi=0; +// if (m_tempArgs) return m_tempArgs; +// // find the outer most class scope +// while ((ti=name().find("::",pi))!=-1 && +// (pcd=getClass(name().left(ti)))==0 +// ) pi=ti+2; +// if (pcd) +// { +// return pcd->templateArguments(); +// } +// return 0; +//} static void searchTemplateSpecs(/*in*/ Definition *d, /*out*/ QList<ArgumentList> &result, @@ -684,6 +684,68 @@ static void writeTemplateSpec(OutputList &ol,Definition *d, ol.writeString("\n"); } } + +// write the detailed description for this class +void ClassDef::writeDetailedDescription(OutputList &ol, OutputList &briefOutput, const QCString &pageType, bool exampleFlag) +{ + if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || + !documentation().isEmpty() || + /*(Config_getBool("SOURCE_BROWSER") && startBodyLine!=-1 && bodyDef) ||*/ + exampleFlag) + { + ol.writeRuler(); + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::RTF); + ol.writeAnchor(0,"_details"); + ol.popGeneratorState(); + ol.startGroupHeader(); + parseText(ol,theTranslator->trDetailedDescription()); + ol.endGroupHeader(); + ol.startTextBlock(); + + writeTemplateSpec(ol,this,pageType); + + // repeat brief description + if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) + { + ol+=briefOutput; + } + if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") && + !documentation().isEmpty()) + { + ol.newParagraph(); + } + // write documentation + if (!documentation().isEmpty()) + { + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::RTF); + ol.newParagraph(); + ol.popGeneratorState(); + parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n"); + } + // write examples + if (exampleFlag) + { + ol.startDescList(BaseOutputDocInterface::Examples); + parseText(ol,theTranslator->trExamples()+": "); + ol.endDescTitle(); + ol.writeDescItem(); + ol.newParagraph(); + writeExample(ol,m_exampleSDict); + //ol.endDescItem(); + ol.endDescList(); + } + ol.newParagraph(); + writeSourceDef(ol,name()); + ol.endTextBlock(); + } + else + { + writeTemplateSpec(ol,this,pageType); + } +} // write all documentation for this class void ClassDef::writeDocumentation(OutputList &ol) @@ -691,16 +753,15 @@ void ClassDef::writeDocumentation(OutputList &ol) // write title QCString pageTitle=name().copy(); QCString pageType; - ArgumentList *outerTempArgList = outerTemplateArguments(); QCString cType=compoundTypeString(); toupper(cType.at(0)); pageType+=" "; pageType+=cType; pageTitle+=pageType+" Reference"; - if (outerTempArgList) pageTitle.prepend(" Template"); + if (m_tempArgs) pageTitle.prepend(" Template"); startFile(ol,getOutputFileBase(),name(),pageTitle); startTitle(ol,getOutputFileBase()); - parseText(ol,theTranslator->trCompoundReference(displayName(),m_compType,outerTempArgList!=0)); + parseText(ol,theTranslator->trCompoundReference(displayName(),m_compType,m_tempArgs!=0)); addGroupListToTitle(ol,this); endTitle(ol,getOutputFileBase(),name()); @@ -714,24 +775,27 @@ void ClassDef::writeDocumentation(OutputList &ol) if (!briefDescription().isEmpty()) { parseDoc(briefOutput,m_defFileName,m_defLine,name(),0,briefDescription()); - ol+=briefOutput; - ol.writeString(" \n"); - ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Html); - ol.startTextLink(0,"_details"); - - if (Config_getBool("REPEAT_BRIEF") || - !documentation().isEmpty() || - exampleFlag - ) + if (!Config_getBool("DETAILS_AT_TOP")) { - parseText(ol,theTranslator->trMore()); + ol+=briefOutput; + ol.writeString(" \n"); + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + ol.startTextLink(0,"_details"); + + if (Config_getBool("REPEAT_BRIEF") || + !documentation().isEmpty() || + exampleFlag + ) + { + parseText(ol,theTranslator->trMore()); + } + ol.endTextLink(); + ol.popGeneratorState(); + ol.disable(OutputGenerator::Man); + ol.newParagraph(); + ol.enable(OutputGenerator::Man); } - ol.endTextLink(); - ol.popGeneratorState(); - ol.disable(OutputGenerator::Man); - ol.newParagraph(); - ol.enable(OutputGenerator::Man); } ol.writeSynopsis(); @@ -990,6 +1054,11 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.endTextBlock(); + // write detailed description if the user wants it near the top + if (Config_getBool("DETAILS_AT_TOP")) { + writeDetailedDescription(ol,briefOutput,pageType,exampleFlag); + } + // write member groups ol.startMemberSections(); @@ -1062,64 +1131,9 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.endMemberSections(); // write detailed description - if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || - !documentation().isEmpty() || - /*(Config_getBool("SOURCE_BROWSER") && startBodyLine!=-1 && bodyDef) ||*/ - exampleFlag) - { - ol.writeRuler(); - ol.pushGeneratorState(); - ol.disable(OutputGenerator::Latex); - ol.disable(OutputGenerator::RTF); - ol.writeAnchor(0,"_details"); - ol.popGeneratorState(); - ol.startGroupHeader(); - parseText(ol,theTranslator->trDetailedDescription()); - ol.endGroupHeader(); - ol.startTextBlock(); - - writeTemplateSpec(ol,this,pageType); - - // repeat brief description - if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) - { - ol+=briefOutput; - } - if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") && - !documentation().isEmpty()) - { - ol.newParagraph(); - } - // write documentation - if (!documentation().isEmpty()) - { - ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::RTF); - ol.newParagraph(); - ol.popGeneratorState(); - parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n"); - } - // write examples - if (exampleFlag) - { - ol.startDescList(BaseOutputDocInterface::Examples); - parseText(ol,theTranslator->trExamples()+": "); - ol.endDescTitle(); - ol.writeDescItem(); - ol.newParagraph(); - writeExample(ol,m_exampleSDict); - //ol.endDescItem(); - ol.endDescList(); - } - ol.newParagraph(); - writeSourceDef(ol,name()); - ol.endTextBlock(); + if (!Config_getBool("DETAILS_AT_TOP")) { + writeDetailedDescription(ol,briefOutput,pageType,exampleFlag); } - else - { - writeTemplateSpec(ol,this,pageType); - } - typedefMembers.writeDocumentation(ol,name(),this, diff --git a/src/classdef.h b/src/classdef.h index e33ec4e..67c620f 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -102,6 +102,7 @@ class ClassDef : public Definition void writeDocumentationForInnerClasses(OutputList &ol); void writeMemberList(OutputList &ol); void writeDeclaration(OutputList &ol,MemberDef *md,bool inGroup); + void writeDetailedDescription(OutputList &ol,OutputList &briefOutput,const QCString &pageType,bool exampleFlag); /*! Return the protection level (Public,Protected,Private) in which * this compound was found. @@ -129,7 +130,7 @@ class ClassDef : public Definition * from its outer class (doxygen assumes there is only one!). * Will return 0 if not applicable. */ - ArgumentList *outerTemplateArguments() const; + //ArgumentList *outerTemplateArguments() const; /*! Returns the namespace this compound is in, or 0 if it has a global * scope. diff --git a/src/config.l b/src/config.l index c3409d8..ceffb23 100644 --- a/src/config.l +++ b/src/config.l @@ -1481,6 +1481,14 @@ void Config::create() FALSE ); cb = addBool( + "DETAILS_AT_TOP", + "If the DETAILS_AT_TOP tag is set to YES then Doxygen \n" + "will output the detailed description near the top, like JavaDoc.\n" + "If set to NO, the detailed description appears after the member \n" + "documentation. \n", + FALSE + ); + cb = addBool( "INHERIT_DOCS", "If the INHERIT_DOCS tag is set to YES (the default) then an undocumented \n" "member inherits the documentation from any documented member that it \n" diff --git a/src/dot.cpp b/src/dot.cpp index c421c2c..ffd4abd 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -1753,6 +1753,18 @@ void writeDotGraphFromFile(const char *inFile,const char *outFile, { err("Problems running dot. Check your installation!\n"); } + // Added by Nils Strom + if ( (format==EPS) && (Config_getBool("USE_PDFLATEX")) ) + { + QCString epstopdfArgs(4096); + epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", + outFile,outFile); + if (iSystem("epstopdf",epstopdfArgs,TRUE)!=0) + { + err("Error: Problems running epstopdf. Check your TeX installation!\n"); + } + } + if (format==BITMAP) checkDotResult(imgName); } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 5824c07..6c1aff5 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -58,7 +58,7 @@ #include "defgen.h" #include "reflist.h" #include "page.h" -#include "packagedef.h" +//#include "packagedef.h" #include "bufstr.h" #include "commentcnv.h" @@ -88,7 +88,7 @@ FormulaList Doxygen::formulaList; // all formulas FormulaDict Doxygen::formulaDict(1009); // all formulas FormulaDict Doxygen::formulaNameDict(1009); // the label name of all formulas -PackageSDict Doxygen::packageDict(257); // java packages +//PackageSDict Doxygen::packageDict(257); // java packages PageSDict *Doxygen::pageSDict = new PageSDict(1009); // all doc pages PageSDict *Doxygen::exampleSDict = new PageSDict(1009); // all examples @@ -889,6 +889,7 @@ static void buildNamespaceList(Entry *root) // also add namespace to the correct structural context Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,fullName); + //printf("adding namespace %s to context %s\n",nd->name().data(),d?d->name().data():"none"); if (d==0) { // TODO: Due to the order in which the tag file is written @@ -5646,16 +5647,16 @@ static void findMainPage(Entry *root) //---------------------------------------------------------------------------- /*! Add Java classes to their respective packages */ -static void addClassesToPackages() -{ - ClassDef *cd; - ClassSDict::Iterator cli(Doxygen::classSDict); - for (;(cd=cli.current());++cli) - { - PackageDef *pd = cd->packageDef(); - if (pd) pd->addClass(cd); - } -} +//static void addClassesToPackages() +//{ +// ClassDef *cd; +// ClassSDict::Iterator cli(Doxygen::classSDict); +// for (;(cd=cli.current());++cli) +// { +// PackageDef *pd = cd->packageDef(); +// if (pd) pd->addClass(cd); +// } +//} //---------------------------------------------------------------------------- @@ -7336,8 +7337,8 @@ void parseInput() msg("Computing member relations...\n"); computeMemberRelations(); - msg("Adding classes to their packages...\n"); - addClassesToPackages(); + //msg("Adding classes to their packages...\n"); + //addClassesToPackages(); msg("Building full member lists recursively...\n"); buildCompleteMemberLists(); diff --git a/src/doxygen.h b/src/doxygen.h index d2331f0..1dfafc2 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -32,7 +32,7 @@ #include "formula.h" #include "section.h" #include "membergroup.h" -#include "packagedef.h" +//#include "packagedef.h" class PageSList; class PageSDict; @@ -92,7 +92,7 @@ class Doxygen static QIntDict<QCString> memberHeaderDict; // dictionary of the member groups heading static QIntDict<QCString> memberDocDict; // dictionary of the member groups heading static QDict<void> expandAsDefinedDict; - static PackageSDict packageDict; + //static PackageSDict packageDict; static NamespaceDef *globalScope; }; diff --git a/src/filedef.cpp b/src/filedef.cpp index 177cfa6..b48ba25 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -98,6 +98,57 @@ void FileDef::distributeMemberGroupDocumentation() } } +void FileDef::writeDetailedDocumentation(OutputList &ol) +{ + if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || + !documentation().isEmpty() + ) + { + ol.writeRuler(); + ol.pushGeneratorState(); + //bool latexOn = ol.isEnabled(OutputGenerator::Latex); + //if (latexOn) ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::RTF); + ol.writeAnchor(0,"_details"); + //if (latexOn) ol.enable(OutputGenerator::Latex); + ol.popGeneratorState(); + ol.startGroupHeader(); + parseText(ol,theTranslator->trDetailedDescription()); + ol.endGroupHeader(); + if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) + { + parseDoc(ol,filepath,1,0,0,briefDescription()); + } + if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") && + !documentation().isEmpty()) + { + ol.newParagraph(); + } + if (!documentation().isEmpty()) + { + //if (doc.at(dl-1)!='.' && doc.at(dl-1)!='!' && doc.at(dl-1)!='?') + // doc+='.'; + parseDoc(ol,filepath,1,0,0,documentation()+"\n"); + } + //printf("Writing source ref for file %s\n",name().data()); + if (Config_getBool("SOURCE_BROWSER")) + { + ol.newParagraph(); + QCString refText = theTranslator->trDefinedInSourceFile(); + int fileMarkerPos = refText.find("@0"); + if (fileMarkerPos!=-1) // should always pass this. + { + parseText(ol,refText.left(fileMarkerPos)); //text left from marker 1 + ol.writeObjectLink(0,getSourceFileBase(), + 0,name()); + parseText(ol,refText.right( + refText.length()-fileMarkerPos-2)); // text right from marker 2 + } + } + } +} + /*! Write the documentation page for this file to the file of output generators \a ol. */ @@ -132,15 +183,13 @@ void FileDef::writeDocumentation(OutputList &ol) } ol.startTextBlock(); - //brief=brief.stripWhiteSpace(); - //int bl=brief.length(); - OutputList briefOutput(&ol); - if (briefDescription()) + if (Config_getBool("DETAILS_AT_TOP")) + { + writeDetailedDocumentation(ol); + } + else if (briefDescription()) { - //if (brief.at(bl-1)!='.' && brief.at(bl-1)!='!' && brief.at(bl!='?')) - // brief+='.'; - parseDoc(briefOutput,filepath,1,0,0,briefDescription()); - ol+=briefOutput; + parseDoc(ol,filepath,1,0,0,briefDescription()); ol.writeString(" \n"); ol.disableAllBut(OutputGenerator::Html); ol.startTextLink(0,"_details"); @@ -198,6 +247,8 @@ void FileDef::writeDocumentation(OutputList &ol) const char *locStr = (ii->local || isIDLorJava) ? "yes" : "no"; Doxygen::tagFile << " <includes id=\"" << convertToXML(fd->getOutputFileBase()) + << "\" name=\"" + << convertToXML(fd->name()) << "\" local=\"" << locStr << "\">" << convertToXML(ii->includeName) << "</includes>" @@ -347,56 +398,9 @@ void FileDef::writeDocumentation(OutputList &ol) decVarMembers.writeDeclarations(ol,0,0,this,0,theTranslator->trVariables(),0); ol.endMemberSections(); - //doc=doc.stripWhiteSpace(); - //int bl=brief.length(); - //int dl=doc.length(); - if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || - !documentation().isEmpty() - /* || startBodyLine!=-1 */ - ) + if (!Config_getBool("DETAILS_AT_TOP")) { - ol.writeRuler(); - ol.pushGeneratorState(); - //bool latexOn = ol.isEnabled(OutputGenerator::Latex); - //if (latexOn) ol.disable(OutputGenerator::Latex); - ol.disable(OutputGenerator::Latex); - ol.disable(OutputGenerator::RTF); - ol.writeAnchor(0,"_details"); - //if (latexOn) ol.enable(OutputGenerator::Latex); - ol.popGeneratorState(); - ol.startGroupHeader(); - parseText(ol,theTranslator->trDetailedDescription()); - ol.endGroupHeader(); - if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) - { - ol+=briefOutput; - } - if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") && - !documentation().isEmpty()) - { - ol.newParagraph(); - } - if (!documentation().isEmpty()) - { - //if (doc.at(dl-1)!='.' && doc.at(dl-1)!='!' && doc.at(dl-1)!='?') - // doc+='.'; - parseDoc(ol,filepath,1,0,0,documentation()+"\n"); - } - //printf("Writing source ref for file %s\n",name().data()); - if (Config_getBool("SOURCE_BROWSER")) - { - ol.newParagraph(); - QCString refText = theTranslator->trDefinedInSourceFile(); - int fileMarkerPos = refText.find("@0"); - if (fileMarkerPos!=-1) // should always pass this. - { - parseText(ol,refText.left(fileMarkerPos)); //text left from marker 1 - ol.writeObjectLink(0,getSourceFileBase(), - 0,name()); - parseText(ol,refText.right( - refText.length()-fileMarkerPos-2)); // text right from marker 2 - } - } + writeDetailedDocumentation(ol); } docDefineMembers.writeDocumentation(ol,name(),this, diff --git a/src/filedef.h b/src/filedef.h index 4841d1c..acd39ed 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -119,6 +119,7 @@ class FileDef : public Definition } bool isIncluded(const QCString &name) const; + void writeDetailedDocumentation(OutputList &ol); void writeDocumentation(OutputList &ol); void writeSource(OutputList &ol); friend void generatedFileNames(); diff --git a/src/groupdef.cpp b/src/groupdef.cpp index fdb12b0..e1b27da 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -336,6 +336,40 @@ void GroupDef::computeAnchors() setAnchors(0,'a',allMemberList); } +void GroupDef::writeDetailedDocumentation(OutputList &ol) +{ + if (!briefDescription().isEmpty() || !documentation().isEmpty()) + { + + if (pageDict->count()!=countMembers()) // classical layout + { + ol.writeRuler(); + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Latex); + ol.disable(OutputGenerator::RTF); + ol.writeAnchor(0,"_details"); + ol.popGeneratorState(); + ol.startGroupHeader(); + parseText(ol,theTranslator->trDetailedDescription()); + ol.endGroupHeader(); + + // repeat brief description + if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) + { + parseDoc(ol,m_defFileName,m_defLine,name(),0,briefDescription()); + ol.newParagraph(); + } + } + + // write documentation + if (!documentation().isEmpty()) + { + parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n"); + } + } +} + + void GroupDef::writeDocumentation(OutputList &ol) { ol.pushGeneratorState(); @@ -346,13 +380,13 @@ void GroupDef::writeDocumentation(OutputList &ol) addGroupListToTitle(ol,this); endTitle(ol,getOutputFileBase(),title); - //brief=brief.stripWhiteSpace(); - //int bl=brief.length(); - OutputList briefOutput(&ol); - if (!briefDescription().isEmpty()) + if (Config_getBool("DETAILS_AT_TOP")) + { + writeDetailedDocumentation(ol); + } + else if (!briefDescription().isEmpty()) { - parseDoc(briefOutput,m_defFileName,m_defLine,name(),0,briefDescription()); - ol+=briefOutput; + parseDoc(ol,m_defFileName,m_defLine,name(),0,briefDescription()); ol.writeString(" \n"); ol.pushGeneratorState(); ol.disable(OutputGenerator::Latex); @@ -490,36 +524,11 @@ void GroupDef::writeDocumentation(OutputList &ol) } ol.endMemberSections(); - - if (!briefDescription().isEmpty() || !documentation().isEmpty()) + if (!Config_getBool("DETAILS_AT_TOP")) { - - if (pageDict->count()!=countMembers()) // classical layout - { - ol.writeRuler(); - ol.pushGeneratorState(); - ol.disable(OutputGenerator::Latex); - ol.disable(OutputGenerator::RTF); - ol.writeAnchor(0,"_details"); - ol.popGeneratorState(); - ol.startGroupHeader(); - parseText(ol,theTranslator->trDetailedDescription()); - ol.endGroupHeader(); - - // repeat brief description - if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) - { - ol+=briefOutput; - ol.newParagraph(); - } - } - - // write documentation - if (!documentation().isEmpty()) - { - parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n"); - } + writeDetailedDocumentation(ol); } + PageInfo *pi=0; PageSDict::Iterator pdi(*pageDict); for (pdi.toFirst();(pi=pdi.current());++pdi) diff --git a/src/groupdef.h b/src/groupdef.h index f371d49..a119d61 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -58,6 +58,7 @@ class GroupDef : public Definition void insertMember(MemberDef *def,bool docOnly=FALSE); void removeMember(MemberDef *md); bool containsGroup(const GroupDef *def); // true if def is already a subgroup + void writeDetailedDocumentation(OutputList &ol); void writeDocumentation(OutputList &ol); int countMembers() const; bool isLinkableInProject() const diff --git a/src/index.cpp b/src/index.cpp index 534cd42..d82e923 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -36,7 +36,7 @@ #include "ftvhelp.h" #include "dot.h" #include "page.h" -#include "packagedef.h" +//#include "packagedef.h" int annotatedClasses; int hierarchyClasses; @@ -50,7 +50,7 @@ int documentedNamespaceMembers; int documentedIncludeFiles; int documentedPages; int indexedPages; -int documentedPackages; +//int documentedPackages; int countClassHierarchy(); int countClassMembers(); @@ -62,7 +62,7 @@ int countAnnotatedClasses(); int countNamespaceMembers(); int countIncludeFiles(); void countRelatedPages(int &docPages,int &indexPages); -int countPackages(); +//int countPackages(); void countDataStructures() { @@ -75,7 +75,7 @@ void countDataStructures() documentedGroups = countGroups(); documentedNamespaces = countNamespaces(); documentedNamespaceMembers = countNamespaceMembers(); - documentedPackages = countPackages(); + //documentedPackages = countPackages(); } static void startIndexHierarchy(OutputList &ol,int level) @@ -2116,20 +2116,20 @@ void countRelatedPages(int &docPages,int &indexPages) //---------------------------------------------------------------------------- -int countPackages() -{ - int count=0; - PackageSDict::Iterator pdi(Doxygen::packageDict); - PackageDef *pd=0; - for (pdi.toFirst();(pd=pdi.current());++pdi) - { - if (!pd->isReference()) - { - count++; - } - } - return count; -} +//int countPackages() +//{ +// int count=0; +// PackageSDict::Iterator pdi(Doxygen::packageDict); +// PackageDef *pd=0; +// for (pdi.toFirst();(pd=pdi.current());++pdi) +// { +// if (!pd->isReference()) +// { +// count++; +// } +// } +// return count; +//} //---------------------------------------------------------------------------- @@ -2808,12 +2808,12 @@ void writeIndex(OutputList &ol) } - if (documentedPackages>0) - { - ol.startIndexSection(isPackageIndex); - parseText(ol,projPrefix+theTranslator->trPackageList()); - ol.endIndexSection(isPackageIndex); - } + //if (documentedPackages>0) + //{ + // ol.startIndexSection(isPackageIndex); + // parseText(ol,projPrefix+theTranslator->trPackageList()); + // ol.endIndexSection(isPackageIndex); + //} if (documentedGroups>0) { ol.startIndexSection(isModuleIndex); @@ -2851,12 +2851,12 @@ void writeIndex(OutputList &ol) ol.endIndexSection(isPageIndex); } ol.lastIndexPage(); - if (documentedPackages>0) - { - ol.startIndexSection(isPackageDocumentation); - parseText(ol,projPrefix+theTranslator->trPackageDocumentation()); - ol.endIndexSection(isPackageDocumentation); - } + //if (documentedPackages>0) + //{ + // ol.startIndexSection(isPackageDocumentation); + // parseText(ol,projPrefix+theTranslator->trPackageDocumentation()); + // ol.endIndexSection(isPackageDocumentation); + //} if (documentedGroups>0) { ol.startIndexSection(isModuleDocumentation); diff --git a/src/index.h b/src/index.h index 383b5dd..6acf4a7 100644 --- a/src/index.h +++ b/src/index.h @@ -26,14 +26,14 @@ enum IndexSections isTitlePageStart, isTitlePageAuthor, isMainPage, - isPackageIndex, +// isPackageIndex, isModuleIndex, isNamespaceIndex, isClassHierarchyIndex, isCompoundIndex, isFileIndex, isPageIndex, - isPackageDocumentation, +// isPackageDocumentation, isModuleDocumentation, isNamespaceDocumentation, isClassDocumentation, @@ -82,7 +82,7 @@ extern int documentedNamespaceMembers; extern int documentedIncludeFiles; extern int documentedPages; extern int indexedPages; -extern int documentedPackages; +//extern int documentedPackages; void startTitle(OutputList &ol,const char *fileName); void endTitle(OutputList &ol,const char *fileName,const char *name); diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 4ecc4d1..6665d1f 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -473,10 +473,10 @@ void LatexGenerator::startIndexSection(IndexSections is) if (compactLatex) t << "\\section"; else t << "\\chapter"; t << "{"; //Introduction}\n" break; - case isPackageIndex: - if (compactLatex) t << "\\section"; else t << "\\chapter"; - t << "{"; //Package Index}\n" - break; + //case isPackageIndex: + // if (compactLatex) t << "\\section"; else t << "\\chapter"; + // t << "{"; //Package Index}\n" + // break; case isModuleIndex: if (compactLatex) t << "\\section"; else t << "\\chapter"; t << "{"; //Module Index}\n" @@ -501,21 +501,21 @@ void LatexGenerator::startIndexSection(IndexSections is) if (compactLatex) t << "\\section"; else t << "\\chapter"; t << "{"; //Annotated Page Index}\n" break; - case isPackageDocumentation: - { - PackageSDict::Iterator pdi(Doxygen::packageDict); - PackageDef *pd=pdi.toFirst(); - bool found=FALSE; - while (pd && !found) - { - if (compactLatex) t << "\\section"; else t << "\\chapter"; - t << "{"; - found=TRUE; - ++pdi; - pd=pdi.current(); - } - } - break; +// case isPackageDocumentation: +// { +// PackageSDict::Iterator pdi(Doxygen::packageDict); +// PackageDef *pd=pdi.toFirst(); +// bool found=FALSE; +// while (pd && !found) +// { +// if (compactLatex) t << "\\section"; else t << "\\chapter"; +// t << "{"; +// found=TRUE; +// ++pdi; +// pd=pdi.current(); +// } +// } +// break; case isModuleDocumentation: { GroupSDict::Iterator gli(Doxygen::groupSDict); @@ -629,9 +629,9 @@ void LatexGenerator::endIndexSection(IndexSections is) t << "\\input{" << indexName << "}\n"; } break; - case isPackageIndex: - t << "}\n\\input{packages}\n"; - break; + //case isPackageIndex: + // t << "}\n\\input{packages}\n"; + // break; case isModuleIndex: t << "}\n\\input{modules}\n"; break; @@ -650,27 +650,27 @@ void LatexGenerator::endIndexSection(IndexSections is) case isPageIndex: t << "}\n\\input{pages}\n"; break; - case isPackageDocumentation: - { - PackageSDict::Iterator pdi(Doxygen::packageDict); - PackageDef *pd=pdi.toFirst(); - bool found=FALSE; - while (pd && !found) - { - t << "}\n\\input{" << pd->getOutputFileBase() << "}\n"; - found=TRUE; - ++pdi; - pd=pdi.current(); - } - while (pd) - { - if (compactLatex) t << "\\input"; else t << "\\include"; - t << "{" << pd->getOutputFileBase() << "}\n"; - ++pdi; - pd=pdi.current(); - } - } - break; + //case isPackageDocumentation: + // { + // PackageSDict::Iterator pdi(Doxygen::packageDict); + // PackageDef *pd=pdi.toFirst(); + // bool found=FALSE; + // while (pd && !found) + // { + // t << "}\n\\input{" << pd->getOutputFileBase() << "}\n"; + // found=TRUE; + // ++pdi; + // pd=pdi.current(); + // } + // while (pd) + // { + // if (compactLatex) t << "\\input"; else t << "\\include"; + // t << "{" << pd->getOutputFileBase() << "}\n"; + // ++pdi; + // pd=pdi.current(); + // } + // } + // break; case isModuleDocumentation: { GroupSDict::Iterator gli(Doxygen::groupSDict); @@ -1761,7 +1761,15 @@ void LatexGenerator::startDotFile(const char *name,bool hasCaption) else t << "\\mbox{"; t << "\\includegraphics"; - t << "{" << baseName << ".eps}"; + if( Config_getBool("USE_PDFLATEX") ) + { + t << "{" << baseName << ".pdf}"; + } + else + { + t << "{" << baseName << ".eps}"; + } + if (hasCaption) t << "\\caption{"; else diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 7adc450..7d8c8d2 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -872,7 +872,6 @@ void MemberDef::writeDeclaration(OutputList &ol, { ol.startTextLink(0,anchor()); } - parseText(ol,theTranslator->trMore()); ol.endTextLink(); ol.startEmphasis(); ol.popGeneratorState(); @@ -1049,7 +1048,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, { bool first=TRUE; if (m_defTmpArgLists) - // definition has explicate template parameter declarations + // definition has explicit template parameter declarations { QListIterator<ArgumentList> ali(*m_defTmpArgLists); ArgumentList *tal; @@ -1064,7 +1063,8 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, } } } - else + else // definition gets it template parameters from its class + // (since no definition was found) { if (cd) { diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 3a98438..56c92ca 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -72,6 +72,19 @@ void NamespaceDef::insertUsedFile(const char *f) } } +void NamespaceDef::addInnerCompound(Definition *d) +{ + m_innerCompounds->append(d->localName(),d); + if (d->definitionType()==Definition::TypeNamespace) + { + insertNamespace((NamespaceDef *)d); + } + else if (d->definitionType()==Definition::TypeClass) + { + insertClass((ClassDef *)d); + } +} + void NamespaceDef::insertClass(ClassDef *cd) { if (classSDict->find(cd->name())==0) @@ -170,6 +183,41 @@ void NamespaceDef::computeAnchors() setAnchors(0,'a',&allMemberList); } +void NamespaceDef::writeDetailedDocumentation(OutputList &ol) +{ + if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || + !documentation().isEmpty()) + { + ol.writeRuler(); + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + //bool latexOn = ol.isEnabled(OutputGenerator::Latex); + //if (latexOn) ol.disable(OutputGenerator::Latex); + ol.writeAnchor(0,"_details"); + //if (latexOn) ol.enable(OutputGenerator::Latex); + ol.popGeneratorState(); + ol.startGroupHeader(); + parseText(ol,theTranslator->trDetailedDescription()); + ol.endGroupHeader(); + ol.startTextBlock(); + if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) + { + parseDoc(ol,m_defFileName,m_defLine,name(),0,briefDescription()); + } + if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") && + !documentation().isEmpty()) + { + ol.newParagraph(); + } + if (!documentation().isEmpty()) + { + parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n"); + ol.newParagraph(); + } + ol.endTextBlock(); + } +} + void NamespaceDef::writeDocumentation(OutputList &ol) { QCString pageTitle=name()+" Namespace Reference"; @@ -196,11 +244,13 @@ void NamespaceDef::writeDocumentation(OutputList &ol) ol.startTextBlock(); - OutputList briefOutput(&ol); - if (!briefDescription().isEmpty()) + if (Config_getBool("DETAILS_AT_TOP")) + { + writeDetailedDocumentation(ol); + } + else if (!briefDescription().isEmpty()) { - parseDoc(briefOutput,m_defFileName,m_defLine,name(),0,briefDescription()); - ol+=briefOutput; + parseDoc(ol,m_defFileName,m_defLine,name(),0,briefDescription()); ol.writeString(" \n"); ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); @@ -226,7 +276,6 @@ 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); @@ -237,36 +286,9 @@ void NamespaceDef::writeDocumentation(OutputList &ol) decVarMembers.writeDeclarations(ol,0,this,0,0,theTranslator->trVariables(),0); ol.endMemberSections(); - if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || - !documentation().isEmpty()) + if (!Config_getBool("DETAILS_AT_TOP")) { - ol.writeRuler(); - ol.pushGeneratorState(); - ol.disableAllBut(OutputGenerator::Html); - //bool latexOn = ol.isEnabled(OutputGenerator::Latex); - //if (latexOn) ol.disable(OutputGenerator::Latex); - ol.writeAnchor(0,"_details"); - //if (latexOn) ol.enable(OutputGenerator::Latex); - ol.popGeneratorState(); - ol.startGroupHeader(); - parseText(ol,theTranslator->trDetailedDescription()); - ol.endGroupHeader(); - ol.startTextBlock(); - if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) - { - ol+=briefOutput; - } - if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") && - !documentation().isEmpty()) - { - ol.newParagraph(); - } - if (!documentation().isEmpty()) - { - parseDoc(ol,m_defFileName,m_defLine,name(),0,documentation()+"\n"); - ol.newParagraph(); - } - ol.endTextBlock(); + writeDetailedDocumentation(ol); } docDefineMembers.writeDocumentation(ol,name(),this, @@ -340,11 +362,6 @@ Definition *NamespaceDef::findInnerCompound(const char *n) return m_innerCompounds->find(n); } -void NamespaceDef::addInnerCompound(Definition *d) -{ - m_innerCompounds->append(d->localName(),d); -} - void NamespaceDef::addListReferences() { addRefItem(todoId(),testId(),bugId(), diff --git a/src/namespacedef.h b/src/namespacedef.h index 5df8fa6..825242e 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -43,6 +43,8 @@ class NamespaceDef : public Definition DefType definitionType() { return TypeNamespace; } QCString getOutputFileBase() const; void insertUsedFile(const char *fname); + + void writeDetailedDocumentation(OutputList &ol); void writeDocumentation(OutputList &ol); void insertClass(ClassDef *cd); @@ -167,6 +167,26 @@ static FILE *checkAndOpenFile(const QCString &absName) QFileInfo fi(absName); if (fi.exists() && fi.isFile()) { + // check include stack for absFileName + + QStack<FileState> tmpStack; + g_includeStack.setAutoDelete(FALSE); + FileState *fs; + bool alreadyIncluded=FALSE; + while ((fs=g_includeStack.pop())) + { + if (fs->fileName==absName) alreadyIncluded=TRUE; + tmpStack.push(fs); + } + while ((fs=tmpStack.pop())) + { + g_includeStack.push(fs); + } + g_includeStack.setAutoDelete(TRUE); + + if (alreadyIncluded) return 0; + + if (!Config_getString("INPUT_FILTER").isEmpty()) { QCString cmd = Config_getString("INPUT_FILTER")+" "+absName; @@ -934,6 +954,7 @@ static void readIncludeFile(const QCString &inc) // add included by dependency if (g_yyFileDef) { + //printf("Adding include dependency %s->%s\n",oldFileDef->name().data(),incFileName.data()); g_yyFileDef->addIncludedByDependency(oldFileDef,oldFileDef->name(),localInclude); } } @@ -952,6 +973,7 @@ static void readIncludeFile(const QCString &inc) //lineStr.sprintf("# 1 \"%s\" 1\n",g_yyFileName.data()); //outputArray(lineStr.data(),lineStr.length()); + //fprintf(stderr,"Switching to include file %s\n",incFileName.data()); preYYin=f; yy_switch_to_buffer(yy_create_buffer(preYYin, YY_BUF_SIZE)); } @@ -966,12 +988,13 @@ static void readIncludeFile(const QCString &inc) // add included by dependency if (fd) { + //printf("Adding include dependency (2) %s->%s ambig=%d\n",oldFileDef->name().data(),fd->name().data(),ambig); fd->addIncludedByDependency(oldFileDef,oldFileDef->name(),localInclude); } } if (Debug::isFlagSet(Debug::Preprocessor)) { - msg("#include %s: not found! skipping...\n",incFileName.data()); + msg("#include %s: not found or already included! skipping...\n",incFileName.data()); //printf("Error: include file %s not found\n",yytext); } } @@ -1751,11 +1774,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) <SkipSingleQuote>. { g_defText += *yytext; g_defLitText+=yytext; } <DefineText>. { g_defText += *yytext; g_defLitText+=yytext; } <<EOF>> { - //printf("End of include file\n"); + //fprintf(stderr,"End of include file\n"); //printf("Include stack depth=%d\n",g_includeStack.count()); if (g_includeStack.isEmpty()) { - //printf("Terminating scanner!\n"); + //fprintf(stderr,"Terminating scanner!\n"); yyterminate(); } else @@ -1771,7 +1794,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) yy_delete_buffer( oldBuf ); g_yyLineNr=fs->lineNr; setFileName(fs->fileName.copy()); - //printf("######## FileName %s\n",g_yyFileName.data()); + //fprintf(stderr,"######## FileName %s\n",g_yyFileName.data()); // TODO: Enable this to deal with file changes due to // #include's within { .. } blocks @@ -1780,8 +1803,6 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) //outputArray(lineStr.data(),lineStr.length()); delete fs; fs=0; - - } } <*>"/*" { diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index d84c54f..1dc2d2b 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -926,10 +926,10 @@ void RTFGenerator::startIndexSection(IndexSections is) //Introduction beginRTFChapter(); break; - case isPackageIndex: - //Package Index - beginRTFChapter(); - break; + //case isPackageIndex: + // //Package Index + // beginRTFChapter(); + // break; case isModuleIndex: //Module Index beginRTFChapter(); @@ -955,21 +955,21 @@ void RTFGenerator::startIndexSection(IndexSections is) //Related Page Index beginRTFChapter(); break; - case isPackageDocumentation: - { - //Package Documentation - PackageSDict::Iterator pdi(Doxygen::packageDict); - PackageDef *pd=pdi.toFirst(); - bool found=FALSE; - while (pd && !found) - { - beginRTFChapter(); - found=TRUE; - ++pdi; - pd=pdi.current(); - } - } - break; + //case isPackageDocumentation: + // { + // //Package Documentation + // PackageSDict::Iterator pdi(Doxygen::packageDict); + // PackageDef *pd=pdi.toFirst(); + // bool found=FALSE; + // while (pd && !found) + // { + // beginRTFChapter(); + // found=TRUE; + // ++pdi; + // pd=pdi.current(); + // } + // } + // break; case isModuleDocumentation: { //Module Documentation @@ -1136,11 +1136,11 @@ void RTFGenerator::endIndexSection(IndexSections is) if (Config_getBool("GENERATE_TREEVIEW")) t << "main"; else t << "index"; t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n"; break; - case isPackageIndex: - t << "\\par " << Rtf_Style_Reset << endl; - t << "{\\tc \\v " << theTranslator->trPackageList() << "}"<< endl; - t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"packages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n"; - break; + //case isPackageIndex: + // t << "\\par " << Rtf_Style_Reset << endl; + // t << "{\\tc \\v " << theTranslator->trPackageList() << "}"<< endl; + // t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"packages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n"; + // break; case isModuleIndex: t << "\\par " << Rtf_Style_Reset << endl; t << "{\\tc \\v " << theTranslator->trModuleIndex() << "}"<< endl; @@ -1171,22 +1171,22 @@ void RTFGenerator::endIndexSection(IndexSections is) t << "{\\tc \\v " << theTranslator->trPageIndex() << "}"<< endl; t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \"pages.rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n"; break; - case isPackageDocumentation: - { - PackageSDict::Iterator pdi(Doxygen::packageDict); - PackageDef *pd=pdi.toFirst(); - t << "{\\tc \\v " << theTranslator->trPackageDocumentation() << "}"<< endl; - while (pd) - { - t << "\\par " << Rtf_Style_Reset << endl; - t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \""; - t << pd->getOutputFileBase(); - t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n"; - ++pdi; - pd=pdi.current(); - } - } - break; + //case isPackageDocumentation: + // { + // PackageSDict::Iterator pdi(Doxygen::packageDict); + // PackageDef *pd=pdi.toFirst(); + // t << "{\\tc \\v " << theTranslator->trPackageDocumentation() << "}"<< endl; + // while (pd) + // { + // t << "\\par " << Rtf_Style_Reset << endl; + // t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \""; + // t << pd->getOutputFileBase(); + // t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n"; + // ++pdi; + // pd=pdi.current(); + // } + // } + // break; case isModuleDocumentation: { GroupSDict::Iterator gli(Doxygen::groupSDict); diff --git a/src/tagreader.cpp b/src/tagreader.cpp index c40a442..acbcb0c 100644 --- a/src/tagreader.cpp +++ b/src/tagreader.cpp @@ -96,6 +96,7 @@ class TagIncludeInfo public: QString id; QString name; + QString text; bool isLocal; }; @@ -446,6 +447,7 @@ class TagFileParser : public QXmlDefaultHandler { m_curIncludes = new TagIncludeInfo; m_curIncludes->id = attrib.value("id"); + m_curIncludes->name = attrib.value("name"); m_curIncludes->isLocal = attrib.value("local")=="yes" ? TRUE : FALSE; m_curFile->includes.append(m_curIncludes); } @@ -457,7 +459,7 @@ class TagFileParser : public QXmlDefaultHandler } void endIncludes() { - m_curIncludes->name = m_curString; + m_curIncludes->text = m_curString; } void endTemplateArg() { @@ -1170,16 +1172,21 @@ void TagFileParser::addIncludes() TagIncludeInfo *ii; for (;(ii=mii.current());++mii) { + //printf("ii->name=`%s'\n",ii->name.data()); FileName *ifn = Doxygen::inputNameDict->find(ii->name); - FileNameIterator ifni(*ifn); - FileDef *ifd; - for (;(ifd=ifni.current());++ifni) + ASSERT(ifn!=0); + if (ifn) { - printf("ifd->getOutputFileBase()=%s ii->id=%s\n", - ifd->getOutputFileBase().data(),ii->id.data()); - if (ifd->getOutputFileBase()==QCString(ii->id)) + FileNameIterator ifni(*ifn); + FileDef *ifd; + for (;(ifd=ifni.current());++ifni) { - fd->addIncludeDependency(ifd,ii->name,ii->isLocal); + //printf("ifd->getOutputFileBase()=%s ii->id=%s\n", + // ifd->getOutputFileBase().data(),ii->id.data()); + if (ifd->getOutputFileBase()==QCString(ii->id)) + { + fd->addIncludeDependency(ifd,ii->text,ii->isLocal); + } } } } diff --git a/src/translator_br.h b/src/translator_br.h index e81ef2b..74e1dea 100644 --- a/src/translator_br.h +++ b/src/translator_br.h @@ -13,7 +13,12 @@ * Brazilian Portuguese version by * Fabio "FJTC" Jun Takada Chino <chino@icmc.sc.usp.br> * http://www.icmc.sc.usp.br/~chino - * Version: 1.2.13 (2002/01/24) + * Version: 1.2.13.2 (2002/05/10) + * + * History: + * 1.2.13.2 (2002/05/10): + * - Latex Babel package language name fixed. + * - "Estrura" bug identified and fixed (Thanks to Jorge Ramos). */ #ifndef TRANSLATOR_BR_H #define TRANSLATOR_BR_H @@ -33,9 +38,7 @@ class TranslatorBrazilian: public Translator */ virtual QCString idLanguage() { - /* I'm not sure if it is correct. I did not found the documentation - of BabelPackage. If you know the right string, please contact me. */ - return "portuges"; + return "brazil"; } /*! Used to get the command(s) for the language support. This method @@ -737,7 +740,7 @@ class TranslatorBrazilian: public Translator switch(compType) { case ClassDef::Class: result+="classe "; break; - case ClassDef::Struct: result+="estrura "; break; + case ClassDef::Struct: result+="estrutura "; break; case ClassDef::Union: result+="uni緌 "; break; case ClassDef::Interface: result+="interface "; break; case ClassDef::Exception: result+="exce誽o "; break; diff --git a/src/translator_tw.h b/src/translator_tw.h index abd798a..6cef372 100644 --- a/src/translator_tw.h +++ b/src/translator_tw.h @@ -292,11 +292,11 @@ class TranslatorChinesetraditional : public Translator { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - result+="這些結構/聯合型態是屬於:"; + result+="這些結構/聯合型態所屬:"; } else { - result+="這些類別是屬於:"; + result+="這些類別所屬:"; } } return result; @@ -647,7 +647,7 @@ class TranslatorChinesetraditional : public Translator case ClassDef::Exception: result+=" 例外"; break; } if (isTemplate) result+=" 樣版"; - result+=" 參考"; + result+=" 參考文件"; return result; } @@ -1192,7 +1192,7 @@ class TranslatorChinesetraditional : public Translator /*! Text shown before a multi-line define */ virtual QCString trDefineValue() { - return "值:"; + return "巨集內容:"; } ////////////////////////////////////////////////////////////////////////// diff --git a/src/util.cpp b/src/util.cpp index d55b53d..1b7b78c 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1301,10 +1301,17 @@ void stripIrrelevantConstVolatile(QCString &s) if (i!=-1) { // no & or * after the const - if (s.find('*',i+6)==-1 && s.find('&',i+6)==-1) + int i1=s.find('*',i+6); + int i2=s.find('&',i+6); + if (i1==-1 && i2==-1) { s=s.left(i)+s.right(s.length()-i-6); } + else if ((i1!=-1 && i<i1) || (i2!=-1 && i<i2)) // const before * or & + { + // move const to front + s=(QCString)"const "+s.left(i)+s.right(s.length()-i-6); + } } // strip occurrences of volatile @@ -1312,10 +1319,17 @@ void stripIrrelevantConstVolatile(QCString &s) if (i!=-1) { // no & or * after the volatile - if (s.find('*',i+9)==-1 && s.find('&',i+9)==-1) + int i1=s.find('*',i+9); + int i2=s.find('&',i+9); + if (i1==-1 && i2==-1) { s=s.left(i)+s.right(s.length()-i-9); } + else if ((i1!=-1 && i<i1) || (i2!=-1 && i<i2)) // volatile before * or & + { + // move volatile to front + s=(QCString)"volatile "+s.left(i)+s.right(s.length()-i-9); + } } } @@ -1442,6 +1456,9 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, } } + //printf("2. srcA=%s:%s dstA=%s:%s\n",srcAType.data(),srcA->name.data(), + // dstAType.data(),dstA->name.data()); + if (!srcA->name.isEmpty() && !dstA->type.isEmpty() && (srcAType+" "+srcA->name)==dstAType) { @@ -1455,8 +1472,6 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, return TRUE; } - //printf("2. srcA=%s:%s dstA=%s:%s\n",srcAType.data(),srcA->name.data(), - // dstAType.data(),dstA->name.data()); uint srcPos=0,dstPos=0; bool equal=TRUE; @@ -1567,242 +1582,6 @@ static bool matchArgument(const Argument *srcA,const Argument *dstA, return TRUE; } -#if 0 -static void mergeArgument(Argument *srcA,Argument *dstA, - const QCString &className, - const QCString &namespaceName, - NamespaceList *usingNamespaces, - ClassList *usingClasses) -{ - //printf("merge argument start %s:%s <-> %s:%s\n", - // srcA->type.data(),srcA->name.data(), - // dstA->type.data(),dstA->name.data()); - - if ((srcA->type=="const" || srcA->type=="volatile") && !srcA->name.isEmpty()) - { - srcA->type+=" "; - srcA->type+=srcA->name; - srcA->name.resize(0); - } - if ((dstA->type=="const" || dstA->type=="volatile") && !dstA->name.isEmpty()) - { - dstA->type+=" "; - dstA->type+=dstA->name; - dstA->name.resize(0); - } - if (srcA->name=="const" || srcA->name=="volatile") - { - srcA->type+=" "; - srcA->type+=srcA->name; - srcA->type=removeRedundantWhiteSpace(srcA->type); - srcA->name.resize(0); - } - if (dstA->name=="const" || dstA->name=="volatile") - { - dstA->type+=" "; - dstA->type+=dstA->name; - dstA->type=removeRedundantWhiteSpace(dstA->type); - dstA->name.resize(0); - } - - QCString srcAType=trimTemplateSpecifiers(namespaceName,className,srcA->type); - QCString dstAType=trimTemplateSpecifiers(namespaceName,className,dstA->type); - if (srcAType.left(6)=="class ") srcAType=srcAType.right(srcAType.length()-6); - if (dstAType.left(6)=="class ") dstAType=dstAType.right(dstAType.length()-6); - - stripIrrelevantConstVolatile(srcAType); - stripIrrelevantConstVolatile(dstAType); - - if (srcAType!=dstAType) // check if the argument only differs on name - { - //printf("scope=`%s': `%s' <=> `%s'\n",className.data(),srcAType.data(),dstAType.data()); - - // remove a namespace scope that is only in one type - // (assuming a using statement was used) - trimNamespaceScope(srcAType,dstAType,namespaceName); - - - //QCString srcScope; - //QCString dstScope; - - // strip redundant scope specifiers - if (!className.isEmpty()) - { - srcAType=trimScope(className,srcAType); - dstAType=trimScope(className,dstAType); - //printf("trimScope: `%s' <=> `%s'\n",srcAType.data(),dstAType.data()); - ClassDef *cd; - if (!namespaceName.isEmpty()) - cd=getClass(namespaceName+"::"+className); - else - cd=getClass(className); - if (cd && cd->baseClasses()->count()>0) - { - trimBaseClassScope(cd->baseClasses(),srcAType); - trimBaseClassScope(cd->baseClasses(),dstAType); - } - //printf("trimBaseClassScope: `%s' <=> `%s'\n",srcAType.data(),dstAType.data()); - } - if (!namespaceName.isEmpty()) - { - srcAType=trimScope(namespaceName,srcAType); - dstAType=trimScope(namespaceName,dstAType); - } - if (usingNamespaces && usingNamespaces->count()>0) - { - NamespaceListIterator nli(*usingNamespaces); - NamespaceDef *nd; - for (;(nd=nli.current());++nli) - { - srcAType=trimScope(nd->name(),srcAType); - dstAType=trimScope(nd->name(),dstAType); - } - } - if (usingClasses && usingClasses->count()>0) - { - ClassListIterator cli(*usingClasses); - ClassDef *cd; - for (;(cd=cli.current());++cli) - { - srcAType=trimScope(cd->name(),srcAType); - dstAType=trimScope(cd->name(),dstAType); - } - } - - if (!srcA->name.isEmpty() && !dstA->type.isEmpty() && - (srcAType+" "+srcA->name)==dstAType) - { - srcA->type=srcAType+" "+srcA->name; - srcA->name.resize(0); - goto done; - } - else if (!dstA->name.isEmpty() && !srcA->type.isEmpty() && - (dstAType+" "+dstA->name)==srcAType) - { - dstA->type=dstAType+" "+dstA->name; - dstA->name.resize(0); - goto done; - } - //printf("srcA=%s::%s dstA=%s::%s\n",srcAType.data(),srcA->name.data(), - // dstAType.data(),dstA->name.data()); - - uint srcPos=0,dstPos=0; - bool equal=TRUE; - while (srcPos<srcAType.length() && dstPos<dstAType.length() && equal) - { - equal=srcAType.at(srcPos)==dstAType.at(dstPos); - if (equal) srcPos++,dstPos++; - } - if (srcPos<srcAType.length() && dstPos<dstAType.length()) - { - // if nothing matches or the match ends in the middle or at the - // end of a string then there is no match - int srcStart=srcPos; - int dstStart=dstPos; - if (isId(srcAType.at(srcPos)) && isId(dstAType.at(dstPos))) - { - // find the start of the name - while (srcStart>=0 && isId(srcAType.at(srcStart))) srcStart--; - while (dstStart>=0 && isId(dstAType.at(dstStart))) dstStart--; - if (srcStart>0) // move the name from the type to the name field - { - srcA->name=srcAType.right(srcAType.length()-srcStart-1); - srcA->type=srcAType.left(srcStart+1).stripWhiteSpace(); - } - if (dstStart>0) // move the name from the type to the name field - { - dstA->name=dstAType.right(dstAType.length()-dstStart-1); - dstA->type=dstAType.left(dstStart+1).stripWhiteSpace(); - } - } - else - { - dstA->name=dstAType.right(dstAType.length()-dstStart); - dstA->type=dstAType.left(dstStart).stripWhiteSpace(); - srcA->name=srcAType.right(dstAType.length()-srcStart); - srcA->type=srcAType.left(srcStart).stripWhiteSpace(); - } - } - else if (dstPos<dstAType.length()) - { - if (!isspace(dstAType.at(dstPos))) // maybe the names differ - { - int startPos=dstPos; - while (startPos>=0 && isId(dstAType.at(startPos))) startPos--; - if (startPos>0) - { - dstA->name=dstAType.right(dstAType.length()-startPos-1); - dstA->type=dstAType.left(startPos+1).stripWhiteSpace(); - } - } - else // maybe dst has a name while src has not - { - dstPos++; - int startPos=dstPos; - dstA->name=dstAType.right(dstAType.length()-startPos); - dstA->type=dstAType.left(startPos).stripWhiteSpace(); - } - } - else if (srcPos<srcAType.length()) - { - if (!isspace(srcAType.at(srcPos))) // maybe the names differ - { - int startPos=srcPos; - while (startPos>=0 && isId(srcAType.at(startPos))) startPos--; - if (startPos>0) - { - srcA->name=srcAType.right(srcAType.length()-startPos-1); - srcA->type=srcAType.left(startPos+1).stripWhiteSpace(); - } - } - else // maybe src has a name while dst has not - { - srcPos++; - int startPos=srcPos; - srcA->name=srcAType.right(srcAType.length()-startPos); - srcA->type=srcAType.left(startPos).stripWhiteSpace(); - } - } - goto done; - } - //printf("match exactly\n"); - if (srcA->name.isEmpty() && dstA->name.isEmpty()) - // arguments match exactly but no name -> - // see if we can find the name - { - int i=srcAType.length()-1; - while (i>=0 && isId(srcAType.at(i))) i--; - if (i>0 && i<(int)srcAType.length()-1 && srcAType.at(i)!=':') - // there is (probably) a name - { - QCString srcAName=srcAType.right(srcAType.length()-i-1); - QCString dstAName=dstAType.right(dstAType.length()-i-1); - if (srcAName!="const" && srcAName!="volatile" && - dstAName!="const" && dstAName!="volatile") - { - srcA->name=srcAName; - srcA->type=srcAType.left(i+1).stripWhiteSpace(); - dstA->name=dstAName; - dstA->type=dstAType.left(i+1).stripWhiteSpace(); - } - } - } - else if (!dstA->name.isEmpty()) - { - srcA->name = dstA->name.copy(); - } - else if (!srcA->name.isEmpty()) - { - dstA->name = srcA->name.copy(); - } -done: - //printf("merge argument result %s:%s <-> %s:%s\n", - // srcA->type.data(),srcA->name.data(), - // dstA->type.data(),dstA->name.data()); - return; -} -#endif - /*! * Matches the arguments list srcAl with the argument list dstAl @@ -1902,15 +1681,6 @@ bool matchArguments(ArgumentList *srcAl,ArgumentList *dstAl, return FALSE; } } - // merge/correct argument type/names - for (srcAli.toFirst(),dstAli.toFirst(); - (srcA=srcAli.current(),dstA=dstAli.current()); - ++srcAli,++dstAli - ) - { - //mergeArgument(srcA,dstA,className,namespaceName, - // usingNamespaces,usingClasses); - } MATCH return TRUE; // all arguments match } @@ -1962,6 +1732,28 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl) srcA->name = dstA->name.copy(); } } + else + { + //printf("merging %s:%s <-> %s:%s\n",srcA->type.data(),srcA->name.data(),dstA->type.data(),dstA->name.data()); + if (srcA->type+" "+srcA->name==dstA->type) // "unsigned long:int" <-> "unsigned long int:bla" + { + srcA->type+=" "+srcA->name; + srcA->name=dstA->name; + } + else if (dstA->type+" "+dstA->name==srcA->type) // "unsigned long int bla" <-> "unsigned long int" + { + dstA->type+=" "+dstA->name; + dstA->name=srcA->name; + } + else if (srcA->name.isEmpty() && !dstA->name.isEmpty()) + { + srcA->name = dstA->name; + } + else if (dstA->name.isEmpty() && !srcA->name.isEmpty()) + { + dstA->name = srcA->name; + } + } int i1=srcA->type.find("::"), i2=dstA->type.find("::"), j1=srcA->type.length()-i1-2, @@ -2248,7 +2040,7 @@ bool getDefs(const QCString &scName,const QCString &memberName, { QList<MemberDef> members; - //printf(" Function with global scope `%s' args=`%s'\n",namespaceName.data(),args); + //printf(" Function with global scope `%s' name `%s' args=`%s'\n",namespaceName.data(),memberName.data(),args); MemberListIterator mli(*mn); for (mli.toFirst();(md=mli.current());++mli) { @@ -2280,7 +2072,7 @@ bool getDefs(const QCString &scName,const QCString &memberName, } } } - if (!strcmp(args,"()")) + if (members.count()!=1 && !strcmp(args,"()")) { // no exact match found, but if args="()" an arbitrary // member will do @@ -2288,17 +2080,14 @@ bool getDefs(const QCString &scName,const QCString &memberName, while (md) { //printf("Found member `%s'\n",md->name().data()); - if (1 /* md->isLinkable() */) + //printf("member is linkable md->name()=`%s'\n",md->name().data()); + fd=md->getFileDef(); + gd=md->getGroupDef(); + if ( + (gd && gd->isLinkable()) || (fd && fd->isLinkable()) + ) { - //printf("member is linkable md->name()=`%s'\n",md->name().data()); - fd=md->getFileDef(); - gd=md->getGroupDef(); - if ( - (gd && gd->isLinkable()) || (fd && fd->isLinkable()) - ) - { - members.append(md); - } + members.append(md); } md=mn->prev(); } @@ -2309,9 +2098,15 @@ bool getDefs(const QCString &scName,const QCString &memberName, } else if (members.count()>1) { + //printf("Found more than one matching member!\n"); // use some C scoping rules to determine the correct link // 1. member in current file // 2. non-static member in different file + if (currentFile==0) + { + bool ambig; + currentFile = findFileDef(Doxygen::inputNameDict,namespaceName,ambig); + } MemberDef *bmd = 0; for (md=members.first(); md; md=members.next()) { @@ -2776,7 +2571,11 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig) { if (fn->count()==1) { - return fn->getFirst(); + FileDef *fd = fn->getFirst(); + if (path.isEmpty() || fd->getPath().right(path.length())==path) + { + return fd; + } } else // file name alone is ambigious { diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 691ae13..435c7dc 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -76,6 +76,7 @@ QCString sectionTypeToString(BaseOutputDocInterface::SectionTypes t) return "illegal"; } + inline void writeXMLString(QTextStream &t,const char *s) { t << convertToXML(s); @@ -707,14 +708,14 @@ class XMLGenerator : public OutputDocInterface { XML_DB(("(writeAnchor)\n")); startParMode(); - m_t << "<anchor id=\"" << id << "_" << name << "\"/>"; + m_t << "<anchor id=\"" << id << "_1" << name << "\"/>"; } void writeSectionRef(const char *,const char *id, const char *name,const char *text) { XML_DB(("(writeSectionRef)\n")); startParMode(); - m_t << "<link linkend=\"" << id << "_" << name << "\">"; + m_t << "<link linkend=\"" << id << "_1" << name << "\">"; docify(text); m_t << "</link>"; } @@ -773,7 +774,7 @@ class XMLGenerator : public OutputDocInterface void endTextLink() { XML_DB(("(endTextLink)\n")); - m_t << "<ulink>"; + m_t << "</ulink>"; } void startPageRef() { @@ -938,6 +939,56 @@ class XMLGenerator : public OutputDocInterface friend void writeXMLCodeBlock(QTextStream &t,FileDef *fd); }; +static void writeTemplateArgumentList(ArgumentList *al,QTextStream &t,const char *name,int indent) +{ + QCString indentStr; + indentStr.fill(' ',indent); + if (al) + { + t << indentStr << "<templateparamlist>" << endl; + ArgumentListIterator ali(*al); + Argument *a; + for (ali.toFirst();(a=ali.current());++ali) + { + t << indentStr << " <param>" << endl; + if (!a->type.isEmpty()) + { + t << indentStr << " <type>"; + linkifyText(TextGeneratorXMLImpl(t),name,0,a->type); + t << "</type>" << endl; + } + if (!a->name.isEmpty()) + { + t << indentStr << " <declname>" << a->name << "</declname>" << endl; + t << indentStr << " <defname>" << a->name << "</defname>" << endl; + } + if (!a->defval.isEmpty()) + { + t << indentStr << " <defval>"; + linkifyText(TextGeneratorXMLImpl(t),name,0,a->defval); + t << "</defval>" << endl; + } + t << indentStr << " </param>" << endl; + } + t << indentStr << "</templateparamlist>" << endl; + } +} + +static void writeMemberTemplateLists(MemberDef *md,QTextStream &t) +{ + ClassDef *cd = md->getClassDef(); + const char *cname = cd ? cd->name().data() : 0; + if (md->templateArguments()) // function template prefix + { + writeTemplateArgumentList(md->templateArguments(),t,cname,8); + } +} + +static void writeTemplateList(ClassDef *cd,QTextStream &t) +{ + writeTemplateArgumentList(cd->templateArguments(),t,cd->name(),4); +} + static void writeXMLDocBlock(QTextStream &t, const QCString &fileName, int lineNr, @@ -1021,7 +1072,7 @@ static void generateXMLForMember(MemberDef *md,QTextStream &ti,QTextStream &t,De // + source references // + source referenced by // - body code - // - template arguments + // + template arguments // (templateArguments(), definitionTemplateParameterLists()) if (md->memberType()==MemberDef::EnumValue) return; @@ -1091,6 +1142,10 @@ static void generateXMLForMember(MemberDef *md,QTextStream &ti,QTextStream &t,De md->memberType()!=MemberDef::Enumeration ) { + if (md->memberType()!=MemberDef::Typedef) + { + writeMemberTemplateLists(md,t); + } QCString typeStr = md->typeString(); //replaceAnonymousScopes(md->typeString()); t << " <type>"; linkifyText(TextGeneratorXMLImpl(t),scopeName,md->name(),typeStr); @@ -1278,44 +1333,6 @@ static void generateXMLSection(Definition *d,QTextStream &ti,QTextStream &t, t << " </sectiondef>" << endl; } -static void writeTemplateLists(Definition *d,QTextStream &t) -{ - if (d->definitionType()==Definition::TypeClass) - { - if (d->getOuterScope()) writeTemplateLists(d->getOuterScope(),t); - ClassDef *cd = (ClassDef *)d; - ArgumentList *al = cd->templateArguments(); - if (al) - { - t << " <templateparamlist>" << endl; - ArgumentListIterator ali(*al); - Argument *a; - for (ali.toFirst();(a=ali.current());++ali) - { - t << " <param>" << endl; - if (!a->type.isEmpty()) - { - t << " <type>"; - linkifyText(TextGeneratorXMLImpl(t),d->name(),0,a->type); - t << "</type>" << endl; - } - if (!a->name.isEmpty()) - { - t << " <name>" << a->name << "</name>" << endl; - } - if (!a->defval.isEmpty()) - { - t << " <defval>"; - linkifyText(TextGeneratorXMLImpl(t),d->name(),0,a->defval); - t << "</defval>" << endl; - } - t << " </param>" << endl; - } - t << " </templateparamlist>" << endl; - } - } -} - static void writeListOfAllMembers(ClassDef *cd,QTextStream &t) { t << " <listofallmembers>" << endl; @@ -1333,7 +1350,7 @@ static void writeListOfAllMembers(ClassDef *cd,QTextStream &t) if (d==0) d = cd; Protection prot = mi->prot; Specifier virt=md->virtualness(); - t << " <member refid=\"" << d->getOutputFileBase() << "_" << + t << " <member refid=\"" << d->getOutputFileBase() << "_1" << md->anchor() << "\" prot=\""; switch (prot) { @@ -1351,7 +1368,7 @@ static void writeListOfAllMembers(ClassDef *cd,QTextStream &t) t << "\""; if (!mi->ambiguityResolutionScope.isEmpty()) { - t << " ambiguityscope=\"" << mi->ambiguityResolutionScope << "\""; + t << " ambiguityscope=\"" << convertToXML(mi->ambiguityResolutionScope) << "\""; } t << "><scope>" << convertToXML(cd->name()) << "</scope><name>" << convertToXML(md->name()) << "</name></member>" << endl; @@ -1425,7 +1442,8 @@ static void generateXMLForClass(ClassDef *cd,QTextStream &ti) case Virtual: t << "virtual"; break; case Pure: t <<"pure-virtual"; break; } - t << "\"/>" << endl; + t << "\">" << convertToXML(bcd->classDef->displayName()) + << "</basecompoundref>" << endl; } } if (cd->subClasses()->count()>0) @@ -1450,7 +1468,8 @@ static void generateXMLForClass(ClassDef *cd,QTextStream &ti) case Virtual: t << "virtual"; break; case Pure: t << "pure-virtual"; break; } - t << "\"/>" << endl; + t << "\">" << convertToXML(bcd->classDef->displayName()) + << "</basecompoundref>" << endl; } } @@ -1465,7 +1484,7 @@ static void generateXMLForClass(ClassDef *cd,QTextStream &ti) << "\">" << convertToXML(cd->name()) << "</innerclass>" << endl; } } - writeTemplateLists(cd,t); + writeTemplateList(cd,t); writeListOfAllMembers(cd,t); MemberGroupSDict::Iterator mgli(*cd->memberGroupSDict); MemberGroup *mg; @@ -1834,6 +1853,18 @@ static void generateXMLForGroup(GroupDef *gd,QTextStream &ti) } } + GroupList *gl = gd->getSubGroups(); + if (gl) + { + GroupListIterator gli(*gl); + GroupDef *sgd; + for (gli.toFirst();(sgd=gli.current());++gli) + { + t << " <innergroup refid=\"" << gd->getOutputFileBase() + << "\"/>" << convertToXML(sgd->groupTitle()) << "</innergroup>" << endl; + } + } + MemberGroupSDict::Iterator mgli(*gd->memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) |