diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2008-03-07 19:55:05 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2008-03-07 19:55:05 (GMT) |
commit | b43cd6311a712c01c2c8297fa00809730e504d70 (patch) | |
tree | 74a4cb6c6c83c3b41a92ba1da8df0235abd2dafe /src | |
parent | 95fd5f1c991ee66f7122801276a133ebfce86aaa (diff) | |
download | Doxygen-b43cd6311a712c01c2c8297fa00809730e504d70.zip Doxygen-b43cd6311a712c01c2c8297fa00809730e504d70.tar.gz Doxygen-b43cd6311a712c01c2c8297fa00809730e504d70.tar.bz2 |
Release-1.5.5-20080307
Diffstat (limited to 'src')
-rw-r--r-- | src/config.l | 26 | ||||
-rw-r--r-- | src/docparser.cpp | 1 | ||||
-rw-r--r-- | src/docsets.cpp | 3 | ||||
-rw-r--r-- | src/doctokenizer.l | 2 | ||||
-rw-r--r-- | src/doxygen.cpp | 93 | ||||
-rw-r--r-- | src/doxygen_css.h | 25 | ||||
-rw-r--r-- | src/fortranscanner.l | 6 | ||||
-rw-r--r-- | src/ftvhelp.cpp | 276 | ||||
-rw-r--r-- | src/ftvhelp.h | 27 | ||||
-rw-r--r-- | src/groupdef.h | 3 | ||||
-rw-r--r-- | src/htmlgen.cpp | 16 | ||||
-rw-r--r-- | src/htmlhelp.cpp | 11 | ||||
-rw-r--r-- | src/index.cpp | 158 | ||||
-rw-r--r-- | src/latexgen.cpp | 3 | ||||
-rw-r--r-- | src/libdoxygen.t | 12 | ||||
-rw-r--r-- | src/memberdef.cpp | 2 | ||||
-rw-r--r-- | src/memberlist.cpp | 9 | ||||
-rw-r--r-- | src/rtfdocvisitor.cpp | 2 | ||||
-rw-r--r-- | src/rtfgen.cpp | 2 | ||||
-rw-r--r-- | src/scanner.l | 27 | ||||
-rw-r--r-- | src/translator_de.h | 8 | ||||
-rw-r--r-- | src/util.cpp | 21 | ||||
-rw-r--r-- | src/util.h | 2 |
23 files changed, 461 insertions, 274 deletions
diff --git a/src/config.l b/src/config.l index c12426a..b317828 100644 --- a/src/config.l +++ b/src/config.l @@ -1326,7 +1326,7 @@ void Config::check() bool b2 = Config_getBool("INHERIT_DOCS"); bool b3 = Config_getBool("HIDE_SCOPE_NAMES"); bool b4 = Config_getBool("EXTRACT_PRIVATE"); - char *s1,*s2,*s3,*s4; + const char *s1,*s2,*s3,*s4; if (b1) s1=" INLINDE_INHERITED_MEMB = NO (was YES)\n"; else s1=""; if (b2) s2=" INHERIT_DOCS = NO (was YES)\n"; else s2=""; if (!b3) s3=" HIDE_SCOPE_NAMES = YES (was NO)\n"; else s3=""; @@ -2415,16 +2415,28 @@ void Config::create() 1,20,4 ); ci->addDependency("GENERATE_HTML"); - cb = addBool( + ce = addEnum( "GENERATE_TREEVIEW", - "If the GENERATE_TREEVIEW tag is set to YES, a side panel will be\n" - "generated containing a tree-like index structure (just like the one that \n" + "The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\n" + "structure should be generated to display hierarchical information.\n" + "If the tag value is set to FRAME, a side panel will be generated\n" + "containing a tree-like index structure (just like the one that \n" "is generated for HTML Help). For this to work a browser that supports \n" "JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, \n" "Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are \n" - "probably better off using the HTML help feature. \n", - FALSE - ); + "probably better off using the HTML help feature. Other possible values \n" + "for this tag are: HIERARCHIES, which will generate the Groups, Directories,\n" + "and Class Hiererachy pages using a tree view instead of an ordered list;\n" + "ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which\n" + "disables this behavior completely. For backwards compatibility with previous\n" + "releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE\n" + "respectively.\n", + "NONE" + ); + ce->addValue("NONE"); + ce->addValue("FRAME"); + ce->addValue("HIERARCHIES"); + ce->addValue("ALL"); cb->addDependency("GENERATE_HTML"); ci = addInt( "TREEVIEW_WIDTH", diff --git a/src/docparser.cpp b/src/docparser.cpp index 63ff330..aecc4d1 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -320,6 +320,7 @@ static void checkArgumentName(const QString &name,bool isParam) LockingPtr<ArgumentList> al=g_memberDef->isDocsForDefinition() ? g_memberDef->argumentList() : g_memberDef->declArgumentList(); + //printf("isDocsForDefinition()=%d\n",g_memberDef->isDocsForDefinition()); if (al==0) return; // no argument list static QRegExp re("[a-zA-Z0-9_]+\\.*"); diff --git a/src/docsets.cpp b/src/docsets.cpp index 86fe54e..f9f5114 100644 --- a/src/docsets.cpp +++ b/src/docsets.cpp @@ -129,8 +129,7 @@ void DocSets::initialize() err("Could not open file %s for writing\n",notes.data()); exit(1); } - QCString indexName="index"; - if (Config_getBool("GENERATE_TREEVIEW")) indexName="main"; + QCString indexName=usingTreeIndex()?"main":"index"; m_nts.setDevice(m_nf); m_nts.setEncoding(QTextStream::UnicodeUTF8); m_nts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl; diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 5969cd2..7edafa0 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -326,7 +326,7 @@ OPMASK ({BLANK}*{OPNORM}{FUNCARG}) OPMASKOPT ({BLANK}*{OPNORM}{FUNCARG}?)|({OPCAST}{FUNCARG}) LNKWORD1 ("::"|"#")?{SCOPEMASK} CVSPEC {BLANK}*("const"|"volatile") -LNKWORD2 ({SCOPEPRE}*"operator"{OPMASK})|(("::"|"#"){SCOPEPRE}*"operator"{OPMASKOPT}) +LNKWORD2 ({SCOPEPRE}*"operator"{OPMASK})|({SCOPEPRE}"operator"{OPMASKOPT})|(("::"|"#"){SCOPEPRE}*"operator"{OPMASKOPT}) LNKWORD3 ([0-9a-z_A-Z\-]+("/"|"\\"))*[0-9a-z_A-Z\-]+("."[0-9a-z_A-Z]+)+ CHARWORD [^ \t\n\r\\@<>()\[\]:;\?{}&%$#,.] CHARWORDQ [^ \t\n\r\\@<>()\[\]:;\?{}&%$#,."] diff --git a/src/doxygen.cpp b/src/doxygen.cpp index f66be45..c6633ed 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -241,7 +241,6 @@ struct STLInfo static STLInfo g_stlinfo[] = { // className baseClass1 baseClass2 templType1 templName1 templType2 templName2 virtInheritance // iterators -#if 0 { "allocator", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, { "auto_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, { "ios_base", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, @@ -284,9 +283,7 @@ static STLInfo g_stlinfo[] = { "multimap", 0, 0, "K", "keys", "T", "elements", FALSE, TRUE }, { "set", 0, 0, "K", "keys", 0, 0, FALSE, TRUE }, { "multiset", 0, 0, "K", "keys", 0, 0, FALSE, TRUE }, -#endif { "vector", 0, 0, "T", "elements", 0, 0, FALSE, TRUE }, -#if 0 { "queue", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, { "priority_queue", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, { "stack", 0, 0, "T", "elements", 0, 0, FALSE, FALSE }, @@ -306,7 +303,6 @@ static STLInfo g_stlinfo[] = { "range_error", "runtime_error", 0, 0, 0, 0, 0, FALSE, FALSE }, { "overflow_error", "runtime_error", 0, 0, 0, 0, 0, FALSE, FALSE }, { "underflow_error", "runtime_error", 0, 0, 0, 0, 0, FALSE, FALSE }, -#endif { 0, 0, 0, 0, 0, 0, 0, FALSE, FALSE } }; @@ -2237,8 +2233,8 @@ static bool isVarWithConstructor(EntryNav *rootNav) goto done; } else if ((fd = rootNav->fileDef()) && - fd->name().right(2)==".c" - ) + (fd->name().right(2)==".c" || fd->name().right(2)==".h") + ) { // inside a .c file result=FALSE; goto done; @@ -2333,9 +2329,9 @@ static bool isVarWithConstructor(EntryNav *rootNav) } done: + //printf("isVarWithConstructor(%s,%s)=%d\n",rootNav->parent()->name().data(), + // root->type.data(),result); rootNav->releaseEntry(); - //printf("isVarWithConstructor(%s,%s)=%d\n",root->parent->name.data(), - // root->type.data(),result); return result; } @@ -6828,53 +6824,56 @@ static void computeMemberRelations() { MemberNameIterator mdi(*mn); MemberDef *md; - for ( ; (md=mdi.current()) ; ++mdi ) // for each member with a specific arg list + for ( ; (md=mdi.current()) ; ++mdi ) // for each member with a specific name { - MemberNameIterator bmdi(*mn); - MemberDef *bmd; - for ( ; (bmd=bmdi.current()) ; ++bmdi ) // for each other member with that signature + MemberDef *bmd = mn->first(); // for each other member with the same name + while (bmd) { - ClassDef *bmcd = bmd->getClassDef(); ClassDef *mcd = md->getClassDef(); - //printf("Check relation between `%s'::`%s' (%p) and `%s'::`%s' (%p)\n", - // mcd->name().data(),md->name().data(),md, - // bmcd->name().data(),bmd->name().data(),bmd - // ); - if (md!=bmd && bmcd && mcd && bmcd!=mcd && mcd->isBaseClass(bmcd,TRUE)) + if (mcd && mcd->baseClasses()) { - //printf(" Base argList=`%s'\n Super argList=`%s'\n", - // argListToString(bmd->argumentList()).data(), - // argListToString(md->argumentList()).data() + ClassDef *bmcd = bmd->getClassDef(); + //printf("Check relation between `%s'::`%s' (%p) and `%s'::`%s' (%p)\n", + // mcd->name().data(),md->name().data(),md, + // bmcd->name().data(),bmd->name().data(),bmd // ); - LockingPtr<ArgumentList> bmdAl = bmd->argumentList(); - LockingPtr<ArgumentList> mdAl = md->argumentList(); - if ( - matchArguments2(bmd->getOuterScope(),bmd->getFileDef(),bmdAl.pointer(), - md->getOuterScope(), md->getFileDef(), mdAl.pointer(), - TRUE - ) - ) + if (md!=bmd && bmcd && mcd && bmcd!=mcd && mcd->isBaseClass(bmcd,TRUE)) { - //printf(" match found!\n"); - if (mcd && bmcd && - mcd->isLinkable() && bmcd->isLinkable() + //printf(" Base argList=`%s'\n Super argList=`%s'\n", + // argListToString(bmd->argumentList()).data(), + // argListToString(md->argumentList()).data() + // ); + LockingPtr<ArgumentList> bmdAl = bmd->argumentList(); + LockingPtr<ArgumentList> mdAl = md->argumentList(); + if ( + matchArguments2(bmd->getOuterScope(),bmd->getFileDef(),bmdAl.pointer(), + md->getOuterScope(), md->getFileDef(), mdAl.pointer(), + TRUE + ) ) { - MemberDef *rmd; - if ((rmd=md->reimplements())==0 || - minClassDistance(mcd,bmcd)<minClassDistance(mcd,rmd->getClassDef()) + //printf(" match found!\n"); + if (mcd && bmcd && + mcd->isLinkable() && bmcd->isLinkable() ) { - //printf("setting (new) reimplements member\n"); - md->setReimplements(bmd); + MemberDef *rmd; + if ((rmd=md->reimplements())==0 || + minClassDistance(mcd,bmcd)<minClassDistance(mcd,rmd->getClassDef()) + ) + { + //printf("setting (new) reimplements member\n"); + md->setReimplements(bmd); + } + //printf("%s: add reimplements member %s\n",mcd->name().data(),bmcd->name().data()); + //md->setImplements(bmd); + //printf("%s: add reimplementedBy member %s\n",bmcd->name().data(),mcd->name().data()); + bmd->insertReimplementedBy(md); } - //printf("%s: add reimplements member %s\n",mcd->name().data(),bmcd->name().data()); - //md->setImplements(bmd); - //printf("%s: add reimplementedBy member %s\n",bmcd->name().data(),mcd->name().data()); - bmd->insertReimplementedBy(md); - } - } + } + } } + bmd = mn->next(); } } } @@ -7671,9 +7670,9 @@ static void buildPageList(EntryNav *rootNav) QCString title=root->args.stripWhiteSpace(); if (title.isEmpty()) title=theTranslator->trMainPage(); addRefItem(root->sli,"page", - Config_getBool("GENERATE_TREEVIEW")?"main":"index", + usingTreeIndex()?"main":"index", title - ); + ); rootNav->releaseEntry(); } @@ -7691,7 +7690,7 @@ static void findMainPage(EntryNav *rootNav) { //printf("Found main page! \n======\n%s\n=======\n",root->doc.data()); QCString title=root->args.stripWhiteSpace(); - QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index"; + QCString indexName=usingTreeIndex()?"main":"index"; Doxygen::mainPage = new PageDef(root->fileName,root->startLine, indexName, root->brief+root->doc,title); //setFileNameForSections(root->anchors,"index",Doxygen::mainPage); @@ -9963,7 +9962,7 @@ void generateOutput() outputList->add(new HtmlGenerator); HtmlGenerator::init(); if (Config_getBool("GENERATE_HTMLHELP")) Doxygen::indexList.addIndex(new HtmlHelp); - if (Config_getBool("GENERATE_TREEVIEW")) Doxygen::indexList.addIndex(new FTVHelp); + if (usingTreeIndex()) Doxygen::indexList.addIndex(new FTVHelp); if (Config_getBool("GENERATE_DOCSET")) Doxygen::indexList.addIndex(new DocSets); Doxygen::indexList.initialize(); if (Config_getBool("HTML_DYNAMIC_SECTIONS")) HtmlGenerator::generateSectionImages(); diff --git a/src/doxygen_css.h b/src/doxygen_css.h index bf88dbe..89b4cc9 100644 --- a/src/doxygen_css.h +++ b/src/doxygen_css.h @@ -407,6 +407,7 @@ " font-family: sans-serif;\n" " margin:0.5em;\n" "}\n" +"/* these are for tree view when used as main index */\n" ".directory { \n" " font-size: 9pt; \n" " font-weight: bold; \n" @@ -430,4 +431,28 @@ ".directory img { \n" " vertical-align: -30%; \n" "}\n" +"/* these are for tree view when not used as main index */\n" +".directory-alt { \n" +" font-size: 100%; \n" +" font-weight: bold; \n" +"}\n" +".directory-alt h3 { \n" +" margin: 0px; \n" +" margin-top: 1em; \n" +" font-size: 11pt; \n" +"}\n" +".directory-alt > h3 { \n" +" margin-top: 0; \n" +"}\n" +".directory-alt p { \n" +" margin: 0px; \n" +" white-space: nowrap; \n" +"}\n" +".directory-alt div { \n" +" display: none; \n" +" margin: 0px; \n" +"}\n" +".directory-alt img { \n" +" vertical-align: -30%; \n" +"}\n" "\n" diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 285bc24..12104c0 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -325,7 +325,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} yy_push_state(InterfaceBody); startScope(last_entry); } -<InterfaceBody>"end"({BS_}"interface")?.* { +<InterfaceBody>^{BS}"end"({BS_}"interface")? { if (!endScope(current_root)) yyterminate(); yy_pop_state(); @@ -349,7 +349,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} BEGIN(Module); defaultProtection = Public; } -<Start,ModuleBody>"end"({BS_}(module|program))?.* { // end module +<Start,ModuleBody>^{BS}"end"({BS_}(module|program))?{BS} { // end module resolveModuleProcedures(moduleProcedures, current_root); if (!endScope(current_root)) yyterminate(); @@ -415,7 +415,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC} /*------- module/global/typedef variable ---------------------------------------------------*/ -<SubprogBody>"end"({BS_}{SUBPROG})?.* { +<SubprogBody>^{BS}"end"({BS_}{SUBPROG})?{BS} { //cout << "1e=========> got end subprog: " << yytext << endl; /* args is used for parameters in list of functions, argList for diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index 0129b78..5decfec 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -326,20 +326,17 @@ struct FTVNode //---------------------------------------------------------------------------- -FTVHelp *FTVHelp::m_theInstance = 0; - -/*! Construm_cts an ftv help object. +/*! Constructs an ftv help object. * The object has to be \link initialize() initialized\endlink before it can * be used. */ -FTVHelp::FTVHelp() +FTVHelp::FTVHelp(bool TLI) { /* initial depth */ - //m_dc = 0; - //m_cf = 0; m_indentNodes = new QList<FTVNode>[MAX_INDENT]; m_indentNodes[0].setAutoDelete(TRUE); m_indent=0; + m_topLevelIndex = TLI; } FTVHelp::~FTVHelp() @@ -347,16 +344,6 @@ FTVHelp::~FTVHelp() delete[] m_indentNodes; } -#if 0 -/*! return a reference to the one and only instance of this class. - */ -FTVHelp *FTVHelp::getInstance() -{ - if (m_theInstance==0) m_theInstance = new FTVHelp; - return m_theInstance; -} -#endif - /*! This will create a folder tree view table of contents file (tree.js). * \sa finalize() */ @@ -371,9 +358,6 @@ void FTVHelp::initialize() void FTVHelp::finalize() { generateTreeView(); - generateTreeViewImages(); - delete m_theInstance; - m_theInstance=0; } /*! Increase the level of the contents hierarchy. @@ -382,10 +366,8 @@ void FTVHelp::finalize() */ void FTVHelp::incContentsDepth() { - //int i; for (i=0;i<m_dc+1;i++) m_cts << " "; m_indent++; ASSERT(m_indent<MAX_INDENT); - //return m_indent; } /*! Decrease the level of the contents hierarchy. @@ -394,8 +376,6 @@ void FTVHelp::incContentsDepth() */ void FTVHelp::decContentsDepth() { - //int i; for (i=0;i<m_dc;i++) m_cts << " "; - ASSERT(m_indent>0); if (m_indent>0) { @@ -408,7 +388,6 @@ void FTVHelp::decContentsDepth() parent->children.append(children->take(0)); } } - //return m_indent; } /*! Add a list item to the contents file. @@ -423,7 +402,7 @@ void FTVHelp::addContentsItem(bool isDir, const char *ref, const char *file, const char *anchor - ) + ) { QList<FTVNode> *nl = &m_indentNodes[m_indent]; FTVNode *newNode = new FTVNode(isDir,ref,file,anchor,name); @@ -516,7 +495,10 @@ void FTVHelp::generateLink(QTextStream &t,FTVNode *n) } t << n->file << Doxygen::htmlFileExtension; if (!n->anchor.isEmpty()) t << "#" << n->anchor; - t << "\" target=\"basefrm\">"; + if (m_topLevelIndex) + t << "\" target=\"basefrm\">"; + else + t << "\" target=\"_self\">"; t << n->name; t << "</a>"; if (!n->ref.isEmpty()) @@ -580,59 +562,62 @@ void FTVHelp::generateTreeViewImages() } } -void FTVHelp::generateTreeView() +void FTVHelp::generateTreeView(QString* OutString) { - // Generate alternative index.html as a frame - QCString fileName=Config_getString("HTML_OUTPUT")+"/index"+Doxygen::htmlFileExtension; + QCString fileName; QFile f; - f.setName(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - else + + generateTreeViewImages(); + + // If top level index, generate alternative index.html as a frame + if (m_topLevelIndex) { - QTextStream t(&f); -#if QT_VERSION >= 200 - t.setEncoding(QTextStream::UnicodeUTF8); -#endif - t << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\">\n"; - t << "<html><head>"; - t << "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">\n"; - t << "<title>"; - if (Config_getString("PROJECT_NAME").isEmpty()) + fileName=Config_getString("HTML_OUTPUT")+"/index"+Doxygen::htmlFileExtension; + f.setName(fileName); + if (!f.open(IO_WriteOnly)) { - t << "Doxygen Documentation"; + err("Cannot open file %s for writing!\n",fileName.data()); + return; } else { - t << Config_getString("PROJECT_NAME"); + QTextStream t(&f); +#if QT_VERSION >= 200 + t.setEncoding(QTextStream::UnicodeUTF8); +#endif + t << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\">\n"; + t << "<html><head>"; + t << "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">\n"; + t << "<title>"; + if (Config_getString("PROJECT_NAME").isEmpty()) + { + t << "Doxygen Documentation"; + } + else + { + t << Config_getString("PROJECT_NAME"); + } + t << "</title></head>" << endl; + t << "<frameset cols=\"" << Config_getInt("TREEVIEW_WIDTH") << ",*\">" << endl; + t << " <frame src=\"tree" << Doxygen::htmlFileExtension << "\" name=\"treefrm\">" << endl; + t << " <frame src=\"main" << Doxygen::htmlFileExtension << "\" name=\"basefrm\">" << endl; + t << " <noframes>" << endl; + t << " <a href=\"main" << Doxygen::htmlFileExtension << "\">Frames are disabled. Click here to go to the main page.</a>" << endl; + t << " </noframes>" << endl; + t << "</frameset>" << endl; + t << "</html>" << endl; + f.close(); } - t << "</title></head>" << endl; - t << "<frameset cols=\"" << Config_getInt("TREEVIEW_WIDTH") << ",*\">" << endl; - t << " <frame src=\"tree" << Doxygen::htmlFileExtension << "\" name=\"treefrm\">" << endl; - t << " <frame src=\"main" << Doxygen::htmlFileExtension << "\" name=\"basefrm\">" << endl; - t << " <noframes>" << endl; - t << " <a href=\"main" << Doxygen::htmlFileExtension << "\">Frames are disabled. Click here to go to the main page.</a>" << endl; - t << " </noframes>" << endl; - t << "</frameset>" << endl; - t << "</html>" << endl; - f.close(); } - // Generate tree view frame - fileName=Config_getString("HTML_OUTPUT")+"/tree"+Doxygen::htmlFileExtension; - f.setName(fileName); - if (!f.open(IO_WriteOnly)) - { - err("Cannot open file %s for writing!\n",fileName.data()); - return; - } - else + // Generate tree view + if (!OutString) + OutString = new QString; + QTextOStream t(OutString); + t.setEncoding(QTextStream::UnicodeUTF8); + + if (m_topLevelIndex) { - QTextStream t(&f); - t.setEncoding(QTextStream::UnicodeUTF8); t << "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"; t << " <head>\n"; t << " <meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\" />\n"; @@ -655,64 +640,67 @@ void FTVHelp::generateTreeView() } t << "\">" << endl; t << " <title>TreeView</title>\n"; - t << " <script type=\"text/javascript\">\n"; - t << " <!-- // Hide script from old browsers\n"; - t << " \n"; - - /* User has clicked on a node (folder or +/-) in the tree */ - t << " function toggleFolder(id, imageNode) \n"; - t << " {\n"; - t << " var folder = document.getElementById(id);\n"; - t << " var l = imageNode.src.length;\n"; - /* If the user clicks on the book icon, we move left one image so - * the code (below) will also adjust the '+' icon. - */ - t << " if (imageNode.src.substring(l-20,l)==\"" FTV_ICON_FILE(folderclosed) "\" || \n"; - t << " imageNode.src.substring(l-18,l)==\"" FTV_ICON_FILE(folderopen) "\")\n"; - t << " {\n"; - t << " imageNode = imageNode.previousSibling;\n"; - t << " l = imageNode.src.length;\n"; - t << " }\n"; - t << " if (folder == null) \n"; - t << " {\n"; - t << " } \n"; - /* Node controls a open section, we need to close it */ - t << " else if (folder.style.display == \"block\") \n"; - t << " {\n"; - t << " if (imageNode != null) \n"; - t << " {\n"; - t << " imageNode.nextSibling.src = \"" FTV_ICON_FILE(folderclosed) "\";\n"; - t << " if (imageNode.src.substring(l-13,l) == \"" FTV_ICON_FILE(mnode) "\")\n"; - t << " {\n"; - t << " imageNode.src = \"" FTV_ICON_FILE(pnode) "\";\n"; - t << " }\n"; - t << " else if (imageNode.src.substring(l-17,l) == \"" FTV_ICON_FILE(mlastnode) "\")\n"; - t << " {\n"; - t << " imageNode.src = \"" FTV_ICON_FILE(plastnode) "\";\n"; - t << " }\n"; - t << " }\n"; - t << " folder.style.display = \"none\";\n"; - t << " } \n"; - t << " else \n"; /* section is closed, we need to open it */ - t << " {\n"; - t << " if (imageNode != null) \n"; - t << " {\n"; - t << " imageNode.nextSibling.src = \"" FTV_ICON_FILE(folderopen) "\";\n"; - t << " if (imageNode.src.substring(l-13,l) == \"" FTV_ICON_FILE(pnode) "\")\n"; - t << " {\n"; - t << " imageNode.src = \"" FTV_ICON_FILE(mnode) "\";\n"; - t << " }\n"; - t << " else if (imageNode.src.substring(l-17,l) == \"" FTV_ICON_FILE(plastnode) "\")\n"; - t << " {\n"; - t << " imageNode.src = \"" FTV_ICON_FILE(mlastnode) "\";\n"; - t << " }\n"; - t << " }\n"; - t << " folder.style.display = \"block\";\n"; - t << " }\n"; - t << " }\n"; - t << "\n"; - t << " // End script hiding --> \n"; - t << " </script>\n"; + } + t << " <script type=\"text/javascript\">\n"; + t << " <!-- // Hide script from old browsers\n"; + t << " \n"; + + /* User has clicked on a node (folder or +/-) in the tree */ + t << " function toggleFolder(id, imageNode) \n"; + t << " {\n"; + t << " var folder = document.getElementById(id);\n"; + t << " var l = imageNode.src.length;\n"; + /* If the user clicks on the book icon, we move left one image so + * the code (below) will also adjust the '+' icon. + */ + t << " if (imageNode.src.substring(l-20,l)==\"" FTV_ICON_FILE(folderclosed) "\" || \n"; + t << " imageNode.src.substring(l-18,l)==\"" FTV_ICON_FILE(folderopen) "\")\n"; + t << " {\n"; + t << " imageNode = imageNode.previousSibling;\n"; + t << " l = imageNode.src.length;\n"; + t << " }\n"; + t << " if (folder == null) \n"; + t << " {\n"; + t << " } \n"; + /* Node controls a open section, we need to close it */ + t << " else if (folder.style.display == \"block\") \n"; + t << " {\n"; + t << " if (imageNode != null) \n"; + t << " {\n"; + t << " imageNode.nextSibling.src = \"" FTV_ICON_FILE(folderclosed) "\";\n"; + t << " if (imageNode.src.substring(l-13,l) == \"" FTV_ICON_FILE(mnode) "\")\n"; + t << " {\n"; + t << " imageNode.src = \"" FTV_ICON_FILE(pnode) "\";\n"; + t << " }\n"; + t << " else if (imageNode.src.substring(l-17,l) == \"" FTV_ICON_FILE(mlastnode) "\")\n"; + t << " {\n"; + t << " imageNode.src = \"" FTV_ICON_FILE(plastnode) "\";\n"; + t << " }\n"; + t << " }\n"; + t << " folder.style.display = \"none\";\n"; + t << " } \n"; + t << " else \n"; /* section is closed, we need to open it */ + t << " {\n"; + t << " if (imageNode != null) \n"; + t << " {\n"; + t << " imageNode.nextSibling.src = \"" FTV_ICON_FILE(folderopen) "\";\n"; + t << " if (imageNode.src.substring(l-13,l) == \"" FTV_ICON_FILE(pnode) "\")\n"; + t << " {\n"; + t << " imageNode.src = \"" FTV_ICON_FILE(mnode) "\";\n"; + t << " }\n"; + t << " else if (imageNode.src.substring(l-17,l) == \"" FTV_ICON_FILE(plastnode) "\")\n"; + t << " {\n"; + t << " imageNode.src = \"" FTV_ICON_FILE(mlastnode) "\";\n"; + t << " }\n"; + t << " }\n"; + t << " folder.style.display = \"block\";\n"; + t << " }\n"; + t << " }\n"; + t << "\n"; + t << " // End script hiding --> \n"; + t << " </script>\n"; + if (m_topLevelIndex) + { t << " </head>\n"; t << "\n"; t << " <body class=\"ftvtree\">\n"; @@ -728,16 +716,40 @@ void FTVHelp::generateTreeView() t << projName; } t << "</h3>\n"; - t << " <div style=\"display: block;\">\n"; + } + else + { + t << " <div class=\"directory-alt\">\n"; + t << " <br>\n"; + } + t << " <div style=\"display: block;\">\n"; - generateTree(t,m_indentNodes[0],0); + generateTree(t,m_indentNodes[0],0); - t << " </div>\n"; - t << " </div>\n"; + t << " </div>\n"; + t << " </div>\n"; + + if (!m_topLevelIndex) + { t << " </body>\n"; t << "</html>\n"; } - generateTreeViewImages(); - + + if (m_topLevelIndex) + { + fileName=Config_getString("HTML_OUTPUT")+"/tree"+Doxygen::htmlFileExtension; + f.setName(fileName); + if (!f.open(IO_WriteOnly)) + { + err("Cannot open file %s for writing!\n",fileName.data()); + return; + } + else + { + QTextStream t(&f); + t << *OutString << endl; + f.close(); + } + } } diff --git a/src/ftvhelp.h b/src/ftvhelp.h index fee1944..58e4453 100644 --- a/src/ftvhelp.h +++ b/src/ftvhelp.h @@ -1,11 +1,24 @@ /****************************************************************************** + * + * Copyright (C) 1997-2008 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +/****************************************************************************** * ftvhelp.h,v 1.0 2000/09/06 16:09:00 * * Kenney Wong <kwong@ea.com> * * Folder Tree View for offline help on browsers that do not support HTML Help. - * Uses the FTV structure from: - * http://www.geocities.com/Paris/LeftBank/2178/ftexample.html */ #ifndef FTVHELP_H @@ -58,8 +71,8 @@ extern FTVImageInfo image_info[]; class FTVHelp : public IndexIntf { public: - FTVHelp(); - //static FTVHelp *getInstance(); + FTVHelp(bool topLevelIndex = true); + ~FTVHelp(); void initialize(); void finalize(); void incContentsDepth(); @@ -73,17 +86,15 @@ class FTVHelp : public IndexIntf const char *, const char *, const char *, const MemberDef *) {} void addIndexFile(const char *) {} - + void generateTreeView(QString* = NULL); private: void generateTreeViewImages(); - void generateTreeView(); void generateTree(QTextStream &t,const QList<FTVNode> &nl,int level); void generateIndent(QTextStream &t,FTVNode *n,int level); void generateLink(QTextStream &t,FTVNode *n); - ~FTVHelp(); - static FTVHelp *m_theInstance; QList<FTVNode> *m_indentNodes; int m_indent; + bool m_topLevelIndex; }; diff --git a/src/groupdef.h b/src/groupdef.h index 7a4070f..06eb035 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -39,6 +39,7 @@ class PageSDict; class PageDef; class DirDef; class DirList; +class FTVHelp; class GroupDef : public Definition { @@ -86,7 +87,7 @@ class GroupDef : public Definition bool visited; // number of times accessed for output - KPW - friend void writeGroupTreeNode(OutputList&, GroupDef*, int); + friend void writeGroupTreeNode(OutputList&, GroupDef*, int, FTVHelp*); // make accessible for writing tree view of group in index.cpp - KPW void setGroupScope(Definition *d) { groupScope = d; } diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index b6982b7..82d6176 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -978,7 +978,7 @@ void HtmlGenerator::endTextLink() void HtmlGenerator::startHtmlLink(const char *url) { t << "<a "; - if (Config_getBool("GENERATE_TREEVIEW")) t << "target=\"top\" "; + if (usingTreeIndex()) t << "target=\"top\" "; t << "href=\""; if (url) t << url; t << "\">"; @@ -1618,17 +1618,17 @@ void HtmlGenerator::writeNonBreakableSpace(int n) } } -void HtmlGenerator::writeLineNumber(const char *ref,const char *file, +void HtmlGenerator::writeLineNumber(const char *ref,const char *filename, const char *anchor,int l) { QCString lineNumber,lineAnchor; lineNumber.sprintf("%05d",l); lineAnchor.sprintf("l%05d",l); - if (file) + if (filename) { startCodeAnchor(lineAnchor); - writeCodeLink(ref,file,anchor,lineNumber,0); + writeCodeLink(ref,filename,anchor,lineNumber,0); endCodeAnchor(); } else @@ -1641,13 +1641,13 @@ void HtmlGenerator::writeLineNumber(const char *ref,const char *file, } void HtmlGenerator::startSimpleSect(SectionTypes, - const char *file,const char *anchor, + const char *filename,const char *anchor, const char *title) { t << "<dl compact><dt><b>"; - if (file) + if (filename) { - writeObjectLink(0,file,anchor,title); + writeObjectLink(0,filename,anchor,title); } else { @@ -1867,7 +1867,7 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); startQuickIndexList(t,compact); - if (Config_getBool("GENERATE_TREEVIEW")) + if (usingTreeIndex()) { startQuickIndexItem(t,"main"+Doxygen::htmlFileExtension, hli==HLI_Main,compact,relPath); diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index d77fe1c..542dba1 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -415,7 +415,7 @@ void HtmlHelp::createProjectFile() QCString indexName="index"+Doxygen::htmlFileExtension; - if (Config_getBool("GENERATE_TREEVIEW")) indexName="main"+Doxygen::htmlFileExtension; + if (usingTreeIndex()) indexName="main"+Doxygen::htmlFileExtension; t << "[OPTIONS]\n"; if (!Config_getString("CHM_FILE").isEmpty()) { @@ -433,9 +433,16 @@ void HtmlHelp::createProjectFile() t << "Title=" << Config_getString("PROJECT_NAME") << endl << endl; t << "[WINDOWS]" << endl; + + // NOTE: the 0x10387e number is a set of bits specifying the buttons + // which should appear in the CHM viewer; that specific value + // means "show all buttons including the font-size one"; + // the font-size one is not normally settable by the HTML Help Workshop + // utility but the way to set it is described here: + // http://support.microsoft.com/?scid=kb%3Ben-us%3B240062&x=17&y=18 t << "main=\"" << Config_getString("PROJECT_NAME") << "\",\"index.hhc\"," "\"index.hhk\",\"" << indexName << "\",\"" << - indexName << "\",,,,,0x23520,,0x387e,,,,,,,,0" << endl << endl; + indexName << "\",,,,,0x23520,,0x10387e,,,,,,,,0" << endl << endl; t << "[FILES]" << endl; char *s = indexFiles.first(); diff --git a/src/index.cpp b/src/index.cpp index beb0477..031f01f 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -318,7 +318,7 @@ static bool classHasVisibleChildren(ClassDef *cd) return FALSE; } -void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level) +void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level,FTVHelp* ftv) { if (bcl==0) return; BaseClassListIterator bcli(*bcl); @@ -332,6 +332,8 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level) { startIndexHierarchy(ol,level); Doxygen::indexList.incContentsDepth(); + if (ftv) + ftv->incContentsDepth(); started=TRUE; } //printf("Passed...\n"); @@ -349,11 +351,9 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level) ol.docify(" [external]"); ol.endTypewriter(); } - Doxygen::indexList.addContentsItem(hasChildren, - cd->displayName(), - cd->getReference(), - cd->getOutputFileBase(), - 0); + Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); + if (ftv) + ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); } else { @@ -361,13 +361,15 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level) ol.parseText(cd->name()); ol.endIndexItem(0,0); Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),0,0,0); + if (ftv) + ftv->addContentsItem(hasChildren,cd->displayName(),0,0,0); } if (hasChildren) { //printf("Class %s at %p visited=%d\n",cd->name().data(),cd,cd->visited); bool wasVisited=cd->visited; cd->visited=TRUE; - writeClassTree(ol,cd->subClasses(),wasVisited,level+1); + writeClassTree(ol,cd->subClasses(),wasVisited,level+1,ftv); } } } @@ -375,6 +377,8 @@ void writeClassTree(OutputList &ol,BaseClassList *bcl,bool hideSuper,int level) { endIndexHierarchy(ol,level); Doxygen::indexList.decContentsDepth(); + if (ftv) + ftv->decContentsDepth(); } } @@ -475,7 +479,7 @@ void writeClassTree(ClassSDict *d,int level) //---------------------------------------------------------------------------- -static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started) +static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FTVHelp* ftv) { ClassSDict::Iterator cli(*cl); for (;cli.current(); ++cli) @@ -512,6 +516,8 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started) ol.endTypewriter(); } Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); + if (ftv) + ftv->addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),0); } else { @@ -519,10 +525,12 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started) ol.parseText(cd->displayName()); ol.endIndexItem(0,0); Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),0,0,0); + if (ftv) + ftv->addContentsItem(hasChildren,cd->displayName(),0,0,0); } if (hasChildren) { - writeClassTree(ol,cd->subClasses(),cd->visited,1); + writeClassTree(ol,cd->subClasses(),cd->visited,1,ftv); cd->visited=TRUE; } } @@ -530,19 +538,25 @@ static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started) } } -void writeClassHierarchy(OutputList &ol) +void writeClassHierarchy(OutputList &ol, FTVHelp* ftv) { initClassHierarchy(Doxygen::classSDict); initClassHierarchy(Doxygen::hiddenClasses); - + if (ftv) + { + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Html); + } bool started=FALSE; - writeClassTreeForList(ol,Doxygen::classSDict,started); - writeClassTreeForList(ol,Doxygen::hiddenClasses,started); + writeClassTreeForList(ol,Doxygen::classSDict,started,ftv); + writeClassTreeForList(ol,Doxygen::hiddenClasses,started,ftv); if (started) { endIndexHierarchy(ol,0); Doxygen::indexList.decContentsDepth(); } + if (ftv) + ol.popGeneratorState(); } //---------------------------------------------------------------------------- @@ -612,7 +626,24 @@ void writeHierarchicalIndex(OutputList &ol) } ol.parseText(theTranslator->trClassHierarchyDescription()); ol.endTextBlock(); - writeClassHierarchy(ol); + + FTVHelp* ftv = NULL; + QCString& TreeView=Config_getEnum("GENERATE_TREEVIEW"); + if (TreeView=="HIERARCHIES" || TreeView=="ALL") + ftv = new FTVHelp(false); + + writeClassHierarchy(ol,ftv); + + if (ftv) + { + QString OutStr; + ftv->generateTreeView(&OutStr); + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + ol.writeString(OutStr); + ol.popGeneratorState(); + delete ftv; + } endFile(ol); ol.popGeneratorState(); } @@ -1415,7 +1446,7 @@ static void writeMemberList(OutputList &ol,bool useSections,int page, MemberDef *md; for (mli.toFirst();(md=mli.current());++mli) { - char *sep; + const char *sep; bool isFunc=!md->isObjCMethod() && (md->isFunction() || md->isSlot() || md->isSignal()); QCString name=md->name(); @@ -2349,7 +2380,7 @@ void writeGroupIndexItem(GroupDef *gd,MemberList *ml,const QCString &title) * write groups as hierarchical trees * \author KPW */ -void writeGroupTreeNode(OutputList &ol, GroupDef *gd,int level) +void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* ftv) { bool fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); @@ -2394,12 +2425,17 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,int level) //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count()); Doxygen::indexList.addContentsItem(isDir,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),0); Doxygen::indexList.incContentsDepth(); - + if (ftv) + { + ftv->addContentsItem(isDir,gd->groupTitle(),gd->getReference(),gd->getOutputFileBase(),0); + ftv->incContentsDepth(); + } + //ol.writeListItem(); //ol.startTextLink(gd->getOutputFileBase(),0); //parseText(ol,gd->groupTitle()); //ol.endTextLink(); - + ol.startIndexItem(gd->getReference(),gd->getOutputFileBase()); ol.parseText(gd->groupTitle()); ol.endIndexItem(gd->getReference(),gd->getOutputFileBase()); @@ -2422,11 +2458,10 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,int level) SectionInfo *si=0; if (!pd->name().isEmpty()) si=Doxygen::sectionDict[pd->name()]; Doxygen::indexList.addContentsItem(FALSE, - convertToHtml(pd->title(),TRUE), - gd->getReference(), - gd->getOutputFileBase(), - si ? si->label.data() : 0 - ); + convertToHtml(pd->title(),TRUE), + gd->getReference(), + gd->getOutputFileBase(), + si ? si->label.data() : 0); } // write subgroups @@ -2439,7 +2474,7 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,int level) GroupDef *subgd = 0; for (gli.toFirst();(subgd=gli.current());++gli) { - writeGroupTreeNode(ol,subgd,level+1); + writeGroupTreeNode(ol,subgd,level+1,ftv); } endIndexHierarchy(ol,level+1); } @@ -2538,13 +2573,19 @@ void writeGroupTreeNode(OutputList &ol, GroupDef *gd,int level) } Doxygen::indexList.decContentsDepth(); - + if (ftv) + ftv->decContentsDepth(); //gd->visited=TRUE; } } -void writeGroupHierarchy(OutputList &ol) +void writeGroupHierarchy(OutputList &ol, FTVHelp* ftv) { + if (ftv) + { + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Html); + } startIndexHierarchy(ol,0); if (Config_getBool("SORT_GROUP_NAMES")) Doxygen::groupSDict->sort(); @@ -2552,13 +2593,15 @@ void writeGroupHierarchy(OutputList &ol) GroupDef *gd; for (gli.toFirst();(gd=gli.current());++gli) { - writeGroupTreeNode(ol,gd,0); + writeGroupTreeNode(ol,gd,0,ftv); } endIndexHierarchy(ol,0); + if (ftv) + ol.popGeneratorState(); } //---------------------------------------------------------------------------- -void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) +void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv) { if (level>20) { @@ -2577,6 +2620,11 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count()); Doxygen::indexList.addContentsItem(isDir,dd->shortName(),dd->getReference(),dd->getOutputFileBase(),0); Doxygen::indexList.incContentsDepth(); + if (ftv) + { + ftv->addContentsItem(isDir,dd->shortName(),dd->getReference(),dd->getOutputFileBase(),0); + ftv->incContentsDepth(); + } ol.startIndexItem(dd->getReference(),dd->getOutputFileBase()); ol.parseText(dd->shortName()); @@ -2596,7 +2644,7 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) DirDef *subdd = 0; for (dli.toFirst();(subdd=dli.current());++dli) { - writeDirTreeNode(ol,subdd,level+1); + writeDirTreeNode(ol,subdd,level+1,ftv); } endIndexHierarchy(ol,level+1); } @@ -2617,18 +2665,27 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) } Doxygen::indexList.decContentsDepth(); + if (ftv) + ftv->decContentsDepth(); } -void writeDirHierarchy(OutputList &ol) +void writeDirHierarchy(OutputList &ol, FTVHelp* ftv) { + if (ftv) + { + ol.pushGeneratorState(); + ol.disable(OutputGenerator::Html); + } startIndexHierarchy(ol,0); SDict<DirDef>::Iterator dli(*Doxygen::directories); DirDef *dd; for (dli.toFirst();(dd=dli.current());++dli) { - if (dd->getOuterScope()==Doxygen::globalScope) writeDirTreeNode(ol,dd,0); + if (dd->getOuterScope()==Doxygen::globalScope) writeDirTreeNode(ol,dd,0,ftv); } endIndexHierarchy(ol,0); + if (ftv) + ol.popGeneratorState(); } //---------------------------------------------------------------------------- @@ -2650,11 +2707,26 @@ void writeGroupIndex(OutputList &ol) ol.startTextBlock(); Doxygen::indexList.addContentsItem(TRUE,theTranslator->trModules(),0,"modules",0); Doxygen::indexList.incContentsDepth(); - ol.parseText(theTranslator->trModulesDescription()); ol.endTextBlock(); - writeGroupHierarchy(ol); + FTVHelp* ftv = NULL; + QCString& TreeView=Config_getEnum("GENERATE_TREEVIEW"); + if (TreeView=="HIERARCHIES" || TreeView=="ALL") + ftv = new FTVHelp(false); + + writeGroupHierarchy(ol,ftv); + Doxygen::indexList.decContentsDepth(); + if (ftv) + { + QString OutStr; + ftv->generateTreeView(&OutStr); + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + ol.writeString(OutStr); + ol.popGeneratorState(); + delete ftv; + } endFile(ol); ol.popGeneratorState(); } @@ -2681,8 +2753,23 @@ void writeDirIndex(OutputList &ol) ol.parseText(theTranslator->trDirDescription()); ol.endTextBlock(); - writeDirHierarchy(ol); + FTVHelp* ftv = NULL; + QCString& TreeView=Config_getEnum("GENERATE_TREEVIEW"); + if (TreeView=="HIERARCHIES" || TreeView=="ALL") + ftv = new FTVHelp(false); + writeDirHierarchy(ol,ftv); + + if (ftv) + { + QString OutStr; + ftv->generateTreeView(&OutStr); + ol.pushGeneratorState(); + ol.disableAllBut(OutputGenerator::Html); + ol.writeString(OutStr); + ol.popGeneratorState(); + delete ftv; + } Doxygen::indexList.decContentsDepth(); endFile(ol); ol.popGeneratorState(); @@ -2733,8 +2820,7 @@ void writeIndex(OutputList &ol) title = substitute(Doxygen::mainPage->title(),"%",""); } - QCString indexName="index"; - if (Config_getBool("GENERATE_TREEVIEW")) indexName="main"; + QCString indexName=usingTreeIndex()?"main":"index"; ol.startFile(indexName,0,title); if (Doxygen::mainPage) diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 05d5b72..4dd4e06 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -606,8 +606,7 @@ void LatexGenerator::endIndexSection(IndexSections is) break; case isMainPage: { - QCString indexName="index"; - if (Config_getBool("GENERATE_TREEVIEW")) indexName="main"; + QCString indexName=usingTreeIndex()?"main":"index"; t << "}\n\\label{index}"; if (Config_getBool("PDF_HYPERLINKS")) t << "\\hypertarget{index}{}"; t << "\\input{" << indexName << "}\n"; diff --git a/src/libdoxygen.t b/src/libdoxygen.t index 0ab0b3c..42001de 100644 --- a/src/libdoxygen.t +++ b/src/libdoxygen.t @@ -73,22 +73,22 @@ sub GenerateDep { $(LEX) -PpreYY -t pre.l | $(INCBUFSIZE) >pre.cpp #$ GenerateDep("declinfo.cpp","declinfo.l"); - $(LEX) -PdeclinfoYY -t declinfo.l >declinfo.cpp + $(LEX) -PdeclinfoYY -t declinfo.l | $(INCBUFSIZE) >declinfo.cpp #$ GenerateDep("defargs.cpp","defargs.l"); - $(LEX) -PdefargsYY -t defargs.l >defargs.cpp + $(LEX) -PdefargsYY -t defargs.l | $(INCBUFSIZE) >defargs.cpp #$ GenerateDep("doctokenizer.cpp","doctokenizer.l"); - $(LEX) -PdoctokenizerYY -t doctokenizer.l >doctokenizer.cpp + $(LEX) -PdoctokenizerYY -t doctokenizer.l | $(INCBUFSIZE) >doctokenizer.cpp #$ GenerateDep("commentcnv.cpp","commentcnv.l"); - $(LEX) -PcommentcnvYY -t commentcnv.l >commentcnv.cpp + $(LEX) -PcommentcnvYY -t commentcnv.l | $(INCBUFSIZE) >commentcnv.cpp #$GenerateDep("commentscan.cpp","commentscan.l"); - $(LEX) -PcommentScanYY -t commentscan.l >commentscan.cpp + $(LEX) -PcommentScanYY -t commentscan.l | $(INCBUFSIZE) >commentscan.cpp #$ GenerateDep("ce_lex.cpp","constexp.l","ce_parse.h"); - $(LEX) -PcppExpYY -t constexp.l >ce_lex.cpp + $(LEX) -PcppExpYY -t constexp.l | $(INCBUFSIZE) >ce_lex.cpp #$ GenerateDep("ce_parse.cpp","constexp.y"); $(YACC) -l -p cppExpYY constexp.y -o ce_parse.cpp diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 2972f34..8a5a887 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -833,7 +833,7 @@ bool MemberDef::isLinkableInProject() const //printf("private and invisible!\n"); return FALSE; // hidden due to protection } - if (isStatic() && m_impl->classDef==0 && !extractStatic) + if (m_impl->stat && m_impl->classDef==0 && !extractStatic) { //printf("static and invisible!\n"); return FALSE; // hidden due to staticness diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 25f7a44..a14dfeb 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -320,6 +320,11 @@ void MemberList::writeDeclarations(OutputList &ol, { //printf("----- writeDeclaration() this=%p ----\n",this); countDecMembers(showEnumValues); // count member not in group + Definition *ctx = cd; + if (ctx==0 && nd) ctx = nd; + if (ctx==0 && gd) ctx = gd; + if (ctx==0 && fd) ctx = fd; + if (numDecMembers()==0) return; //printf("%p: MemberList::writeDeclaration(title=`%s',subtitle=`%s')=%d\n", // this,title,subtitle,numDecMembers()); @@ -333,7 +338,7 @@ void MemberList::writeDeclarations(OutputList &ol, { //printf("subtitle=`%s'\n",subtitle); ol.startMemberSubtitle(); - ol.parseDoc("[generated]",-1,0,0,subtitle,FALSE,FALSE); + ol.parseDoc("[generated]",-1,ctx,0,subtitle,FALSE,FALSE); ol.endMemberSubtitle(); } @@ -358,7 +363,7 @@ void MemberList::writeDeclarations(OutputList &ol, { //printf("Member group has docs!\n"); ol.startMemberGroupDocs(); - ol.parseDoc("[generated]",-1,0,0,mg->documentation()+"\n",FALSE,FALSE); + ol.parseDoc("[generated]",-1,ctx,0,mg->documentation()+"\n",FALSE,FALSE); ol.endMemberGroupDocs(); } ol.startMemberGroup(); diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 4ed7c16..da7b062 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -895,7 +895,7 @@ void RTFDocVisitor::visitPre(DocHtmlRow *r) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlRow)}\n"); - uint i,columnWidth=rtf_pageWidth/r->numCells(); + uint i,columnWidth=r->numCells()>0 ? rtf_pageWidth/r->numCells() : 10; m_t << "\\trowd \\trgaph108\\trleft-108" "\\trbrdrt\\brdrs\\brdrw10 " "\\trbrdrl\\brdrs\\brdrw10 " diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index a0d5e31..79e2fec 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -607,7 +607,7 @@ void RTFGenerator::endIndexSection(IndexSections is) t << "{\\tc \\v " << substitute(Doxygen::mainPage->title(),"%","") << "}"<< endl; } t << "{\\field\\fldedit{\\*\\fldinst INCLUDETEXT \""; - if (Config_getBool("GENERATE_TREEVIEW")) t << "main"; else t << "index"; + if (usingTreeIndex()) t << "main"; else t << "index"; t << ".rtf\" \\\\*MERGEFORMAT}{\\fldrslt includedstuff}}\n"; break; //case isPackageIndex: diff --git a/src/scanner.l b/src/scanner.l index 8125b9c..61e8d11 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -170,6 +170,7 @@ static QCString idlAttr; static QCString idlProp; static bool g_lexInit = FALSE; +static bool externC; //----------------------------------------------------------------------------- @@ -902,6 +903,12 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) curlyCount=0; BEGIN( CliPropertyType ); } + else if (insideCS) + { + lineCount() ; + current->mtype = Event; + current->bodyLine = yyLineNr; + } else { REJECT; @@ -3006,8 +3013,8 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) } else { - current->doc.resize(0); - current->brief.resize(0); + //current->doc.resize(0); + //current->brief.resize(0); BEGIN( MemberSpec ) ; } } @@ -4324,7 +4331,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) { current->name += "-p"; } - if ((current->section & Entry::Protocol) || + if ((current->spec & Entry::Protocol) || current->section == Entry::OBJCIMPL_SEC) { unput('{'); // fake start of body @@ -4453,6 +4460,11 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) unput('{'); BEGIN( lastCSConstraint ); } +<CSConstraintType,CSConstraintName>";" { + handleParametersCommentBlocks(current->typeConstr); + unput(';'); + BEGIN( lastCSConstraint ); + } <CSConstraintName>":" { BEGIN( CSConstraintType ); } @@ -4719,6 +4731,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) if (*yytext=='>') { // end of a ObjC protocol list insideProtocolList=FALSE; + unput('{'); // dummy start body } else { @@ -4831,6 +4844,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) <FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>("//"{B}*)?"/**"/[^/*] { removeSlashes=(yytext[1]=='/'); lastDocContext = YY_START; + //printf("Found comment block at %s:%d\n",yyFileName,yyLineNr); if (current_root->section & Entry::SCOPE_MASK) { @@ -4918,9 +4932,14 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) } <FindMembers>"extern"{BN}*"\"C"("++")?"\""{BN}*("{")? { lineCount(); + externC=TRUE; } <FindMembers>"{" { - if (insideCS && + if (externC) + { + externC=FALSE; + } + else if (insideCS && !current->name.isEmpty() && !current->type.isEmpty()) { diff --git a/src/translator_de.h b/src/translator_de.h index 99e4e2d..c3aa248 100644 --- a/src/translator_de.h +++ b/src/translator_de.h @@ -672,8 +672,8 @@ class TranslatorGerman : public Translator case ClassDef::Struct: result+="Struktur"; break; case ClassDef::Union: result+="Varianten"; break; case ClassDef::Interface: result+="Schnittstellen"; break; - case ClassDef::Protocol: result+="Protocol"; break; // translate me! - case ClassDef::Category: result+="Category"; break; // translate me! + case ClassDef::Protocol: result+="Protokoll"; break; + case ClassDef::Category: result+="Kategorie"; break; case ClassDef::Exception: result+="Ausnahmen"; break; } result+="referenz"; @@ -840,8 +840,8 @@ class TranslatorGerman : public Translator case ClassDef::Struct: result+=" Struktur"; break; case ClassDef::Union: result+=" Variante"; break; case ClassDef::Interface: result+=" Schnittstelle"; break; - case ClassDef::Protocol: result+=" Protocol"; break; // translate me! - case ClassDef::Category: result+=" Category"; break; // translate me! + case ClassDef::Protocol: result+="s Protokoll"; break; + case ClassDef::Category: result+=" Kategorie"; break; case ClassDef::Exception: result+=" Ausnahme"; break; } result+=" wurde erzeugt aufgrund der Datei"; diff --git a/src/util.cpp b/src/util.cpp index d2e9593..db5eb08 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3069,8 +3069,8 @@ static QCString getCanonicalTypeForIdentifier( //printf(" >>>> word '%s' => '%s' templSpec=%s ts=%s tSpec=%s isTemplate=%d resolvedType=%s\n", // (word+templSpec).data(), // cd?cd->qualifiedName().data():"<none>", - // templSpec.data(),ts.data(), - // tSpec?tSpec->data():"<null>", + // templSpec.data(),ts.data(), + // tSpec?tSpec->data():"<null>", // cd?cd->isTemplate():FALSE, // resolvedType.data()); @@ -3400,6 +3400,7 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl,bool forceNameOverwr if (srcA->type==dstA->type) { + //printf("1. merging %s:%s <-> %s:%s\n",srcA->type.data(),srcA->name.data(),dstA->type.data(),dstA->name.data()); if (srcA->name.isEmpty() && !dstA->name.isEmpty()) { //printf("type: `%s':=`%s'\n",srcA->type.data(),dstA->type.data()); @@ -3436,7 +3437,9 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl,bool forceNameOverwr } else { - //printf("merging %s:%s <-> %s:%s\n",srcA->type.data(),srcA->name.data(),dstA->type.data(),dstA->name.data()); + //printf("2. merging '%s':'%s' <-> '%s':'%s'\n",srcA->type.data(),srcA->name.data(),dstA->type.data(),dstA->name.data()); + srcA->type=srcA->type.stripWhiteSpace(); + dstA->type=dstA->type.stripWhiteSpace(); if (srcA->type+" "+srcA->name==dstA->type) // "unsigned long:int" <-> "unsigned long int:bla" { srcA->type+=" "+srcA->name; @@ -3833,7 +3836,7 @@ bool getDefs(const QCString &scName,const QCString &memberName, // md->name().data(),args,fd,gd); if ( ((gd && gd->isLinkable()) || (fd && fd->isLinkable())) && - md->getNamespaceDef()==0 + md->getNamespaceDef()==0 && md->isLinkable() ) { //printf(" fd=%p gd=%p args=`%s'\n",fd,gd,args); @@ -3905,7 +3908,6 @@ bool getDefs(const QCString &scName,const QCString &memberName, } if (bmd) md=bmd; } - if (md && !md->isLinkable()) md=0; // ignore things we cannot link to if (md) // found a matching global member { fd=md->getFileDef(); @@ -4469,12 +4471,13 @@ FileDef *findFileDef(const FileNameDict *fnDict,const char *n,bool &ambig) for (fni.toFirst();(fd=fni.current());++fni) { QCString fdStripPath = stripFromIncludePath(fd->getPath()); - if (path.isEmpty() || fdStripPath==pathStripped) + if (path.isEmpty() || fdStripPath.right(pathStripped.length())==pathStripped) { count++; lastMatch=fd; } } + ambig=(count>1); cachedResult->isAmbig = ambig; cachedResult->fileDef = lastMatch; @@ -6593,3 +6596,9 @@ void writeTypeConstraints(OutputList &ol,Definition *d,ArgumentList *al) ol.endConstraintList(); } +bool usingTreeIndex() +{ + QCString& TreeView=Config_getEnum("GENERATE_TREEVIEW"); + return TreeView=="FRAME" || TreeView=="ALL" || TreeView=="YES"; +} + @@ -351,5 +351,7 @@ void writeTypeConstraints(OutputList &ol,Definition *d,ArgumentList *al); QCString convertCharEntitiesToUTF8(const QCString &s); +bool usingTreeIndex(); + #endif |