diff options
44 files changed, 363 insertions, 117 deletions
@@ -141,7 +141,7 @@ MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- -GENERATE_XML = NO +GENERATE_XML = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- @@ -1,7 +1,7 @@ -DOXYGEN Version 1.3.2 +DOXYGEN Version 1.3.2-20030708 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (25 June 2003) +Dimitri van Heesch (08 July 2003) @@ -1,4 +1,4 @@ -DOXYGEN Version 1.3.2 +DOXYGEN Version 1.3.2_20030708 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) (25 June 2003) +Dimitri van Heesch (dimitri@stack.nl) (08 July 2003) @@ -1 +1 @@ -1.3.2 +1.3.2-20030708 diff --git a/doc/config.doc b/doc/config.doc index 536d37e..9597871 100644 --- a/doc/config.doc +++ b/doc/config.doc @@ -191,6 +191,7 @@ followed by the descriptions of the tags grouped by category. \refitem cfg_source_browser SOURCE_BROWSER \refitem cfg_strip_code_comments STRIP_CODE_COMMENTS \refitem cfg_strip_from_path STRIP_FROM_PATH +\refitem cfg_subgrouping SUBGROUPING \refitem cfg_tab_size TAB_SIZE \refitem cfg_tagfiles TAGFILES \refitem cfg_template_relations TEMPLATE_RELATIONS @@ -567,6 +568,15 @@ function's detailed documentation block. at the bottom of the documentation of classes and structs. If set to \c YES the list will mention the files that were used to generate the documentation. +\anchor cfg_subgrouping +<dt>\c SUBGROUPING <dd> + \addindex SUBGROUPING + Set the \c SUBGROUPING tag to \c YES (the default) to allow class member groups of + the same type (for instance a group of public functions) to be put as a + subgroup of that type (e.g. under the Public Functions section). Set it to + \c NO to prevent subgrouping. Alternatively, this can be done per class using + the \ref cmdnosubgrouping "\\nosubgrouping" command. + </dl> \section messages_input Options related to warning and progress messages diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec index 4e87265..a8c742d 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.3.2 +Version: 1.3.2_20030708 Release: 1 Epoch: 1 Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz diff --git a/src/classdef.cpp b/src/classdef.cpp index 0bbaf84..72ec333 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -82,7 +82,7 @@ ClassDef::ClassDef( memberGroupSDict = new MemberGroupSDict; memberGroupSDict->setAutoDelete(TRUE); m_innerClasses = new ClassSDict(17); - m_subGrouping=TRUE; + m_subGrouping=Config_getBool("SUBGROUPING"); m_templateInstances = 0; m_templateMaster =0; m_templBaseClassNames = 0; @@ -1010,7 +1010,7 @@ static int yyread(char *buf,int max_size) B [ \t] BN [ \t\n\r] ID [a-z_A-Z][a-z_A-Z0-9]* -SCOPENAME (({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) +SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) TEMPLIST "<"[^\"\}\{\(\)\/\n\>]*">" SCOPETNAME ((({ID}{TEMPLIST}?){BN}*"::"{BN}*)*)((~{BN}*)?{ID}) SCOPEPREFIX ({ID}{TEMPLIST}?{BN}*"::"{BN}*)+ @@ -1178,6 +1178,7 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" <ClassName,ClassVar>[*&]+ { addType(); g_code->codify(yytext); + BEGIN( Body ); // variable of type struct * } <ClassName>{ID}("::"{ID})* { g_curClassName=yytext; diff --git a/src/compound.xsd b/src/compound.xsd new file mode 100644 index 0000000..c528422 --- /dev/null +++ b/src/compound.xsd @@ -0,0 +1,11 @@ +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="doxygen" type="DoxygenType"/> + + <xsd:complexType name="DoxygenType"> + <xsd:sequence> + </xsd:sequence> + <xsd:attribute name="version" type="xsd:string" use="required"/> + </xsd:complexType> + +</xsd:schema> + diff --git a/src/compound_xsd.h b/src/compound_xsd.h new file mode 100644 index 0000000..74a35b9 --- /dev/null +++ b/src/compound_xsd.h @@ -0,0 +1,11 @@ +"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n" +" <xsd:element name=\"doxygen\" type=\"DoxygenType\"/>\n" +"\n" +" <xsd:complexType name=\"DoxygenType\">\n" +" <xsd:sequence>\n" +" </xsd:sequence>\n" +" <xsd:attribute name=\"version\" type=\"xsd:string\" use=\"required\"/>\n" +" </xsd:complexType>\n" +"\n" +"</xsd:schema>\n" +"\n" diff --git a/src/config.l b/src/config.l index 4c2a523..87b98a0 100644 --- a/src/config.l +++ b/src/config.l @@ -1036,10 +1036,8 @@ void Config::check() QStrList &inputSources=Config_getList("INPUT"); if (inputSources.count()==0) { - //config_err("Error: tag INPUT: no input files specified after the INPUT tag.\n"); - //exit(1); + // use current dir as the default inputSources.append(QDir::currentDirPath()); - //config_warn("Warning: no files after the INPUT tag, defaulting to the current dir\n"); } else { @@ -1671,6 +1669,15 @@ void Config::create() "list will mention the files that were used to generate the documentation. \n", TRUE ); + cb = addBool( + "SUBGROUPING", + "Set the SUBGROUPING tag to YES (the default) to allow class member groups of \n" + "the same type (for instance a group of public functions) to be put as a \n" + "subgroup of that type (e.g. under the Public Functions section). Set it to \n" + "NO to prevent subgrouping. Alternatively, this can be done per class using \n" + "the \\nosubgrouping command. \n", + TRUE + ); //----------------------------------------------------------------------------------------------- addInfo( "Messages","configuration options related to warning and progress messages"); //----------------------------------------------------------------------------------------------- diff --git a/src/constexp.l b/src/constexp.l index f9df891..512f612 100644 --- a/src/constexp.l +++ b/src/constexp.l @@ -22,7 +22,6 @@ #include "cppvalue.h" #include "ce_parse.h" // generated header file -#define YY_NO_UNPUT #define YY_NEVER_INTERACTIVE 1 QCString g_strToken; diff --git a/src/debug.cpp b/src/debug.cpp index 321452a..60d86c4 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -55,6 +55,8 @@ static int labelToEnumValue(const char *l) return Debug::Validate; else if (label=="printtree") return Debug::PrintTree; + else if (label=="time") + return Debug::Time; else return 0; } diff --git a/src/debug.h b/src/debug.h index be68039..123ebf2 100644 --- a/src/debug.h +++ b/src/debug.h @@ -30,7 +30,8 @@ class Debug Classes = 0x00000010, CommentCnv = 0x00000020, Validate = 0x00000040, - PrintTree = 0x00000080 + PrintTree = 0x00000080, + Time = 0x00000100 }; static void print(DebugMask mask,int prio,const char *fmt,...); static void setFlag(const char *label); diff --git a/src/definition.cpp b/src/definition.cpp index 5692f88..1482ab7 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -27,6 +27,7 @@ #include "code.h" #include "util.h" #include "groupdef.h" +#include "section.h" Definition::Definition(const char *df,int dl, const char *name,const char *b,const char *d) @@ -74,33 +75,31 @@ Definition::~Definition() delete m_xrefListItems; } -void Definition::addSectionsToDefinition(QList<QCString> *anchorList) +void Definition::addSectionsToDefinition(QList<SectionInfo> *anchorList) { if (!anchorList) return; //printf("%s: addSectionsToDefinition(%d)\n",name().data(),anchorList->count()); - QCString *s=anchorList->first(); - while (s) + SectionInfo *si=anchorList->first(); + while (si) { - SectionInfo *si=0; - if (!s->isEmpty() && (si=Doxygen::sectionDict[*s])) + //printf("Add section `%s' to definition `%s'\n", + // si->label.data(),name().data()); + SectionInfo *gsi=Doxygen::sectionDict.find(si->label); + if (gsi==0) { - //printf("Add section `%s' to definition `%s'\n", - // si->label.data(),n.data()); - if (m_sectionDict==0) - { - m_sectionDict = new SectionDict(17); - } - if (m_sectionDict->find(*s)==0) - { - m_sectionDict->insert(*s,si); - } - si->definition = this; + gsi = new SectionInfo(*si); + Doxygen::sectionDict.insert(si->label,gsi); } - else + if (m_sectionDict==0) + { + m_sectionDict = new SectionDict(17); + } + if (m_sectionDict->find(gsi->label)==0) { - //printf("Section `%s' not found!\n",s->data()); + m_sectionDict->insert(gsi->label,gsi); + gsi->definition = this; } - s=anchorList->next(); + si=anchorList->next(); } } @@ -108,7 +107,7 @@ void Definition::writeDocAnchorsToTagFile() { if (!Config_getString("GENERATE_TAGFILE").isEmpty() && m_sectionDict) { - //printf("%s: writeDocAnchors(%d)\n",name().data(),m_sectionDict->count()); + //printf("%s: writeDocAnchorsToTagFile(%d)\n",name().data(),m_sectionDict->count()); QDictIterator<SectionInfo> sdi(*m_sectionDict); SectionInfo *si; for (;(si=sdi.current());++sdi) @@ -556,6 +555,7 @@ void Definition::addSourceReferences(MemberDef *md) } if (m_sourceRefsDict->find(name)==0) { + //printf("Adding reference %s->%s\n",md->name().data(),name.data()); m_sourceRefsDict->inSort(name,md); } } diff --git a/src/definition.h b/src/definition.h index 4c6cff6..02518b9 100644 --- a/src/definition.h +++ b/src/definition.h @@ -31,6 +31,7 @@ class MemberDef; class GroupDef; class GroupList; struct ListItemInfo; +class SectionInfo; /*! The common base class of all entity definitions found in the sources. */ class Definition @@ -89,7 +90,7 @@ class Definition /*! Add the list of anchors that mark the sections that are found in the * documentation. */ - void addSectionsToDefinition(QList<QCString> *anchorList); + void addSectionsToDefinition(QList<SectionInfo> *anchorList); void writeDocAnchorsToTagFile(); // source references diff --git a/src/docparser.cpp b/src/docparser.cpp index abf930a..56f1f55 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -1144,8 +1144,8 @@ static void readTextFileByName(const QString &file,QString &text) } else { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: included file %s is not found" - "Check you EXAMPLE_PATH",file.data()); + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: included file %s is not found. " + "Check your EXAMPLE_PATH",file.data()); } } @@ -1167,10 +1167,12 @@ DocAnchor::DocAnchor(DocNode *parent,const QString &id,bool newAnchor) SectionInfo *sec = Doxygen::sectionDict[id]; if (sec) { + //printf("Found anchor %s\n",id.data()); m_file = sec->fileName; m_anchor = sec->label; if (g_sectionDict && g_sectionDict->find(id)==0) { + //printf("Inserting in dictionary!\n"); g_sectionDict->insert(id,sec); } } @@ -4672,8 +4674,7 @@ void DocRoot::parse() DocNode *validatingParseDoc(const char *fileName,int startLine, const char *context,MemberDef *md, const char *input,bool isExample, - const char *exampleName, - SectionDict *sections) + const char *exampleName) { //printf("========== validating %s at line %d\n",fileName,startLine); @@ -4696,7 +4697,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, g_hasParamCommand = FALSE; g_paramsFound.setAutoDelete(FALSE); g_paramsFound.clear(); - g_sectionDict = sections; + g_sectionDict = 0; //sections; doctokenizerYYlineno=startLine; doctokenizerYYinit(input,g_fileName); diff --git a/src/docparser.h b/src/docparser.h index 895043d..383f23c 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -30,7 +30,6 @@ class DocNode; class MemberDef; -class PageInfo; class Definition; class MemberGroup; class SectionDict; @@ -48,15 +47,13 @@ class SectionDict; * @param input String representation of the documentation block. * @param isExample TRUE if the documentation belongs to an example. * @param exampleName Base name of the example file (0 if isExample is FALSE). - * @param sections Sections (and anchors) found in the documentation are - * collected here (if not 0). * @returns Root node of the abstract syntax tree. Ownership of the * pointer is handed over to the caller. */ DocNode *validatingParseDoc(const char *fileName,int startLine, const char *context, MemberDef *md, const char *input,bool isExample, - const char *exampleName=0,SectionDict *sections=0); + const char *exampleName=0); /*! Main entry point for parsing simple text fragments. These * fragments are limited to words, whitespace and symbols. diff --git a/src/doctokenizer.l b/src/doctokenizer.l index d558631..2a17819 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -206,7 +206,7 @@ static void parseHtmlAttribs(const char *att) static void processSection() { - //printf("found section/anchor with name `%s'\n",g_secLabel.data()); + //printf("%s: found section/anchor with name `%s'\n",g_fileName.data(),g_secLabel.data()); QCString file; if (g_memberGroup) { @@ -221,15 +221,11 @@ static void processSection() warn(g_fileName,yylineno,"Found section/anchor %s without context\n",g_secLabel.data()); } SectionInfo *si=0; - if ((si=Doxygen::sectionDict.find(g_secLabel))==0) + if ((si=Doxygen::sectionDict.find(g_secLabel))) { - si = new SectionInfo(file,g_secLabel,g_secTitle,g_secType); - Doxygen::sectionDict.insert(g_secLabel,si); - } - else if (!si->generated) - { - warn(g_fileName,yylineno,"Duplicate section/anchor label %s found!\n", - g_secLabel.data()); + si->fileName = file; + //si = new SectionInfo(file,g_secLabel,g_secTitle,g_secType); + //Doxygen::sectionDict.insert(g_secLabel,si); } } diff --git a/src/dot.cpp b/src/dot.cpp index 9b3161d..862d14c 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -426,7 +426,9 @@ static void writeBoxMemberList(QTextStream &t,char prot,MemberList &ml,ClassDef { if (mma->getClassDef() == scope) { - t << prot << " " << convertLabel(mma->name()) << "\\l"; + t << prot << " " << convertLabel(mma->name()); + if (mma->isFunction()) t << "()"; + t << "\\l"; } } } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index d8630a7..fe2d958 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -111,6 +111,8 @@ NamespaceDef *Doxygen::globalScope = new NamespaceDef("<globalScope>",1,"<globa QDict<RefList> *Doxygen::xrefLists = new QDict<RefList>; // dictionary of cross-referenced item lists bool Doxygen::parseSourcesNeeded = FALSE; +double Doxygen::sysElapsedTime = 0.0; +QTime Doxygen::runningTime; static StringList inputFiles; static StringDict excludeNameDict(1009); // sections @@ -6072,8 +6074,6 @@ static void findMainPage(Entry *root) indexName, root->doc,title); //setFileNameForSections(root->anchors,"index",Doxygen::mainPage); Doxygen::mainPage->setFileName(indexName); - Doxygen::mainPage->addSectionsToDefinition(root->anchors); - //Doxygen::mainPage->addSections(root->anchors); // a page name is a label as well! SectionInfo *si=new SectionInfo( @@ -6082,6 +6082,7 @@ static void findMainPage(Entry *root) Doxygen::mainPage->title(), SectionInfo::Section); Doxygen::sectionDict.insert(indexName,si); + Doxygen::mainPage->addSectionsToDefinition(root->anchors); } else { @@ -7109,6 +7110,7 @@ void initDoxygen() setlocale(LC_NUMERIC,"C"); #endif + Doxygen::runningTime.start(); initPreprocessor(); Doxygen::sectionDict.setAutoDelete(TRUE); @@ -8194,5 +8196,12 @@ void generateOutput() QDir::setCurrent(oldDir); } cleanUpDoxygen(); + if (Debug::isFlagSet(Debug::Time)) + { + printf("Total elapsed time: %.3f seconds\n(of which %.3f seconds waiting for external tools to finish)\n", + ((double)Doxygen::runningTime.elapsed())/1000.0, + Doxygen::sysElapsedTime + ); + } } diff --git a/src/doxygen.h b/src/doxygen.h index 5b85dc7..a24a4b6 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -21,6 +21,7 @@ #include "qtbc.h" #include <qtextstream.h> +#include <qdatetime.h> #include "groupdef.h" #include "filedef.h" #include "classdef.h" @@ -94,6 +95,8 @@ class Doxygen static QDict<RefList> *xrefLists; // array of xref lists: todo, test, bug, deprecated ... static QCString htmlFileExtension; static bool parseSourcesNeeded; + static double sysElapsedTime; + static QTime runningTime; }; void initDoxygen(); diff --git a/src/entry.cpp b/src/entry.cpp index ef3c92f..276e433 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -17,6 +17,7 @@ #include "entry.h" #include "util.h" +#include "section.h" int Entry::num=0; @@ -32,8 +33,7 @@ Entry::Entry() extends->setAutoDelete(TRUE); groups = new QList<Grouping>; groups->setAutoDelete(TRUE); - anchors = new QList<QCString>; - anchors->setAutoDelete(TRUE); + anchors = new QList<SectionInfo>; argList = new ArgumentList; argList->setAutoDelete(TRUE); //printf("Entry::Entry() tArgList=0\n"); @@ -92,8 +92,7 @@ Entry::Entry(const Entry &e) extends->setAutoDelete(TRUE); groups = new QList<Grouping>; groups->setAutoDelete(TRUE); - anchors = new QList<QCString>; - anchors->setAutoDelete(TRUE); + anchors = new QList<SectionInfo>; argList = new ArgumentList; argList->setAutoDelete(TRUE); tArgLists = 0; @@ -123,11 +122,11 @@ Entry::Entry(const Entry &e) groups->append(new Grouping(*g)); } - QListIterator<QCString> sli2(*e.anchors); - QCString *s; + QListIterator<SectionInfo> sli2(*e.anchors); + SectionInfo *s; for (;(s=sli2.current());++sli2) { - anchors->append(new QCString(*s)); + anchors->append(new SectionInfo(*s)); } // deep copy argument list @@ -301,13 +300,6 @@ int Entry::getSize() size+=sizeof(g->pri); g=groups->next(); } - QCString *s=anchors->first(); - while (s) - { - size+=sizeof(QLNode); - size+=s->length()+1; - s=anchors->next(); - } Entry *e=sublist->first(); while (e) { diff --git a/src/entry.h b/src/entry.h index 7e77db2..afde3ec 100644 --- a/src/entry.h +++ b/src/entry.h @@ -21,6 +21,8 @@ #include "qtbc.h" #include <qlist.h> +class SectionInfo; + enum Protection { Public, Protected, Private, Package } ; enum Specifier { Normal, Virtual, Pure } ; enum MethodTypes { Method, Signal, Slot, DCOP, Property, Event }; @@ -281,7 +283,7 @@ class Entry QList<Entry> *sublist; //!< entries that are children of this one QList<BaseInfo> *extends; //!< list of base classes QList<Grouping> *groups; //!< list of groups this entry belongs to - QList<QCString> *anchors; //!< list of anchors defined in this entry + QList<SectionInfo> *anchors; //!< list of anchors defined in this entry QCString fileName; //!< file this entry was extracted from int startLine; //!< start line of entry in the source QList<ListItemInfo> *sli; //!< special lists (test/todo/bug/deprecated/..) this entry is in diff --git a/src/htmlhelp.h b/src/htmlhelp.h index e7f5d97..09adb6f 100644 --- a/src/htmlhelp.h +++ b/src/htmlhelp.h @@ -36,7 +36,7 @@ class HtmlHelp { /*! used in imageNumber param of HTMLHelp::addContentsItem() function to specify document icon in tree view. - Writes <param name="ImageNumber" value="xx"> in .HHC file. */ + Writes \<param name="ImageNumber" value="xx"\> in .HHC file. */ enum ImageNumber { BOOK_CLOSED=1, BOOK_OPEN, BOOK_CLOSED_NEW, BOOK_OPEN_NEW, diff --git a/src/index.cpp b/src/index.cpp index 3a1ee3e..c76b5d6 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2132,7 +2132,15 @@ int countNamespaceMembers(int filter) while (md && !found) { NamespaceDef *nd=md->getNamespaceDef(); - if (nd && nd->isLinkableInProject() && md->isLinkableInProject()) + if (nd && nd->isLinkableInProject() && md->isLinkableInProject() && + ( filter==NMHL_All || + (filter==NMHL_Functions && md->isFunction()) || + (filter==NMHL_Variables && md->isVariable()) || + (filter==NMHL_Typedefs && md->isTypedef()) || + (filter==NMHL_Enums && md->isEnumerate()) || + (filter==NMHL_EnumValues && md->isEnumValue()) + ) + ) { QCString n = mn->memberName(); if (!n.isEmpty()) g_namespaceIndexLetterUsed[filter][tolower(n.at(0))]=TRUE; @@ -3120,18 +3128,15 @@ void writeIndex(OutputList &ol) if (!Config_getString("GENERATE_TAGFILE").isEmpty()) { Doxygen::tagFile << " <compound kind=\"page\">" << endl - << " <filename>" - << convertToXML(Doxygen::mainPage->getOutputFileBase()) - << "</filename>" - << endl - << " <title>" - << convertToXML(Doxygen::mainPage->title()) - << "</title>" - << endl << " <name>" << convertToXML(Doxygen::mainPage->name()) - << "</name>" - << endl; + << "</name>" << endl + << " <title>" + << convertToXML(Doxygen::mainPage->title()) + << "</title>" << endl + << " <filename>" + << convertToXML(Doxygen::mainPage->getOutputFileBase()) + << "</filename>" << endl; Doxygen::mainPage->writeDocAnchorsToTagFile(); Doxygen::tagFile << " </compound>" << endl; diff --git a/src/index.xsd b/src/index.xsd new file mode 100644 index 0000000..5bf7a62 --- /dev/null +++ b/src/index.xsd @@ -0,0 +1,60 @@ +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:element name="doxygen" type="DoxygenType"/> + + <xsd:complexType name="DoxygenType"> + <xsd:sequence> + <xsd:element name="compound" type="CompoundType" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="version" type="xsd:string" use="required"/> + </xsd:complexType> + + <xsd:complexType name="CompoundType"> + <xsd:sequence> + <xsd:element name="name" type="xsd:string"/> + <xsd:element name="member" type="MemberType" minOccurs="0" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="refid" type="xsd:Name" use="required"/> + <xsd:attribute name="kind" type="CompoundKind" use="required"/> + </xsd:complexType> + + <xsd:complexType name="MemberType"> + <xsd:sequence> + <xsd:element name="name" type="xsd:string"/> + </xsd:sequence> + <xsd:attribute name="refid" type="xsd:Name" use="required"/> + <xsd:attribute name="kind" type="MemberKind" use="required"/> + </xsd:complexType> + + <xsd:simpleType name="CompoundKind"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="class"/> + <xsd:enumeration value="struct"/> + <xsd:enumeration value="union"/> + <xsd:enumeration value="interface"/> + <xsd:enumeration value="exception"/> + <xsd:enumeration value="file"/> + <xsd:enumeration value="namespace"/> + <xsd:enumeration value="group"/> + <xsd:enumeration value="page"/> + </xsd:restriction> + </xsd:simpleType> + + <xsd:simpleType name="MemberKind"> + <xsd:restriction base="xsd:string"> + <xsd:enumeration value="define"/> + <xsd:enumeration value="property"/> + <xsd:enumeration value="event"/> + <xsd:enumeration value="variable"/> + <xsd:enumeration value="typedef"/> + <xsd:enumeration value="enum"/> + <xsd:enumeration value="function"/> + <xsd:enumeration value="signal"/> + <xsd:enumeration value="prototype"/> + <xsd:enumeration value="friend"/> + <xsd:enumeration value="dcop"/> + <xsd:enumeration value="slot"/> + </xsd:restriction> + </xsd:simpleType> + +</xsd:schema> + diff --git a/src/index_xsd.h b/src/index_xsd.h new file mode 100644 index 0000000..e0efd95 --- /dev/null +++ b/src/index_xsd.h @@ -0,0 +1,60 @@ +"<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n" +" <xsd:element name=\"doxygen\" type=\"DoxygenType\"/>\n" +"\n" +" <xsd:complexType name=\"DoxygenType\">\n" +" <xsd:sequence>\n" +" <xsd:element name=\"compound\" type=\"CompoundType\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n" +" </xsd:sequence>\n" +" <xsd:attribute name=\"version\" type=\"xsd:string\" use=\"required\"/>\n" +" </xsd:complexType>\n" +"\n" +" <xsd:complexType name=\"CompoundType\">\n" +" <xsd:sequence>\n" +" <xsd:element name=\"name\" type=\"xsd:string\"/>\n" +" <xsd:element name=\"member\" type=\"MemberType\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n" +" </xsd:sequence>\n" +" <xsd:attribute name=\"refid\" type=\"xsd:Name\" use=\"required\"/>\n" +" <xsd:attribute name=\"kind\" type=\"CompoundKind\" use=\"required\"/>\n" +" </xsd:complexType>\n" +"\n" +" <xsd:complexType name=\"MemberType\">\n" +" <xsd:sequence>\n" +" <xsd:element name=\"name\" type=\"xsd:string\"/>\n" +" </xsd:sequence>\n" +" <xsd:attribute name=\"refid\" type=\"xsd:Name\" use=\"required\"/>\n" +" <xsd:attribute name=\"kind\" type=\"MemberKind\" use=\"required\"/>\n" +" </xsd:complexType>\n" +" \n" +" <xsd:simpleType name=\"CompoundKind\">\n" +" <xsd:restriction base=\"xsd:string\">\n" +" <xsd:enumeration value=\"class\"/>\n" +" <xsd:enumeration value=\"struct\"/>\n" +" <xsd:enumeration value=\"union\"/>\n" +" <xsd:enumeration value=\"interface\"/>\n" +" <xsd:enumeration value=\"exception\"/>\n" +" <xsd:enumeration value=\"file\"/>\n" +" <xsd:enumeration value=\"namespace\"/>\n" +" <xsd:enumeration value=\"group\"/>\n" +" <xsd:enumeration value=\"page\"/>\n" +" </xsd:restriction>\n" +" </xsd:simpleType>\n" +"\n" +" <xsd:simpleType name=\"MemberKind\">\n" +" <xsd:restriction base=\"xsd:string\">\n" +" <xsd:enumeration value=\"define\"/>\n" +" <xsd:enumeration value=\"property\"/>\n" +" <xsd:enumeration value=\"event\"/>\n" +" <xsd:enumeration value=\"variable\"/>\n" +" <xsd:enumeration value=\"typedef\"/>\n" +" <xsd:enumeration value=\"enum\"/>\n" +" <xsd:enumeration value=\"function\"/>\n" +" <xsd:enumeration value=\"signal\"/>\n" +" <xsd:enumeration value=\"prototype\"/>\n" +" <xsd:enumeration value=\"friend\"/>\n" +" <xsd:enumeration value=\"dcop\"/>\n" +" <xsd:enumeration value=\"slot\"/>\n" +" </xsd:restriction>\n" +" </xsd:simpleType>\n" +"\n" +"</xsd:schema>\n" +"\n" diff --git a/src/libdoxygen.pro.in b/src/libdoxygen.pro.in index 7fa3a78..a43ae1a 100644 --- a/src/libdoxygen.pro.in +++ b/src/libdoxygen.pro.in @@ -22,6 +22,7 @@ HEADERS = bufstr.h \ cmdmapper.h \ code.h \ commentcnv.h \ + compound_xsd.h \ config.h \ constexp.h \ cppvalue.h \ @@ -50,6 +51,7 @@ HEADERS = bufstr.h \ htmlhelp.h \ image.h \ index.h \ + index_xsd.h \ instdox.h \ language.h \ latexdocvisitor.h \ diff --git a/src/libdoxygen.t b/src/libdoxygen.t index 6aec6ba..1008cd9 100644 --- a/src/libdoxygen.t +++ b/src/libdoxygen.t @@ -76,6 +76,9 @@ sub GenerateDep { $(YACC) -l -d -p cppExpYY constexp.y -o ce_parse.c -rm ce_parse.c -#treeview.h: treeview.js -# cat treeview.js | sed -e "s/\\\\/\\\\\\\\/g" -e "s/\"/\\\\\"/g" -e "s/^/\"/g" -e "s/$$/\\\\n\"/g" >treeview.h +index_xsd.h: index.xsd + cat index.xsd | sed -e "s/\\\\/\\\\\\\\/g" -e "s/\"/\\\\\"/g" -e "s/^/\"/g" -e "s/$$/\\\\n\"/g" >index_xsd.h + +compound_xsd.h: compound.xsd + cat compound.xsd | sed -e "s/\\\\/\\\\\\\\/g" -e "s/\"/\\\\\"/g" -e "s/^/\"/g" -e "s/$$/\\\\n\"/g" >compound_xsd.h diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 019943b..5c67c03 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -499,7 +499,19 @@ void MemberDef::writeLink(OutputList &ol,ClassDef *cd,NamespaceDef *nd, } else // local link { - ol.writeObjectLink(d->getReference(),d->getOutputFileBase(),anchor(),name()); + QCString sep = Config_getBool("OPTIMIZE_OUTPUT_JAVA") ? "." : "::"; + if (cd) + { + ol.writeObjectLink(d->getReference(),d->getOutputFileBase(),anchor(),cd->name()+sep+name()); + } + else if (nd) + { + ol.writeObjectLink(d->getReference(),d->getOutputFileBase(),anchor(),nd->name()+sep+name()); + } + else + { + ol.writeObjectLink(d->getReference(),d->getOutputFileBase(),anchor(),name()); + } } } @@ -2017,3 +2029,11 @@ void MemberDef::enableCallGraph(bool e) if (e) Doxygen::parseSourcesNeeded = TRUE; } +bool MemberDef::protectionVisible() const +{ + return prot==Public || + (prot==Private && Config_getBool("EXTRACT_PRIVATE")) || + (prot==Protected && Config_getBool("EXTRACT_PROTECTED")) || + (prot==Package && Config_getBool("EXTRACT_PACKAGE")); +} + diff --git a/src/memberdef.h b/src/memberdef.h index 544e58e..4fe2ee0 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -129,6 +129,7 @@ class MemberDef : public Definition bool isDestructor() const; bool hasOneLineInitializer() const; bool hasMultiLineInitializer() const; + bool protectionVisible() const; // output info bool isLinkableInProject() const; diff --git a/src/message.cpp b/src/message.cpp index 558bcf1..0b306fa 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -17,8 +17,11 @@ #include <stdarg.h> #include <stdio.h> +#include <qdatetime.h> #include "config.h" #include "util.h" +#include "debug.h" +#include "doxygen.h" static QCString outputFormat; static int warnFormatOrder; // 1 = $file,$line,$text @@ -96,6 +99,10 @@ void msg(const char *fmt, ...) { if (!Config_getBool("QUIET")) { + if (Debug::isFlagSet(Debug::Time)) + { + printf("%.3f sec: ",((double)Doxygen::runningTime.elapsed())/1000.0); + } va_list args; va_start(args, fmt); vfprintf(stdout, fmt, args); diff --git a/src/outputlist.cpp b/src/outputlist.cpp index e68ef8c..a00875b 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -194,7 +194,7 @@ void OutputList::popGeneratorState() void OutputList::parseDoc(const char *fileName,int startLine, const char * clName,MemberDef * md, const QCString &docStr,bool isExample, - const char *exampleName,SectionDict *sections) + const char *exampleName) { int count=0; if (docStr.isEmpty()) return; @@ -211,14 +211,12 @@ void OutputList::parseDoc(const char *fileName,int startLine, if (docStr.at(docStr.length()-1)=='\n') { root = validatingParseDoc(fileName,startLine, - clName,md,docStr,isExample,exampleName, - sections); + clName,md,docStr,isExample,exampleName); } else { root = validatingParseDoc(fileName,startLine, - clName,md,docStr+"\n",isExample,exampleName, - sections); + clName,md,docStr+"\n",isExample,exampleName); } og=outputs->first(); diff --git a/src/outputlist.h b/src/outputlist.h index 7cb663c..9668c4f 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -62,7 +62,7 @@ class OutputList : public OutputDocInterface void parseDoc(const char *fileName,int startLine, const char *clName,MemberDef *md,const QCString &docStr, - bool isExample,const char *exampleName=0,SectionDict *sections=0); + bool isExample,const char *exampleName=0); void parseText(const QCString &textStr); diff --git a/src/pagedef.cpp b/src/pagedef.cpp index f53df1f..36b63a0 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -25,3 +25,11 @@ GroupDef *PageDef::getGroupDef() const return partOfGroups() ? partOfGroups()->getFirst() : 0; } +QCString PageDef::getOutputFileBase() const +{ + if (getGroupDef()) + return getGroupDef()->getOutputFileBase(); + else + return m_fileName; +} + diff --git a/src/pagedef.h b/src/pagedef.h index 3be2e75..439cad5 100644 --- a/src/pagedef.h +++ b/src/pagedef.h @@ -34,7 +34,7 @@ class PageDef : public Definition } // functions to get a uniform interface with Definitions - QCString getOutputFileBase() const { return m_fileName; } + QCString getOutputFileBase() const; void findSectionsInDocumentation(); QCString title() const { return m_title; } GroupDef *getGroupDef() const; diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 2083622..8f38d2d 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -226,7 +226,7 @@ void PerlModOutput::iaddQuoted(const char *s) { char c; while ((c = *s++) != 0) { - if (c == '\'') + if ((c == '\'') || (c == '\\')) m_stream->add('\\'); m_stream->add(c); } @@ -243,7 +243,7 @@ void PerlModOutput::iaddFieldQuotedChar(const char *field, char content) { iaddField(field); m_stream->add('\''); - if (content == '\'') + if ((content == '\'') || (content == '\\')) m_stream->add('\\'); m_stream->add(content); m_stream->add('\''); diff --git a/src/scanner.l b/src/scanner.l index 1b40671..a482d39 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -336,7 +336,7 @@ static void addXRefItem(const char *listName,const char *itemTitle,const char *l SectionInfo *si=new SectionInfo(listName,anchorLabel, sectionTitle,SectionInfo::Anchor); Doxygen::sectionDict.insert(anchorLabel,si); - current->anchors->append(new QCString(anchorLabel)); + current->anchors->append(new SectionInfo(*si)); } current->brief = slString.copy(); // restore orginial brief desc. } @@ -503,7 +503,7 @@ FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]+ ID [a-z_A-Z][a-z_A-Z0-9]* LABELID [a-z_A-Z][a-z_A-Z0-9\-]* SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?) -SCOPENAME (({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) +SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)((~{BN}*)?{ID}) CSSCOPENAME (({ID}?{BN}*"."{BN}*)*)((~{BN}*)?{ID}) ATTR ({B}+[^>\n]*)? A [aA] @@ -3976,14 +3976,14 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] *pSkipDoc+=*yytext; } <AnchorLabel>{LABELID} { - //sectionLabel=yytext; - //addSection(); - //current->doc += "\\anchor "+sectionLabel+" "; + SectionInfo *si = new SectionInfo(yyFileName,yytext,0,SectionInfo::Anchor); + Doxygen::sectionDict.insert(yytext,si); + current->anchors->append(si); current->doc+=yytext; BEGIN(lastAnchorContext); } <SectionLabel>{LABELID} { - //sectionLabel=yytext; + sectionLabel=yytext; sectionTitle.resize(0); current->doc+=yytext; BEGIN(SectionTitle); @@ -3991,8 +3991,9 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;] <SectionTitle>[^\n*]*/"\n" { sectionTitle+=yytext; sectionTitle=sectionTitle.stripWhiteSpace(); - //current->doc += "\\section "+sectionLabel+" "; - //addSection(); + SectionInfo *si = new SectionInfo(yyFileName,sectionLabel,sectionTitle,SectionInfo::Anchor); + current->anchors->append(si); + Doxygen::sectionDict.insert(yytext,si); current->doc+=yytext; BEGIN(PageDoc); } diff --git a/src/section.h b/src/section.h index 6aca0c0..0f39c54 100644 --- a/src/section.h +++ b/src/section.h @@ -25,7 +25,6 @@ #include "sortdict.h" class Definition; -class PageInfo; struct SectionInfo { @@ -33,18 +32,23 @@ struct SectionInfo Subsubsection, Paragraph, Anchor }; SectionInfo(const char *f,const char *l,const char *t, - SectionType st,const char *r=0) - { label=l; title=t; type=st; ref=r; - definition=0; pageRef=0; generated=FALSE; - fileName=f; - } + SectionType st,const char *r=0) : + label(l), title(t), type(st), ref(r), definition(0), + fileName(f), generated(FALSE) + { + } + SectionInfo(const SectionInfo &s) + { + label=s.label.copy(); title=s.title.copy(); ref=s.ref.copy(); + type =s.type; definition=s.definition; + fileName=s.fileName.copy(); generated=s.generated; + } ~SectionInfo() {} QCString label; QCString title; - QCString ref; SectionType type; + QCString ref; Definition *definition; - PageInfo *pageRef; QCString fileName; bool generated; }; diff --git a/src/tagreader.cpp b/src/tagreader.cpp index 61af14c..095487e 100644 --- a/src/tagreader.cpp +++ b/src/tagreader.cpp @@ -865,7 +865,7 @@ void TagFileParser::addDocAnchors(Entry *e,QStrList &l) SectionInfo *si=new SectionInfo(e->fileName,*anchorName,*anchorName, SectionInfo::Anchor,m_tagName); Doxygen::sectionDict.insert(*anchorName,si); - e->anchors->append(anchorName); + e->anchors->append(si); } else { diff --git a/src/util.cpp b/src/util.cpp index b11d2ba..9509c0a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -25,6 +25,7 @@ #include <qregexp.h> #include <qfileinfo.h> #include <qdir.h> +#include <qdatetime.h> #include "util.h" #include "message.h" @@ -91,6 +92,8 @@ void TextGeneratorOLImpl::writeLink(const char *extRef,const char *file, /*! Implements an interruptable system call on Unix/Windows */ int iSystem(const char *command,const char *args,bool isBatchFile) { + QTime time; + time.start(); #ifndef _WIN32 isBatchFile=isBatchFile; /*! taken from the system() manpage on my Linux box */ @@ -129,6 +132,7 @@ int iSystem(const char *command,const char *args,bool isBatchFile) } } } + Doxygen::sysElapsedTime+=((double)time.elapsed())/1000.0; return status; #else // Other Unices just use fork @@ -157,6 +161,7 @@ int iSystem(const char *command,const char *args,bool isBatchFile) } else { + Doxygen::sysElapsedTime+=((double)time.elapsed())/1000.0; return status; } } @@ -199,9 +204,10 @@ int iSystem(const char *command,const char *args,bool isBatchFile) CloseHandle(sInfo.hProcess); } } + Doxygen::sysElapsedTime+=((double)time.elapsed())/1000.0; return 0; - //return system(command); #endif + } @@ -3635,7 +3641,7 @@ found: PageDef *addRelatedPage(const char *name,const QCString &ptitle, const QCString &doc, - QList<QCString> * /*anchors*/, + QList<SectionInfo> * /*anchors*/, const char *fileName,int startLine, const QList<ListItemInfo> *sli, GroupDef *gd, @@ -48,6 +48,7 @@ struct TagInfo; class MemberNameInfoSDict; struct ListItemInfo; class PageDef; +class SectionInfo; //-------------------------------------------------------------------- @@ -185,7 +186,7 @@ int filterCRLF(char *buf,int len); void addRefItem(const QList<ListItemInfo> *sli,const char *prefix, const char *name,const char *title,const char *args=0); PageDef *addRelatedPage(const char *name,const QCString &ptitle, - const QCString &doc,QList<QCString> *anchors, + const QCString &doc,QList<SectionInfo> *anchors, const char *fileName,int startLine, const QList<ListItemInfo> *sli, GroupDef *gd=0, diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 7cef7d7..2f58fd4 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -47,6 +47,14 @@ // debug inside output //#define XML_DB(x) QCString __t;__t.sprintf x;m_t << __t +//------------------ + +static const char index_xsd[] = +#include "index_xsd.h" +; + +//------------------ + inline void writeXMLString(QTextStream &t,const char *s) { @@ -1448,16 +1456,33 @@ void generateXML() } } QDir xmlDir(outputDirectory); - QCString fileName=outputDirectory+"/index.xml"; + QCString fileName=outputDirectory+"/index.xsd"; QFile f(fileName); if (!f.open(IO_WriteOnly)) { err("Cannot open file %s for writing!\n",fileName.data()); return; } + f.writeBlock(index_xsd,strlen(index_xsd)); + f.close(); + + fileName=outputDirectory+"/index.xml"; + f.setName(fileName); + if (!f.open(IO_WriteOnly)) + { + err("Cannot open file %s for writing!\n",fileName.data()); + return; + } QTextStream t(&f); t.setEncoding(QTextStream::Latin1); - writeXMLHeader(t); + + // write index header + t << "<?xml version='1.0' encoding='" << theTranslator->idLanguageCharset() + << "' standalone='no'?>" << endl;; + t << "<doxygen xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "; + t << "xsi:noNamespaceSchemaLocation=\"index.xsd\" "; + t << "version=\"" << versionString << "\">" << endl; + ClassSDict::Iterator cli(Doxygen::classSDict); ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) |