diff options
56 files changed, 1050 insertions, 713 deletions
@@ -1,7 +1,7 @@ -DOXYGEN Version 1.6.1-20091004 +DOXYGEN Version 1.6.1-20091027 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (04 October 2009) +Dimitri van Heesch (27 October 2009) @@ -1,4 +1,4 @@ -DOXYGEN Version 1.6.1_20091004 +DOXYGEN Version 1.6.1_20091027 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) (04 October 2009) +Dimitri van Heesch (dimitri@stack.nl) (27 October 2009) diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp index a14aa4e..2001687 100644 --- a/addon/doxywizard/doxywizard.cpp +++ b/addon/doxywizard/doxywizard.cpp @@ -85,10 +85,6 @@ MainWindow::MainWindow() m_launchHtml = new QPushButton(tr("Show HTML output")); launchLayout->addWidget(m_launchHtml); -#if 0 - m_launchPdf = new QPushButton(tr("Show PDF output")); - launchLayout->addWidget(m_launchPdf); -#endif launchLayout->addStretch(1); grid->addLayout(launchLayout,1,0); runTabLayout->addLayout(grid); @@ -300,24 +296,12 @@ void MainWindow::loadSettings() { QVariant geometry = m_settings.value(QString::fromAscii("main/geometry"), QVariant::Invalid); QVariant state = m_settings.value(QString::fromAscii("main/state"), QVariant::Invalid); - //QVariant expState = m_settings.value(QString::fromAscii("expert/state"), QVariant::Invalid); - //QVariant expState2 = m_settings.value(QString::fromAscii("expert/state2"), QVariant::Invalid); QVariant wizState = m_settings.value(QString::fromAscii("wizard/state"), QVariant::Invalid); QVariant loadSettings = m_settings.value(QString::fromAscii("wizard/loadsettings"), QVariant::Invalid); - //QVariant workingDir = m_settings.value(QString::fromAscii("main/defdir"), QVariant::Invalid); if (geometry !=QVariant::Invalid) restoreGeometry(geometry.toByteArray()); if (state !=QVariant::Invalid) restoreState (state.toByteArray()); - //if (expState !=QVariant::Invalid) m_expert->restoreState(expState.toByteArray()); - //if (expState2 !=QVariant::Invalid) m_expert->restoreInnerState(expState2.toByteArray()); if (wizState !=QVariant::Invalid) m_wizard->restoreState(wizState.toByteArray()); - //if (workingDir!=QVariant::Invalid) - //{ - // QString dir = workingDir.toString(); - // m_workingDir->setText(dir); - // QDir::setCurrent(dir); - // m_run->setEnabled(!dir.isEmpty()); - //} if (loadSettings!=QVariant::Invalid && loadSettings.toBool()) { m_expert->loadSettings(&m_settings); @@ -337,8 +321,6 @@ void MainWindow::saveSettings() m_settings.setValue(QString::fromAscii("main/geometry"), saveGeometry()); m_settings.setValue(QString::fromAscii("main/state"), saveState()); - //m_settings.setValue(QString::fromAscii("expert/state"), m_expert->saveState()); - //m_settings.setValue(QString::fromAscii("expert/state2"), m_expert->saveInnerState()); m_settings.setValue(QString::fromAscii("wizard/state"), m_wizard->saveState()); } @@ -387,15 +369,19 @@ void MainWindow::runDoxygen() #if defined(Q_OS_MACX) doxygenPath = qApp->applicationDirPath()+QString::fromAscii("/../Resources/"); qDebug() << tr("Doxygen path: ") << doxygenPath; - if ( !QFile(doxygenPath + QString::fromAscii("doxygen")).exists() ) { - // No doygen binary in the resources, if there is a system doxygen binary, use that instead - if ( QFile(QString::fromAscii("/usr/local/bin/doxygen")).exists() ) - doxygenPath = QString::fromAscii("/usr/local/bin/"); - else { - qDebug() << tr("Can't find the doxygen command, make sure it's in your $$PATH"); - doxygenPath = QString::fromAscii(""); - } - } + if ( !QFile(doxygenPath + QString::fromAscii("doxygen")).exists() ) + { + // No doygen binary in the resources, if there is a system doxygen binary, use that instead + if ( QFile(QString::fromAscii("/usr/local/bin/doxygen")).exists() ) + { + doxygenPath = QString::fromAscii("/usr/local/bin/"); + } + else + { + qDebug() << tr("Can't find the doxygen command, make sure it's in your $$PATH"); + doxygenPath = QString::fromAscii(""); + } + } qDebug() << tr("Getting doxygen from: ") << doxygenPath; #endif @@ -423,7 +409,7 @@ void MainWindow::runDoxygen() QTextStream t(m_runProcess); m_expert->writeConfig(t,false); m_runProcess->closeWriteChannel(); - + if (m_runProcess->state() == QProcess::NotRunning) { m_outputLog->append(QString::fromAscii("*** Failed to run doxygen\n")); diff --git a/addon/doxywizard/expert.cpp b/addon/doxywizard/expert.cpp index 7c16c28..9b665ca 100644 --- a/addon/doxywizard/expert.cpp +++ b/addon/doxywizard/expert.cpp @@ -158,7 +158,8 @@ QWidget *Expert::createTopicWidget(QDomElement &elem) child.attribute(SA("id")), child.attribute(SA("defval")), mode, - child.attribute(SA("docs")) + child.attribute(SA("docs")), + child.attribute(SA("abspath")) ); m_options.insert( child.attribute(SA("id")), diff --git a/addon/doxywizard/inputstring.cpp b/addon/doxywizard/inputstring.cpp index 7b0aea0..58ace8b 100644 --- a/addon/doxywizard/inputstring.cpp +++ b/addon/doxywizard/inputstring.cpp @@ -21,8 +21,10 @@ InputString::InputString( QGridLayout *layout,int &row, const QString & id, const QString &s, - StringMode m, const QString &docs ) - : m_default(s), m_sm(m), m_index(0), m_docs(docs), m_id(id) + StringMode m, const QString &docs, + const QString &absPath ) + : m_default(s), m_sm(m), m_index(0), m_docs(docs), m_id(id), + m_absPath(absPath==QString::fromAscii("1")) { m_lab = new HelpLabel(id); if (m==StringFixed) @@ -126,7 +128,7 @@ void InputString::browse() QDir dir(path); if (!MainWindow::instance().configFileName().isEmpty() && dir.exists()) { - fileName = dir.relativeFilePath(fileName); + fileName = m_absPath ? fileName : dir.relativeFilePath(fileName); } setValue(fileName); } @@ -140,10 +142,10 @@ void InputString::browse() QDir dir(path); if (!MainWindow::instance().configFileName().isEmpty() && dir.exists()) { - dirName = dir.relativeFilePath(dirName); + dirName = m_absPath ? dirName : dir.relativeFilePath(dirName); } setValue(dirName); - } + } } } diff --git a/addon/doxywizard/inputstring.h b/addon/doxywizard/inputstring.h index 13efb44..9d69a09 100644 --- a/addon/doxywizard/inputstring.h +++ b/addon/doxywizard/inputstring.h @@ -41,7 +41,8 @@ class InputString : public QObject, public Input InputString( QGridLayout *layout,int &row, const QString &id, const QString &s, StringMode m, - const QString &docs ); + const QString &docs, + const QString &absPath = QString() ); ~InputString(); void addValue(QString s); void setDefault(); @@ -83,6 +84,7 @@ class InputString : public QObject, public Input QVariant m_value; QString m_docs; QString m_id; + bool m_absPath; }; #endif diff --git a/addon/doxywizard/inputstrlist.h b/addon/doxywizard/inputstrlist.h index 912f441..24717a9 100644 --- a/addon/doxywizard/inputstrlist.h +++ b/addon/doxywizard/inputstrlist.h @@ -33,14 +33,14 @@ class InputStrList : public QObject, public Input Q_OBJECT public: - enum ListMode { ListString = 0, - ListFile = 1, - ListDir = 2, - ListFileDir = ListFile | ListDir + enum ListMode { ListString = 0, + ListFile = 1, + ListDir = 2, + ListFileDir = ListFile | ListDir }; - + InputStrList( QGridLayout *layout,int &row, - const QString &id, const QStringList &sl, + const QString &id, const QStringList &sl, ListMode v, const QString &docs); void setValue(const QStringList &sl); @@ -20,7 +20,7 @@ doxygen_version_minor=6 doxygen_version_revision=1 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package. -doxygen_version_mmn=20091004 +doxygen_version_mmn=20091027 bin_dirs=`echo $PATH | sed -e "s/:/ /g"` diff --git a/doc/autolink.doc b/doc/autolink.doc index 96ce3bc..767fb5f 100644 --- a/doc/autolink.doc +++ b/doc/autolink.doc @@ -38,11 +38,12 @@ \section linkclass Links to classes. All words in the documentation that correspond to a documented class and - contain at least one upper case character will automatically be replaced by - a link to the page containing the + contain at least one non-lower case character will automatically be + replaced by a link to the page containing the documentation of the class. If you want to prevent that a word that corresponds to a documented class is replaced by a link you should put a \% in front of the word. + To link to an all lower case symbol, use \ref cmdref "\\ref". \section linkfile Links to files. diff --git a/doc/commands.doc b/doc/commands.doc index 43948a4..b56ebf3 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -176,6 +176,7 @@ documentation: \refitem cmdgt \\\> \refitem cmdhash \\\# \refitem cmdperc \\\% +\refitem cmdquot \\\" \endsecreflist The following subsections provide a list of all commands that are recognized by @@ -224,6 +225,7 @@ Structural indicators \sa page \ref grouping "Grouping", sections \ref cmddefgroup "\\defgroup", \ref cmdingroup "\\ingroup" and \ref cmdweakgroup "\\weakgroup". +<hr> \section cmdcallgraph \\callgraph \addindex \\callgraph @@ -324,7 +326,6 @@ Structural indicators stripped from the full path before it appears in the output. <hr> - \section cmdenum \\enum <name> \addindex \\enum @@ -884,6 +885,7 @@ Section indicators The \\attention command ends when a blank line or some other sectioning command is encountered. +<hr> \section cmdauthor \\author { list of authors } \addindex \\author @@ -1423,6 +1425,7 @@ void memcpy(void *dest, const void *src, size_t n); sectioning command is encountered. See section \ref cmdauthor "\\author" for an example. +<hr> \section cmdxrefitem \\xrefitem <key> "(heading)" "(list title)" {text} \addindex \\xrefitem @@ -1465,6 +1468,7 @@ Commands to create links </h2> \htmlonly </center>\endhtmlonly +<hr> \section cmdaddindex \\addindex (text) \addindex \\addindex @@ -1644,6 +1648,7 @@ Commands for displaying examples </h2> \htmlonly </center>\endhtmlonly +<hr> \section cmddontinclude \\dontinclude <file-name> \addindex \\dontinclude @@ -2453,6 +2458,7 @@ class Receiver This command writes the \> character to the output. This character has to be escaped because it has a special meaning in HTML. +<hr> \section cmdperc \\\% \addindex \\\% @@ -2461,7 +2467,14 @@ class Receiver prevent auto-linking to word that is also a documented class or struct. <hr> +\section cmdquot \\\" + \addindex \\\" + This command writes the \" character to the output. This + character has to be escaped in some cases, because it is used to + prevent auto-linking to word that is also a documented class or struct. + +<hr> \htmlonly <center> \endhtmlonly <h2> \htmlonly --- \endhtmlonly diff --git a/doc/customize.doc b/doc/customize.doc index d840484..40ef398 100644 --- a/doc/customize.doc +++ b/doc/customize.doc @@ -87,6 +87,12 @@ doxygen -l optionally the name of the layout file can be specified, if omitted \c DoxygenLayout.xml will be used. +The next step is to mention the layout file in the config file +\verbatim +LAYOUT_FILE = DoxygenLayout.xml +\endverbatim +The change the layout all you need to do is edit the layout file. + The toplevel structure of the file looks as follows: \verbatim <doxygenlayout version="1.0"> diff --git a/doc/language.doc b/doc/language.doc index 4494aad..3dbd686 100644 --- a/doc/language.doc +++ b/doc/language.doc @@ -134,7 +134,7 @@ when the translator was updated. <td>French</td> <td>Xavier Outhier</td> <td>xouthier at yahoo dot fr</td> - <td>1.5.4</td> + <td>up-to-date</td> </tr> <tr bgcolor="#ffffff"> <td>German</td> @@ -336,7 +336,7 @@ when the translator was updated. \hline Finnish & Antti Laine & {\tt\tiny antti.a.laine@tut.fi} & 1.6.0 \\ \hline - French & Xavier Outhier & {\tt\tiny xouthier@yahoo.fr} & 1.5.4 \\ + French & Xavier Outhier & {\tt\tiny xouthier@yahoo.fr} & up-to-date \\ \hline German & Jens Seidel & {\tt\tiny jensseidel@users.sf.net} & 1.6.0 \\ \hline diff --git a/doc/translator_report.txt b/doc/translator_report.txt index f3f12e0..bca0e8e 100644 --- a/doc/translator_report.txt +++ b/doc/translator_report.txt @@ -10,7 +10,7 @@ Persian, Polish, Portuguese, Romanian, Russian, Serbian, SerbianCyrilic, Slovak, Slovene, Spanish, Swedish, Turkish, Ukrainian, and Vietnamese. -Of them, 5 translators are up-to-date, 33 translators are based on +Of them, 6 translators are up-to-date, 32 translators are based on some adapter class, and 2 are English based. ---------------------------------------------------------------------- @@ -22,6 +22,7 @@ still may be some details listed even for them: TranslatorCzech TranslatorDutch TranslatorEnglish + TranslatorFrench -- The MAX_DOT_GRAPH_HEIGHT found in trLegendDocs() TranslatorKorean TranslatorPolish -- Remove the obsolete methods (never used). @@ -53,7 +54,6 @@ must be implemented to become up-to-date: TranslatorBrazilian 1.6.0 5 methods to implement (2 %) TranslatorAfrikaans 1.6.0 5 methods to implement (2 %) TranslatorGreek 1.5.4 27 methods to implement (12 %) - TranslatorFrench 1.5.4 22 methods to implement (9 %) TranslatorDanish 1.5.4 27 methods to implement (12 %) TranslatorSlovene 1.4.6 29 methods to implement (13 %) TranslatorNorwegian 1.4.6 28 methods to implement (12 %) @@ -288,35 +288,10 @@ TranslatorFinnish (TranslatorAdapter_1_6_0) 5 methods to implement (2 %) virtual QCString trDirRelation(const char * name) -TranslatorFrench (TranslatorAdapter_1_5_4) 22 methods to implement (9 %) +TranslatorFrench (Translator) ---------------- - Implements 199 of the required methods (90 %). - - Missing methods (should be implemented): - - virtual QCString trCompoundMembersDescriptionFortran(bool extractAll) - virtual QCString trGeneratedFromFilesFortran(ClassDef::CompoundType compType, bool single) - virtual QCString trSubprograms() - virtual QCString trModulesListDescription(bool extractAll) - virtual QCString trModulesList() - virtual QCString trTypeConstraints() - virtual QCString trMemberFunctionDocumentationFortran() - virtual QCString trCompoundListDescriptionFortran() - virtual QCString trTypeDocumentation() - virtual QCString trModuleReference(const char * namespaceName) - virtual QCString trModulesMemberDescription(bool extractAll) - virtual QCString trModulesMembers() - virtual QCString trModulesIndex() - virtual QCString trCompoundListFortran() - virtual QCString trDataTypes() - virtual QCString trCompoundIndexFortran() - virtual QCString trSubprogram(bool first_capital, bool singular) - virtual QCString trCompoundReferenceFortran(const char * clName, ClassDef::CompoundType compType, bool isTemplate) - virtual QCString trType(bool first_capital, bool singular) - virtual QCString trModule(bool first_capital, bool singular) - virtual QCString trCompoundMembersFortran() - virtual QCString trSubprogramDocumentation() + Implements 221 of the required methods (100 %). TranslatorGerman (TranslatorAdapter_1_6_0) 5 methods to implement (2 %) diff --git a/qtools/Doxyfile b/qtools/Doxyfile index 21e3bd0..58c8211 100644 --- a/qtools/Doxyfile +++ b/qtools/Doxyfile @@ -139,9 +139,9 @@ GENERATE_CHI = NO CHM_INDEX_ENCODING = BINARY_TOC = NO TOC_EXPAND = NO -GENERATE_QHP = NO +GENERATE_QHP = YES QCH_FILE = -QHP_NAMESPACE = +QHP_NAMESPACE = com.qtools QHP_VIRTUAL_FOLDER = doc QHP_CUST_FILTER_NAME = QHP_CUST_FILTER_ATTRS = diff --git a/qtools/qglobal.h b/qtools/qglobal.h index 5417861..700cb80 100644 --- a/qtools/qglobal.h +++ b/qtools/qglobal.h @@ -86,7 +86,10 @@ # if !defined(MAC_OS_X_VERSION_10_5) # define MAC_OS_X_VERSION_10_5 MAC_OS_X_VERSION_10_4 + 1 # endif -# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5) +# if !defined(MAC_OS_X_VERSION_10_6) +# define MAC_OS_X_VERSION_10_6 MAC_OS_X_VERSION_10_5 + 1 +# endif +# if (MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_6) # error "This version of Mac OS X is unsupported" # endif #elif defined(MSDOS) || defined(_MSDOS) || defined(__MSDOS__) diff --git a/src/classdef.cpp b/src/classdef.cpp index 73bb09c..8003fe0 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1423,6 +1423,8 @@ void ClassDef::writeDocumentation(OutputList &ol) ol.popGeneratorState(); } + Doxygen::indexList.addIndexItem(this,0); + if (!Config_getString("GENERATE_TAGFILE").isEmpty()) { Doxygen::tagFile << " <compound kind=\"" << compoundTypeString(); diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp index 4dc385d..0ce2ca2 100644 --- a/src/cmdmapper.cpp +++ b/src/cmdmapper.cpp @@ -102,6 +102,7 @@ CommandMap cmdMap[] = { "$", CMD_DOLLAR }, { "#", CMD_HASH }, { "%", CMD_PERCENT }, + { "\"", CMD_QUOTE }, { "_internalref", CMD_INTERNALREF }, { "dot", CMD_DOT }, { "msc", CMD_MSC }, diff --git a/src/cmdmapper.h b/src/cmdmapper.h index 65451dc..6fd651f 100644 --- a/src/cmdmapper.h +++ b/src/cmdmapper.h @@ -112,7 +112,8 @@ enum CommandType CMD_INHERITDOC = 78, CMD_TPARAM = 79 | SIMPLESECT_BIT, CMD_COPYBRIEF = 80, - CMD_COPYDETAILS = 81 + CMD_COPYDETAILS = 81, + CMD_QUOTE = 82 }; enum HtmlTagType @@ -525,9 +525,10 @@ static void startCodeLine() static void endFontClass(); + static void endCodeLine() { - if (g_currentFontClass) { g_code->endFontClass(); } + endFontClass(); g_code->endCodeLine(); } diff --git a/src/commentscan.h b/src/commentscan.h index d01bea9..8c4f0ab 100644 --- a/src/commentscan.h +++ b/src/commentscan.h @@ -37,7 +37,8 @@ class ParserInterface; * Note that leading *'s are already stripped from the comment block. * @param[in] fileName The name of the file in which the comment is found. * Mainly used for producing warnings. - * @param[in] lineNr The line number at which the comment block was found. + * @param[in,out] lineNr The line number at which the comment block was found. + * When the function returns it will be set to the last line parsed. * @param[in] isBrief TRUE iff this comment block represents a brief description. * @param[in] isJavaDocStyle TRUE iff this comment block is in "JavaDoc" style. * This means that it starts as a brief description until the end of @@ -62,7 +63,7 @@ bool parseCommentBlock(ParserInterface *parser, Entry *curEntry, const QCString &comment, const QCString &fileName, - int lineNr, + int &lineNr, bool isBrief, bool isJavaDocStyle, bool isInbody, diff --git a/src/commentscan.l b/src/commentscan.l index d7d064d..8d0e340 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -451,12 +451,6 @@ static bool makeStructuralIndicator(Entry::Sections s) { if (!getDocSectionName(current->section).isEmpty()) { - //warn(yyFileName,yyLineNr, - // "Warning: found a structural command %s for a section already " - // "marked with structural command %s. Ignoring the latter command.", - // getDocSectionName(s).data(), - // getDocSectionName(current->section).data() - // ); return TRUE; } else @@ -2005,7 +1999,10 @@ static bool handlePage(const QCString &) static bool handleMainpage(const QCString &) { bool stop=makeStructuralIndicator(Entry::MAINPAGEDOC_SEC); - if (!stop) current->name = "mainpage"; + if (!stop) + { + current->name = "mainpage"; + } BEGIN( PageDocArg2 ); return stop; } @@ -2013,7 +2010,10 @@ static bool handleMainpage(const QCString &) static bool handleFile(const QCString &) { bool stop=makeStructuralIndicator(Entry::FILEDOC_SEC); - if (!stop) current->name = yyFileName; + if (!stop) + { + current->name = yyFileName; + } BEGIN( FileDocArg1 ); return stop; } @@ -2372,7 +2372,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, /* in */ Entry *curEntry, /* in */ const QCString &comment, /* in */ const QCString &fileName, - /* in */ int lineNr, + /* in,out */ int &lineNr, /* in */ bool isBrief, /* in */ bool isAutoBriefOn, /* in */ bool isInbody, @@ -2456,8 +2456,16 @@ bool parseCommentBlock(/* in */ ParserInterface *parser, newEntryNeeded = needNewEntry; + // if we did not proceed during this call, it does not make + // sence to continue, since we get stuck. See bug 567346 for situations + // were this happens + if (parseMore && position==inputPosition) parseMore=FALSE; + if (parseMore) position=inputPosition; else position=0; + lineNr = yyLineNr; + //printf("position=%d parseMore=%d\n",position,parseMore); + return parseMore; } diff --git a/src/config.l b/src/config.l index df07204..5e83dff 100644 --- a/src/config.l +++ b/src/config.l @@ -1383,18 +1383,6 @@ void Config::check() Config_getBool("GENERATE_QHP")=qhp; } - // check QCH creation requirements - if (!Config_getString("QHG_LOCATION").isEmpty() && - !Config_getBool("GENERATE_QHP")) - { - config_err("Warning: Specifying QHG_LOCATION requires GENERATE_QHP=YES.\n"); - } - if (!Config_getString("QCH_FILE").isEmpty() && - Config_getString("QHG_LOCATION").isEmpty()) - { - config_err("Warning: Specifying QCH_FILE requires QHG_LOCATION to be set.\n"); - } - if (Config_getBool("OPTIMIZE_OUTPUT_JAVA") && Config_getBool("INLINE_INFO")) { // don't show inline info for Java output, since Java has no inline diff --git a/src/config.xml b/src/config.xml index 8395f54..677c02b 100644 --- a/src/config.xml +++ b/src/config.xml @@ -816,7 +816,7 @@ If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can be used to specify the location (absolute path including file name) of the HTML help compiler (hhc.exe). If non-empty doxygen will try to run the HTML help compiler on the generated index.hhp. -' defval='' depends='GENERATE_HTMLHELP'/> +' defval='' depends='GENERATE_HTMLHELP' abspath='1'/> <option type='bool' id='GENERATE_CHI' docs=' If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag controls if a separate .chi index file is generated (YES) or that diff --git a/src/dbusxmlscanner.cpp b/src/dbusxmlscanner.cpp index 514039f..9d6bfe5 100644 --- a/src/dbusxmlscanner.cpp +++ b/src/dbusxmlscanner.cpp @@ -478,10 +478,12 @@ public: bool needs_entry(false); bool brief(false); Protection prot(Public); + int lineNr = lineNumber(); while (parseCommentBlock(m_parser, m_currentEntry, - text, m_fileName.utf8().data(), lineNumber(), + text, m_fileName.utf8().data(), + lineNr, brief, m_currentComment->isJavaStyle, false, prot, diff --git a/src/definition.cpp b/src/definition.cpp index 32e7d64..fb20434 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -198,7 +198,7 @@ static bool matchExcludedSymbols(const char *name) void Definition::addToMap(const char *name,Definition *d) { - static bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); + bool vhdlOpt = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); QCString symbolName = name; int index=computeQualifiedIndex(symbolName); if (!vhdlOpt && index!=-1) symbolName=symbolName.mid(index+2); @@ -383,8 +383,8 @@ bool Definition::_docsAlreadyAdded(const QCString &doc) } void Definition::_setDocumentation(const char *d,const char *docFile,int docLine, - bool stripWhiteSpace,bool atTop) -{ + bool stripWhiteSpace,bool atTop) +{ if (d==0) return; //printf("Definition::setDocumentation(%s,%s,%d,%d)\n",d,docFile,docLine,stripWhiteSpace); QCString doc = d; @@ -405,21 +405,26 @@ void Definition::_setDocumentation(const char *d,const char *docFile,int docLine } if (m_impl->details->doc.isEmpty()) // fresh detailed description { - m_impl->details->doc = doc; + m_impl->details->doc = doc; } else if (atTop) // another detailed description, append it to the start { - m_impl->details->doc = doc+"\n\n"+m_impl->details->doc; + m_impl->details->doc = doc+"\n\n"+m_impl->details->doc; } else // another detailed description, append it to the end { - m_impl->details->doc += "\n\n"+doc; + m_impl->details->doc += "\n\n"+doc; } if (docLine!=-1) // store location if valid { m_impl->details->file = docFile; m_impl->details->line = docLine; } + else + { + m_impl->details->file = docFile; + m_impl->details->line = 1; + } } } diff --git a/src/docparser.cpp b/src/docparser.cpp index 3817d02..3d071de 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -69,6 +69,7 @@ static const char *sectionLevelToName[] = //--------------------------------------------------------------------------- // Parser state: global variables during a call to validatingParseDoc +static Definition * g_scope; static QString g_context; static bool g_inSeeBlock; static bool g_insideHtmlLink; @@ -95,6 +96,7 @@ static uint g_includeFileLength; // parser's context to store all global variables struct DocParserContext { + Definition *scope; QString context; bool inSeeBlock; bool insideHtmlLink; @@ -133,6 +135,7 @@ static void docParserPushContext(bool saveParamInfo=TRUE) doctokenizerYYpushContext(); DocParserContext *ctx = new DocParserContext; + ctx->scope = g_scope; ctx->context = g_context; ctx->inSeeBlock = g_inSeeBlock; ctx->insideHtmlLink = g_insideHtmlLink; @@ -169,6 +172,7 @@ static void docParserPushContext(bool saveParamInfo=TRUE) static void docParserPopContext(bool keepParamInfo=FALSE) { DocParserContext *ctx = g_parserStack.pop(); + g_scope = ctx->scope; g_context = ctx->context; g_inSeeBlock = ctx->inSeeBlock; g_insideHtmlLink = ctx->insideHtmlLink; @@ -1125,6 +1129,9 @@ reparsetoken: case CMD_PERCENT: children.append(new DocSymbol(parent,DocSymbol::Percent)); break; + case CMD_QUOTE: + children.append(new DocSymbol(parent,DocSymbol::Quot)); + break; case CMD_EMPHASIS: { children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Italic,TRUE)); @@ -1776,6 +1783,7 @@ void DocCopy::parse() // g_hasParamCommand,g_hasReturnCommand,g_paramsFound.count()); docParserPushContext(FALSE); + g_scope = def; if (def->definitionType()==Definition::TypeMember && def->getOuterScope()) { g_context=def->getOuterScope()->name(); @@ -2848,6 +2856,7 @@ int DocIndexEntry::parse() case CMD_DOLLAR: m_entry+='$'; break; case CMD_HASH: m_entry+='#'; break; case CMD_PERCENT: m_entry+='%'; break; + case CMD_QUOTE: m_entry+='"'; break; default: warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected command %s found as argument of \\addindex", g_token->name.data()); @@ -2862,6 +2871,7 @@ int DocIndexEntry::parse() } if (tok!=0) retval=tok; doctokenizerYYsetStatePara(); + m_entry = m_entry.stripWhiteSpace(); endindexentry: DBG(("DocIndexEntry::parse() end retval=%x\n",retval)); DocNode *n=g_nodeStack.pop(); @@ -4489,7 +4499,8 @@ void DocPara::handleInheritDoc() MemberDef *thisMd = g_memberDef; //printf("{InheritDocs:%s=>%s}\n",g_memberDef->qualifiedName().data(),reMd->qualifiedName().data()); docParserPushContext(); - g_context=reMd->getOuterScope()->name(); + g_scope=reMd->getOuterScope(); + g_context=g_scope->name(); g_memberDef=reMd; g_styleStack.clear(); g_nodeStack.clear(); @@ -4556,6 +4567,9 @@ int DocPara::handleCommand(const QString &cmdName) case CMD_PERCENT: m_children.append(new DocSymbol(this,DocSymbol::Percent)); break; + case CMD_QUOTE: + m_children.append(new DocSymbol(this,DocSymbol::Quot)); + break; case CMD_SA: g_inSeeBlock=TRUE; retval = handleSimpleSection(DocSimpleSect::See); @@ -4620,19 +4634,19 @@ int DocPara::handleCommand(const QString &cmdName) case CMD_SUBSECTION: { handleSection(cmdName); - retval = RetVal_Subsection; + retval = RetVal_Subsection; } break; case CMD_SUBSUBSECTION: { handleSection(cmdName); - retval = RetVal_Subsubsection; + retval = RetVal_Subsubsection; } break; case CMD_PARAGRAPH: { handleSection(cmdName); - retval = RetVal_Paragraph; + retval = RetVal_Paragraph; } break; case CMD_STARTCODE: @@ -4740,33 +4754,35 @@ int DocPara::handleCommand(const QString &cmdName) break; case CMD_ANCHOR: { - int tok=doctokenizerYYlex(); - if (tok!=TK_WHITESPACE) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", - cmdName.data()); - break; - } - tok=doctokenizerYYlex(); - if (tok==0) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " - "argument of command %s",cmdName.data()); - break; - } - else if (tok!=TK_WORD && tok!=TK_LNKWORD) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", - tokToString(tok),cmdName.data()); - break; - } + int tok=doctokenizerYYlex(); + if (tok!=TK_WHITESPACE) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + cmdName.data()); + break; + } + tok=doctokenizerYYlex(); + if (tok==0) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " + "argument of command %s",cmdName.data()); + break; + } + else if (tok!=TK_WORD && tok!=TK_LNKWORD) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + tokToString(tok),cmdName.data()); + break; + } DocAnchor *anchor = new DocAnchor(this,g_token->name,FALSE); m_children.append(anchor); } break; case CMD_ADDINDEX: { - DocIndexEntry *ie = new DocIndexEntry(this); + DocIndexEntry *ie = new DocIndexEntry(this, + g_scope!=Doxygen::globalScope?g_scope:0, + g_memberDef); m_children.append(ie); retval = ie->parse(); } @@ -4778,26 +4794,26 @@ int DocPara::handleCommand(const QString &cmdName) case CMD_COPYBRIEF: // fall through case CMD_COPYDETAILS: { - int tok=doctokenizerYYlex(); - if (tok!=TK_WHITESPACE) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", - cmdName.data()); - break; - } - tok=doctokenizerYYlex(); - if (tok==0) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " - "argument of command %s\n", cmdName.data()); - break; - } - else if (tok!=TK_WORD && tok!=TK_LNKWORD) - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", - tokToString(tok),cmdName.data()); - break; - } + int tok=doctokenizerYYlex(); + if (tok!=TK_WHITESPACE) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: expected whitespace after %s command", + cmdName.data()); + break; + } + tok=doctokenizerYYlex(); + if (tok==0) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected end of comment block while parsing the " + "argument of command %s\n", cmdName.data()); + break; + } + else if (tok!=TK_WORD && tok!=TK_LNKWORD) + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unexpected token %s as the argument of %s", + tokToString(tok),cmdName.data()); + break; + } DocCopy *cpy = new DocCopy(this,g_token->name, cmdId==CMD_COPYDOC || cmdId==CMD_COPYBRIEF, cmdId==CMD_COPYDOC || cmdId==CMD_COPYDETAILS); @@ -5102,7 +5118,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag { QString paramName; if (findAttribute(tagHtmlAttribs,"name",¶mName)) - { + { retval = handleParamSection(paramName, tagId==XML_PARAM ? DocParamSect::Param : DocParamSect::TemplateParam, TRUE); @@ -5135,7 +5151,7 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag { QString exceptName; if (findAttribute(tagHtmlAttribs,"cref",&exceptName)) - { + { retval = handleParamSection(exceptName,DocParamSect::Exception,TRUE); } else @@ -5213,8 +5229,8 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag { QString cref; if (findAttribute(tagHtmlAttribs,"cref",&cref)) - { - // Look for an existing "see" section + { + // Look for an existing "see" section DocSimpleSect *ss=0; QListIterator<DocNode> cli(m_children); DocNode *n; @@ -5225,15 +5241,15 @@ int DocPara::handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tag ss = (DocSimpleSect *)n; } } - + if (!ss) // start new section { ss=new DocSimpleSect(this,DocSimpleSect::See); m_children.append(ss); } - + ss->appendLinkWord(cref); - retval = RetVal_OK; + retval = RetVal_OK; } else { @@ -5472,21 +5488,21 @@ reparsetoken: DBG(("\n")); switch(tok) { - case TK_WORD: - m_children.append(new DocWord(this,g_token->name)); - break; - case TK_LNKWORD: + case TK_WORD: + m_children.append(new DocWord(this,g_token->name)); + break; + case TK_LNKWORD: handleLinkedWord(this,m_children); - break; + break; case TK_URL: m_children.append(new DocURL(this,g_token->name,g_token->isEMailAddr)); break; - case TK_WHITESPACE: + case TK_WHITESPACE: { // prevent leading whitespace and collapse multiple whitespace areas - DocNode::Kind k; + DocNode::Kind k; if (insidePRE(this) || // all whitespace is relevant - ( + ( // remove leading whitespace !m_children.isEmpty() && // and whitespace after certain constructs @@ -5506,51 +5522,52 @@ reparsetoken: m_children.append(new DocWhiteSpace(this,g_token->chars)); } } - break; - case TK_LISTITEM: - { - DBG(("found list item at %d parent=%d\n",g_token->indent,parent()->kind())); - DocNode *n=parent(); - while (n && n->kind()!=DocNode::Kind_AutoList) n=n->parent(); - if (n) // we found an auto list up in the hierarchy - { - DocAutoList *al = (DocAutoList *)n; - DBG(("previous list item at %d\n",al->indent())); - if (al->indent()>=g_token->indent) - // new item at the same or lower indent level - { - retval=TK_LISTITEM; - goto endparagraph; - } - } + break; + case TK_LISTITEM: + { + DBG(("found list item at %d parent=%d\n",g_token->indent,parent()->kind())); + DocNode *n=parent(); + while (n && n->kind()!=DocNode::Kind_AutoList) n=n->parent(); + if (n) // we found an auto list up in the hierarchy + { + DocAutoList *al = (DocAutoList *)n; + DBG(("previous list item at %d\n",al->indent())); + if (al->indent()>=g_token->indent) + // new item at the same or lower indent level + { + retval=TK_LISTITEM; + goto endparagraph; + } + } // determine list depth int depth = 0; n=parent(); - while(n) { + while(n) + { if(n->kind() == DocNode::Kind_AutoList) ++depth; n=n->parent(); } - // first item or sub list => create new list - DocAutoList *al=0; - do - { - al = new DocAutoList(this,g_token->indent,g_token->isEnumList, - depth); - m_children.append(al); - retval = al->parse(); - } while (retval==TK_LISTITEM && // new list - al->indent()==g_token->indent // at same indent level - ); - - // check the return value - if (retval==RetVal_SimpleSec) // auto list ended due to simple section command - { - // Reparse the token that ended the section at this level, - // so a new simple section will be started at this level. - // This is the same as unputting the last read token and continuing. - g_token->name = g_token->simpleSectName; + // first item or sub list => create new list + DocAutoList *al=0; + do + { + al = new DocAutoList(this,g_token->indent,g_token->isEnumList, + depth); + m_children.append(al); + retval = al->parse(); + } while (retval==TK_LISTITEM && // new list + al->indent()==g_token->indent // at same indent level + ); + + // check the return value + if (retval==RetVal_SimpleSec) // auto list ended due to simple section command + { + // Reparse the token that ended the section at this level, + // so a new simple section will be started at this level. + // This is the same as unputting the last read token and continuing. + g_token->name = g_token->simpleSectName; if (g_token->name.left(4)=="rcs:") // RCS section { g_token->name = g_token->name.mid(4); @@ -5559,97 +5576,97 @@ reparsetoken: } else // other section { - tok = TK_COMMAND; + tok = TK_COMMAND; } - DBG(("reparsing command %s\n",g_token->name.data())); - goto reparsetoken; - } - else if (retval==TK_ENDLIST) - { - if (al->indent()>g_token->indent) // end list - { - goto endparagraph; - } - else // continue with current paragraph - { - } - } - else // paragraph ended due to TK_NEWPARA, TK_LISTITEM, or EOF - { - goto endparagraph; - } - } - break; + DBG(("reparsing command %s\n",g_token->name.data())); + goto reparsetoken; + } + else if (retval==TK_ENDLIST) + { + if (al->indent()>g_token->indent) // end list + { + goto endparagraph; + } + else // continue with current paragraph + { + } + } + else // paragraph ended due to TK_NEWPARA, TK_LISTITEM, or EOF + { + goto endparagraph; + } + } + break; case TK_ENDLIST: - DBG(("Found end of list inside of paragraph at line %d\n",doctokenizerYYlineno)); - if (parent()->kind()==DocNode::Kind_AutoListItem) - { - ASSERT(parent()->parent()->kind()==DocNode::Kind_AutoList); - DocAutoList *al = (DocAutoList *)parent()->parent(); - if (al->indent()>=g_token->indent) - { - // end of list marker ends this paragraph - retval=TK_ENDLIST; - goto endparagraph; - } - else - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found " - "has invalid indent level"); - } - } - else - { - warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found without any preceding " - "list items"); - } - break; + DBG(("Found end of list inside of paragraph at line %d\n",doctokenizerYYlineno)); + if (parent()->kind()==DocNode::Kind_AutoListItem) + { + ASSERT(parent()->parent()->kind()==DocNode::Kind_AutoList); + DocAutoList *al = (DocAutoList *)parent()->parent(); + if (al->indent()>=g_token->indent) + { + // end of list marker ends this paragraph + retval=TK_ENDLIST; + goto endparagraph; + } + else + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found " + "has invalid indent level"); + } + } + else + { + warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: End of list marker found without any preceding " + "list items"); + } + break; case TK_COMMAND: - { - // see if we have to start a simple section - int cmd = Mappers::cmdMapper->map(g_token->name); - DocNode *n=parent(); - while (n && - n->kind()!=DocNode::Kind_SimpleSect && - n->kind()!=DocNode::Kind_ParamSect - ) + { + // see if we have to start a simple section + int cmd = Mappers::cmdMapper->map(g_token->name); + DocNode *n=parent(); + while (n && + n->kind()!=DocNode::Kind_SimpleSect && + n->kind()!=DocNode::Kind_ParamSect + ) { n=n->parent(); } - if (cmd&SIMPLESECT_BIT) - { - if (n) // already in a simple section - { - // simple section cannot start in this paragraph, need - // to unwind the stack and remember the command. - g_token->simpleSectName = g_token->name.copy(); - retval=RetVal_SimpleSec; - goto endparagraph; - } - } - // see if we are in a simple list - n=parent(); - while (n && n->kind()!=DocNode::Kind_SimpleListItem) n=n->parent(); - if (n) - { - if (cmd==CMD_LI) - { - retval=RetVal_ListItem; - goto endparagraph; - } - } - - // handle the command - retval=handleCommand(g_token->name.copy()); + if (cmd&SIMPLESECT_BIT) + { + if (n) // already in a simple section + { + // simple section cannot start in this paragraph, need + // to unwind the stack and remember the command. + g_token->simpleSectName = g_token->name.copy(); + retval=RetVal_SimpleSec; + goto endparagraph; + } + } + // see if we are in a simple list + n=parent(); + while (n && n->kind()!=DocNode::Kind_SimpleListItem) n=n->parent(); + if (n) + { + if (cmd==CMD_LI) + { + retval=RetVal_ListItem; + goto endparagraph; + } + } + + // handle the command + retval=handleCommand(g_token->name.copy()); DBG(("handleCommand returns %x\n",retval)); - // check the return value - if (retval==RetVal_SimpleSec) - { - // Reparse the token that ended the section at this level, - // so a new simple section will be started at this level. - // This is the same as unputting the last read token and continuing. - g_token->name = g_token->simpleSectName; + // check the return value + if (retval==RetVal_SimpleSec) + { + // Reparse the token that ended the section at this level, + // so a new simple section will be started at this level. + // This is the same as unputting the last read token and continuing. + g_token->name = g_token->simpleSectName; if (g_token->name.left(4)=="rcs:") // RCS section { g_token->name = g_token->name.mid(4); @@ -5658,29 +5675,29 @@ reparsetoken: } else // other section { - tok = TK_COMMAND; + tok = TK_COMMAND; } - DBG(("reparsing command %s\n",g_token->name.data())); - goto reparsetoken; - } - else if (retval==RetVal_OK) - { - // the command ended normally, keep scanning for new tokens. - retval = 0; - } + DBG(("reparsing command %s\n",g_token->name.data())); + goto reparsetoken; + } + else if (retval==RetVal_OK) + { + // the command ended normally, keep scanning for new tokens. + retval = 0; + } else if (retval>0 && retval<RetVal_OK) { // the command ended with a new command, reparse this token tok = retval; goto reparsetoken; } - else // end of file, end of paragraph, start or end of section - // or some auto list marker - { - goto endparagraph; - } - } - break; + else // end of file, end of paragraph, start or end of section + // or some auto list marker + { + goto endparagraph; + } + } + break; case TK_HTMLTAG: { if (!g_token->endTag) // found a start tag @@ -5693,7 +5710,7 @@ reparsetoken: } if (retval==RetVal_OK) { - // the command ended normally, keep scanner for new tokens. + // the command ended normally, keep scanner for new tokens. retval = 0; } else @@ -5701,7 +5718,7 @@ reparsetoken: goto endparagraph; } } - break; + break; case TK_SYMBOL: { char letter='\0'; @@ -5718,29 +5735,29 @@ reparsetoken: break; } case TK_NEWPARA: - retval=TK_NEWPARA; - goto endparagraph; + retval=TK_NEWPARA; + goto endparagraph; case TK_RCSTAG: { - DocNode *n=parent(); - while (n && - n->kind()!=DocNode::Kind_SimpleSect && - n->kind()!=DocNode::Kind_ParamSect - ) + DocNode *n=parent(); + while (n && + n->kind()!=DocNode::Kind_SimpleSect && + n->kind()!=DocNode::Kind_ParamSect + ) { n=n->parent(); } - if (n) // already in a simple section - { - // simple section cannot start in this paragraph, need - // to unwind the stack and remember the command. - g_token->simpleSectName = "rcs:"+g_token->name; + if (n) // already in a simple section + { + // simple section cannot start in this paragraph, need + // to unwind the stack and remember the command. + g_token->simpleSectName = "rcs:"+g_token->name; g_token->simpleSectText = g_token->text; - retval=RetVal_SimpleSec; - goto endparagraph; - } + retval=RetVal_SimpleSec; + goto endparagraph; + } - // see if we are in a simple list + // see if we are in a simple list DocSimpleSect *ss=new DocSimpleSect(this,DocSimpleSect::Rcs); m_children.append(ss); ss->parseRcs(); @@ -5958,6 +5975,9 @@ void DocText::parse() case CMD_PERCENT: m_children.append(new DocSymbol(this,DocSymbol::Percent)); break; + case CMD_QUOTE: + m_children.append(new DocSymbol(this,DocSymbol::Quot)); + break; default: warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: Unexpected command `%s' found", g_token->name.data()); @@ -6099,6 +6119,7 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, { g_context = ""; } + g_scope = ctx; //printf("g_context=%s\n",g_context.data()); #if 0 // needed for PHP based search engine, now obsolete diff --git a/src/docparser.h b/src/docparser.h index bb867b8..433aea9 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -324,10 +324,10 @@ class DocStyleChange : public DocNode class DocSymbol : public DocNode { public: - enum SymType { Unknown=0, BSlash,At,Less,Greater,Amp,Dollar,Hash,Percent, - Copy, Tm, Reg, Apos, Quot, Uml, Acute, Grave, Circ, Tilde, - Szlig, Cedil, Ring, Nbsp, Slash, Lsquo, Rsquo, Ldquo, Rdquo, - Ndash, Mdash, Aelig, AElig + enum SymType { Unknown=0, BSlash, At, Less, Greater, Amp, Dollar, Hash, + Percent, Copy, Tm, Reg, Apos, Quot, Uml, Acute, + Grave, Circ, Tilde, Szlig, Cedil, Ring, Nbsp, Slash, + Lsquo, Rsquo, Ldquo, Rdquo, Ndash, Mdash, Aelig, AElig }; DocSymbol(DocNode *parent,SymType s,char letter='\0') : m_parent(parent), m_symbol(s), m_letter(letter) {} @@ -488,16 +488,21 @@ class DocFormula : public DocNode class DocIndexEntry : public DocNode { public: - DocIndexEntry(DocNode *parent) : m_parent(parent) { } + DocIndexEntry(DocNode *parent,Definition *scope,MemberDef *md) + : m_parent(parent), m_scope(scope), m_member(md) { } Kind kind() const { return Kind_IndexEntry; } int parse(); DocNode *parent() const { return m_parent; } - void accept(DocVisitor *v) { v->visit(this); } - QString entry() { return m_entry; } + Definition *scope() const { return m_scope; } + MemberDef *member() const { return m_member; } + QString entry() const { return m_entry; } + void accept(DocVisitor *v) { v->visit(this); } private: - DocNode *m_parent; - QString m_entry; + DocNode *m_parent; + QString m_entry; + Definition *m_scope; + MemberDef *m_member; }; //----------------------------------------------------------------------- diff --git a/src/docsets.cpp b/src/docsets.cpp index f2bda2d..1de4e85 100644 --- a/src/docsets.cpp +++ b/src/docsets.cpp @@ -61,7 +61,7 @@ void DocSets::initialize() "DOCSET_CONTENTS=$(DOCSET_NAME)/Contents\n" "DOCSET_RESOURCES=$(DOCSET_CONTENTS)/Resources\n" "DOCSET_DOCUMENTS=$(DOCSET_RESOURCES)/Documents\n" - "DOCSET_INSTALL=~/Library/Developer/Shared/Documentation/DocSets\n" + "DESTDIR=~/Library/Developer/Shared/Documentation/DocSets\n" "XCODE_INSTALL=$(shell xcode-select -print-path)\n" "\n" "all: docset\n" @@ -85,11 +85,11 @@ void DocSets::initialize() "\trm -f $(DOCSET_RESOURCES)/Tokens.xml\n" "\n" "install: docset\n" - "\tmkdir -p $(DOCSET_INSTALL)\n" - "\tcp -R $(DOCSET_NAME) $(DOCSET_INSTALL)\n" + "\tmkdir -p $(DESTDIR)\n" + "\tcp -R $(DOCSET_NAME) $(DESTDIR)\n" "\n" "uninstall:\n" - "\trm -rf $(DOCSET_INSTALL)\n" + "\trm -rf $(DESTDIR)/$(DOCSET_NAME)\n" "\n" "always:\n"; } @@ -227,15 +227,28 @@ void DocSets::addContentsItem(bool isDir, } } -void DocSets::addIndexItem(const char *, const char *, - const char *, const char *, - const char *,const MemberDef *md) +void DocSets::addIndexItem(Definition *context,MemberDef *md, + const char *anchor,const char *word) { - if (!md->isLinkable()) return; // internal symbol + (void)anchor; + (void)word; + if (md==0 || context==0) return; // TODO: also index non members... - ClassDef *cd = md->getClassDef(); - NamespaceDef *nd = md->getNamespaceDef(); - FileDef *fd = md->getFileDef(); + FileDef *fd = 0; + ClassDef *cd = 0; + NamespaceDef *nd = 0; + + if (md) + { + fd = md->getFileDef(); + cd = md->getClassDef(); + nd = md->getNamespaceDef(); + if (!md->isLinkable()) return; // internal symbol + } + + QCString scope; + QCString type; + QCString decl; // determine language QCString lang; @@ -246,13 +259,13 @@ void DocSets::addIndexItem(const char *, const char *, case SrcLangExt_Cpp: case SrcLangExt_ObjC: { - if (md->isObjCMethod() || md->isObjCProperty()) + if (md && (md->isObjCMethod() || md->isObjCProperty())) lang="occ"; // Objective C/C++ else if (fd && fd->name().right(2).lower()==".c") lang="c"; // Plain C else if (cd==0 && nd==0) lang="c"; // Plain C symbol outside any class or namespace - else + else lang="cpp"; // C++ } break; @@ -268,107 +281,133 @@ void DocSets::addIndexItem(const char *, const char *, case SrcLangExt_XML: lang="xml"; break; // DBUS XML } - // determine scope - QCString scope; - QCString type; - QCString decl; - Definition *d = 0; - if (fd && fd->isLinkable() && m_scopes.find(fd->getOutputFileBase())==0) + if (md) { - writeToken(m_tts,fd,"file",lang,0,0,0); - m_scopes.append(fd->getOutputFileBase(),(void*)0x8); + if (!md->isLinkable()) return; // internal symbol + if (context==0) + { + if (md->getGroupDef()) + context = md->getGroupDef(); + else if (md->getFileDef()) + context = md->getFileDef(); + if (context==0) return; // should not happen + + switch (md->memberType()) + { + case MemberDef::Define: + type="macro"; break; + case MemberDef::Function: + if (cd && (cd->compoundType()==ClassDef::Interface || + cd->compoundType()==ClassDef::Class)) + { + if (md->isStatic()) + type="clm"; // class member + else + type="instm"; // instance member + } + else if (cd && cd->compoundType()==ClassDef::Protocol) + { + if (md->isStatic()) + type="intfcm"; // interface class member + else + type="intfm"; // interface member + } + else + type="func"; + break; + case MemberDef::Variable: + type="data"; break; + case MemberDef::Typedef: + type="tdef"; break; + case MemberDef::Enumeration: + type="enum"; break; + case MemberDef::EnumValue: + type="econst"; break; + //case MemberDef::Prototype: + // type="prototype"; break; + case MemberDef::Signal: + type="signal"; break; + case MemberDef::Slot: + type="slot"; break; + case MemberDef::Friend: + type="ffunc"; break; + case MemberDef::DCOP: + type="dcop"; break; + case MemberDef::Property: + if (cd && cd->compoundType()==ClassDef::Protocol) + type="intfp"; // interface property + else + type="instp"; // instance property + break; + case MemberDef::Event: + type="event"; break; + } + writeToken(m_tts,md,type,lang,scope,md->anchor()); + } } - if (cd) + else if (context && context->isLinkable()) { - scope = cd->qualifiedName(); - if (cd->isTemplate()) - type="tmplt"; - else if (cd->compoundType()==ClassDef::Protocol) + if (fd==0 && context->definitionType()==Definition::TypeFile) + { + fd = (FileDef*)context; + } + if (cd==0 && context->definitionType()==Definition::TypeClass) + { + cd = (ClassDef*)context; + } + if (nd==0 && context->definitionType()==Definition::TypeNamespace) { - type="intf"; - if (scope.right(2)=="-p") scope=scope.left(scope.length()-2); + nd = (NamespaceDef*)context; } - else if (cd->compoundType()==ClassDef::Interface) - type="cl"; - else if (cd->compoundType()==ClassDef::Category) - type="cat"; - else - type = "cl"; - d = cd; - IncludeInfo *ii = cd->includeInfo(); - if (ii) + if (fd) { - decl=ii->includeName; - if (decl.isEmpty()) + type="file"; + } + else if (cd) + { + scope = cd->qualifiedName(); + if (cd->isTemplate()) { - decl=ii->local; + type="tmplt"; } - } - } - else if (nd) - { - scope = nd->name(); - type = "ns"; - d = cd; - } - if (d && d->isLinkable() && m_scopes.find(d->getOutputFileBase())==0) - { - writeToken(m_tts,d,type,lang,0,0,decl); - m_scopes.append(d->getOutputFileBase(),(void*)0x8); - } - - switch (md->memberType()) - { - case MemberDef::Define: - type="macro"; break; - case MemberDef::Function: - if (cd && (cd->compoundType()==ClassDef::Interface || - cd->compoundType()==ClassDef::Class) - ) + else if (cd->compoundType()==ClassDef::Protocol) { - if (md->isStatic()) - type="clm"; - else - type="instm"; + type="intf"; + if (scope.right(2)=="-p") scope=scope.left(scope.length()-2); } - else if (cd && cd->compoundType()==ClassDef::Protocol) + else if (cd->compoundType()==ClassDef::Interface) { - if (md->isStatic()) - type="intfcm"; - else - type="intfm"; + type="cl"; + } + else if (cd->compoundType()==ClassDef::Category) + { + type="cat"; } else - type="func"; - break; - case MemberDef::Variable: - type="data"; break; - case MemberDef::Typedef: - type="tdef"; break; - case MemberDef::Enumeration: - type="enum"; break; - case MemberDef::EnumValue: - type="econst"; break; - //case MemberDef::Prototype: - // type="prototype"; break; - case MemberDef::Signal: - type="signal"; break; - case MemberDef::Slot: - type="slot"; break; - case MemberDef::Friend: - type="ffunc"; break; - case MemberDef::DCOP: - type="dcop"; break; - case MemberDef::Property: - if (cd && cd->compoundType()==ClassDef::Protocol) - type="intfp"; - else - type="instp"; - break; - case MemberDef::Event: - type="event"; break; + { + type = "cl"; + } + IncludeInfo *ii = cd->includeInfo(); + if (ii) + { + decl=ii->includeName; + if (decl.isEmpty()) + { + decl=ii->local; + } + } + } + else if (nd) + { + scope = nd->name(); + type = "ns"; + } + if (m_scopes.find(context->getOutputFileBase())==0) + { + writeToken(m_tts,context,type,lang,0,0,decl); + m_scopes.append(context->getOutputFileBase(),(void*)0x8); + } } - writeToken(m_tts,md,type,lang,scope,md->anchor()); } void DocSets::writeToken(QTextStream &t, @@ -384,9 +423,18 @@ void DocSets::writeToken(QTextStream &t, QString name = d->name(); if (name.right(2)=="-p") name=name.left(name.length()-2); t << " <Name>" << convertToXML(name) << "</Name>" << endl; - t << " <APILanguage>" << lang << "</APILanguage>" << endl; - t << " <Type>" << type << "</Type>" << endl; - t << " <Scope>" << convertToXML(scope) << "</Scope>" << endl; + if (!lang.isEmpty()) + { + t << " <APILanguage>" << lang << "</APILanguage>" << endl; + } + if (!type.isEmpty()) + { + t << " <Type>" << type << "</Type>" << endl; + } + if (scope) + { + t << " <Scope>" << convertToXML(scope) << "</Scope>" << endl; + } t << " </TokenIdentifier>" << endl; t << " <Path>" << d->getOutputFileBase() << Doxygen::htmlFileExtension << "</Path>" << endl; @@ -397,7 +445,7 @@ void DocSets::writeToken(QTextStream &t, QCString tooltip = d->briefDescriptionAsTooltip(); if (!tooltip.isEmpty()) { - t << " <Abstract>" << tooltip << "</Abstract>" << endl; + t << " <Abstract>" << convertToXML(tooltip) << "</Abstract>" << endl; } if (decl) { diff --git a/src/docsets.h b/src/docsets.h index cc285e4..9efc063 100644 --- a/src/docsets.h +++ b/src/docsets.h @@ -46,9 +46,11 @@ class DocSets : public IndexIntf const char *file = 0, const char *anchor = 0 ); - void addIndexItem(const char *level1, const char *level2, - const char *contRef, const char *memRef, - const char *anchor,const MemberDef *md); + //void addIndexItem(const char *level1, const char *level2, + // const char *contRef, const char *memRef, + // const char *anchor,const MemberDef *md); + void addIndexItem(Definition *context,MemberDef *md, + const char *anchor,const char *word); void addIndexFile(const char *name); void addImageFile(const char *) {} void addStyleSheetFile(const char *) {} diff --git a/src/doctokenizer.l b/src/doctokenizer.l index cc9fbad..7ffe7f7 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -305,7 +305,7 @@ FILEMASK ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|{HFILEMASK} LINKMASK [^ \t\n\r\\@<&${}]+("("[^\n)]*")")?({BLANK}*("const"|"volatile"){BLANK}+)? VERBATIM "verbatim"{BLANK}* SPCMD1 {CMD}([a-z_A-Z0-9]+|{VERBATIM}) -SPCMD2 {CMD}[\\@<>&$#%~] +SPCMD2 {CMD}[\\@<>&$#%~"] SPCMD3 {CMD}form#[0-9]+ INOUT "in"|"out"|("in"{BLANK}*","{BLANK}*"out")|("out"{BLANK}*","{BLANK}*"in") PARAMIO {CMD}param{BLANK}*"["{BLANK}*{INOUT}{BLANK}*"]" @@ -924,7 +924,7 @@ REFWORD ("#"|"::")?({ID}{TEMPLPART}?("."|"#"|"::"|"-"|"/"))*({ID}(":")?){FUNCA <*>\n { warn(g_fileName,yylineno,"Error: Unexpected new line character"); } -<*>[\\@<>&$#%~] { /* unescaped special character */ +<*>[\\@<>&$#%~"] { /* unescaped special character */ //warn(g_fileName,yylineno,"Warning: Unexpected character `%s', assuming command \\%s was meant.",yytext,yytext); g_token->name = yytext; return TK_COMMAND; diff --git a/src/dot.cpp b/src/dot.cpp index 8b30ad4..fad0760 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -1173,7 +1173,7 @@ void DotGfxHierarchyTable::writeGraph(QTextStream &out,const char *path) const checkDotResult(absImgName); if (Config_getBool("DOT_CLEANUP")) d.remove(dotName); } - Doxygen::indexList.addImageFile(absImgName); + Doxygen::indexList.addImageFile(imgName); // write image and map in a table row QCString mapLabel = escapeCharsInString(n->m_label,FALSE); out << "<tr><td><img src=\"" << imgName << "\" border=\"0\" alt=\"\" usemap=\"#" diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 05d9429..886a0ab 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -6926,17 +6926,17 @@ static void computeMemberRelations() { ClassDef *bmcd = bmd->getClassDef(); //printf("Check relation between `%s'::`%s' (%p) and `%s'::`%s' (%p)\n", - // mcd->name().data(),md->name().data(),md, + // 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)) { - //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(); + //printf(" Base argList=`%s'\n Super argList=`%s'\n", + // argListToString(bmdAl.pointer()).data(), + // argListToString(mdAl.pointer()).data() + // ); if ( matchArguments2(bmd->getOuterScope(),bmd->getFileDef(),bmdAl.pointer(), md->getOuterScope(), md->getFileDef(), mdAl.pointer(), @@ -10167,13 +10167,17 @@ void generateOutput() { g_outputList->add(new HtmlGenerator); HtmlGenerator::init(); - if (Config_getBool("GENERATE_HTMLHELP")) Doxygen::indexList.addIndex(new HtmlHelp); - if (Config_getBool("GENERATE_QHP")) Doxygen::indexList.addIndex(new Qhp); #if 0 if (Config_getBool("GENERATE_INDEXLOG")) Doxygen::indexList.addIndex(new IndexLog); #endif - if (Config_getBool("GENERATE_TREEVIEW")) Doxygen::indexList.addIndex(new FTVHelp); - if (Config_getBool("GENERATE_DOCSET")) Doxygen::indexList.addIndex(new DocSets); + bool generateHtmlHelp = Config_getBool("GENERATE_HTMLHELP"); + bool generateQhp = Config_getBool("GENERATE_QHP"); + bool generateTreeView = Config_getBool("GENERATE_TREEVIEW"); + bool generateDocSet = Config_getBool("GENERATE_DOCSET"); + if (generateHtmlHelp) Doxygen::indexList.addIndex(new HtmlHelp); + if (generateQhp) Doxygen::indexList.addIndex(new Qhp); + if (generateTreeView) Doxygen::indexList.addIndex(new FTVHelp); + if (generateDocSet) Doxygen::indexList.addIndex(new DocSets); Doxygen::indexList.initialize(); Doxygen::indexList.addImageFile("tab_r.gif"); Doxygen::indexList.addImageFile("tab_l.gif"); @@ -10258,6 +10262,10 @@ void generateOutput() if (Config_getBool("SEARCHENGINE")) { writeSearchIndex(); + Doxygen::indexList.addImageFile("search/close.png"); + Doxygen::indexList.addImageFile("search/search.png"); + Doxygen::indexList.addStyleSheetFile("search/search.css"); + Doxygen::indexList.addStyleSheetFile("search/search.js"); } //statistics(); @@ -10407,26 +10415,6 @@ void generateOutput() } QDir::setCurrent(oldDir); } -#if 0 - if ( Config_getBool("GENERATE_HTMLHELP") && - !Config_getString("DOXYGEN2QTHELP_LOC").isEmpty() && - !Config_getString("QTHELP_CONFIG").isEmpty()) - { - msg("Running doxygen2qthelp...\n"); - const QCString qtHelpFile = Config_getString("QTHELP_FILE"); - const QCString args = QCString().sprintf("--config=%s index.hhp%s%s", - Config_getString("QTHELP_CONFIG").data(), - (qtHelpFile.isEmpty() ? "" : " "), (qtHelpFile.isEmpty() ? "" : qtHelpFile.data())); - - const QString oldDir = QDir::currentDirPath(); - QDir::setCurrent(Config_getString("HTML_OUTPUT")); - if (portable_system(Config_getString("DOXYGEN2QTHELP_LOC"), args.data(), FALSE)) - { - err("Error: failed to run doxygen2qthelp on index.hhp\n"); - } - QDir::setCurrent(oldDir); - } -#endif if ( Config_getBool("GENERATE_HTML") && Config_getBool("GENERATE_QHP") && !Config_getString("QHG_LOCATION").isEmpty()) diff --git a/src/fortrancode.l b/src/fortrancode.l index 2cb9b30..9893b7d 100644 --- a/src/fortrancode.l +++ b/src/fortrancode.l @@ -263,7 +263,7 @@ static void startCodeLine() static void endFontClass(); static void endCodeLine() { - if (g_currentFontClass) { g_code->endFontClass(); } + endFontClass(); g_code->endCodeLine(); } diff --git a/src/fortranscanner.l b/src/fortranscanner.l index 62c1882..8c51d1a 100644 --- a/src/fortranscanner.l +++ b/src/fortranscanner.l @@ -1602,12 +1602,13 @@ static void handleCommentBlock(const QCString &doc,bool brief) int position=0; if (docBlockInBody && hideInBodyDocs) return; //fprintf(stderr,"call parseCommentBlock [%s]\n",doc.data()); + int lineNr = brief ? current->briefLine : current->docLine; while (parseCommentBlock( g_thisParser, docBlockInBody ? last_entry : current, doc, // text yyFileName, // file - brief ? current->briefLine : current->docLine, // line of block start + lineNr, docBlockInBody ? FALSE : brief, docBlockInBody ? FALSE : docBlockJavaStyle, docBlockInBody, diff --git a/src/ftvhelp.h b/src/ftvhelp.h index 25e2c9f..a703975 100644 --- a/src/ftvhelp.h +++ b/src/ftvhelp.h @@ -82,9 +82,10 @@ class FTVHelp : public IndexIntf const char *ref, const char *file, const char *anchor); - void addIndexItem(const char *, const char *, - const char *, const char *, - const char *, const MemberDef *) {} + //void addIndexItem(const char *, const char *, + // const char *, const char *, + // const char *, const MemberDef *) {} + void addIndexItem(Definition *,MemberDef *,const char *,const char *) {} void addIndexFile(const char *) {} void addImageFile(const char *) {} void addStyleSheetFile(const char *) {} diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index fa25951..49a0de2 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -34,6 +34,34 @@ static const int NUM_HTML_LIST_TYPES = 4; static const char types[][NUM_HTML_LIST_TYPES] = {"1", "a", "i", "A"}; +static QCString convertIndexWordToAnchor(const QString &word) +{ + static char hex[] = "0123456789abcdef"; + uint i; + QCString result; + for (i=0;i<word.length();i++) + { + int c = word.at(i); + if (isId(c)) + { + result+=c; + } + else if (isspace(c)) + { + result+="_"; + } + else + { + char cs[3]; + cs[0]=hex[c>>4]; + cs[1]=hex[c&0xf]; + cs[2]=0; + result+=cs; + } + } + return result; +} + static bool mustBeOutsideParagraph(DocNode *n) { switch (n->kind()) @@ -293,7 +321,7 @@ void HtmlDocVisitor::visit(DocVerbatim *s) case DocVerbatim::XmlOnly: /* nothing */ break; - + case DocVerbatim::Dot: { static int dotindex = 1; @@ -470,8 +498,20 @@ void HtmlDocVisitor::visit(DocFormula *f) } } -void HtmlDocVisitor::visit(DocIndexEntry *) +void HtmlDocVisitor::visit(DocIndexEntry *e) { + QCString anchor = convertIndexWordToAnchor(e->entry()); + if (e->member()) + { + anchor.prepend(e->member()->anchor()+"_"); + } + m_t << "<a name=\"" << anchor << "\"></a>"; + //printf("*** DocIndexEntry: word='%s' scope='%s' member='%s'\n", + // e->entry().data(), + // e->scope() ? e->scope()->name().data() : "<null>", + // e->member() ? e->member()->name().data() : "<null>" + // ); + Doxygen::indexList.addIndexItem(e->scope(),e->member(),anchor,e->entry()); } void HtmlDocVisitor::visit(DocSimpleSectSep *) diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index f120a93..8410a26 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -302,8 +302,13 @@ static QDict<QCString> s_languageDict; void HtmlHelp::initialize() { const char *str = Config_getString("CHM_INDEX_ENCODING"); - if(!str) str = "Windows-1250"; + if (!str) str = "CP1250"; // use safe and likely default m_fromUtf8 = portable_iconv_open(str,"UTF-8"); + if (m_fromUtf8==(void *)(-1)) + { + err("Error: unsupported character conversion for CHM_INDEX_ENCODING: '%s'->'UTF-8'\n", str); + exit(1); + } /* open the contents file */ QCString fName = Config_getString("HTML_OUTPUT") + "/index.hhc"; @@ -639,21 +644,36 @@ void HtmlHelp::addContentsItem(bool isDir, cts << "</OBJECT>\n"; } -/*! Add an list item to the index file. - * \param level1 the main index of the item. - * \param level2 the sub index of the item. - * \param contRef the output file refering to the container. - * \param memRef the output file containing to the member documentation. - * \param anchor the anchor of the item. - * \param md the member definition corresponding to this item. - * \sa HtmlHelpIndex - */ -void HtmlHelp::addIndexItem(const char *level1, const char *level2, - const char *contRef, const char *memRef, - const char *anchor,const MemberDef *md) + +void HtmlHelp::addIndexItem(Definition *context,MemberDef *md, + const char *anc,const char *word) { - (void)md; - index->addItem(level1,level2,contRef,anchor,TRUE,FALSE); - index->addItem(level2,level1,memRef,anchor,TRUE,TRUE); + if (md) + { + static bool separateMemberPages = Config_getBool("SEPARATE_MEMBER_PAGES"); + if (context==0) // global member + { + if (md->getGroupDef()) + context = md->getGroupDef(); + else if (md->getFileDef()) + context = md->getFileDef(); + } + if (context==0) return; // should not happen + + QCString cfname = md->getOutputFileBase(); + QCString cfiname = context->getOutputFileBase(); + QCString level1 = context->name(); + QCString level2 = md->name(); + QCString contRef = separateMemberPages ? cfname : cfiname; + QCString memRef = cfname; + QCString anchor = anc; + index->addItem(level1,level2,contRef,anchor,TRUE,FALSE); + index->addItem(level2,level1,memRef,anchor,TRUE,TRUE); + } + else if (context) + { + QCString level1 = word ? QCString(word) : context->name(); + index->addItem(level1,0,context->getOutputFileBase(),anc,TRUE,FALSE); + } } diff --git a/src/htmlhelp.h b/src/htmlhelp.h index 57ffb23..21d5a51 100644 --- a/src/htmlhelp.h +++ b/src/htmlhelp.h @@ -74,9 +74,11 @@ class HtmlHelp : public IndexIntf const char *ref = 0, const char *file = 0, const char *anchor = 0); - void addIndexItem(const char *level1, const char *level2, - const char *contRef, const char *memRef, - const char *anchor,const MemberDef *md); + //void addIndexItem(const char *level1, const char *level2, + // const char *contRef, const char *memRef, + // const char *anchor,const MemberDef *md); + void addIndexItem(Definition *context,MemberDef *md, + const char *anchor,const char *word); void addIndexFile(const char *name); void addImageFile(const char *) {} void addStyleSheetFile(const char *) {} diff --git a/src/index.cpp b/src/index.cpp index 6646075..f2a48a4 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -131,7 +131,7 @@ class MemberIndexList : public QList<MemberDef> } }; -#define MEMBER_INDEX_ENTRIES 128 +#define MEMBER_INDEX_ENTRIES 256 static MemberIndexList g_memberIndexLetterUsed[CMHL_Total][MEMBER_INDEX_ENTRIES]; static MemberIndexList g_fileIndexLetterUsed[FMHL_Total][MEMBER_INDEX_ENTRIES]; @@ -1573,7 +1573,8 @@ void addClassMemberNameToIndex(MemberDef *md) { QCString n = md->name(); int index = getPrefixIndex(n); - int letter = tolower(n.at(index)) & 0x7f; + int charCode = n.at(index); + int letter = charCode<128 ? tolower(charCode) : charCode; if (!n.isEmpty()) { bool isFriendToHide = hideFriendCompounds && @@ -1653,7 +1654,8 @@ void addNamespaceMemberNameToIndex(MemberDef *md) { QCString n = md->name(); int index = getPrefixIndex(n); - int letter = tolower(n.at(index)); + int charCode = n.at(index); + int letter = charCode<128 ? tolower(charCode) : charCode; if (!n.isEmpty()) { g_namespaceIndexLetterUsed[NMHL_All][letter].append(md); @@ -1711,7 +1713,8 @@ void addFileMemberNameToIndex(MemberDef *md) { QCString n = md->name(); int index = getPrefixIndex(n); - int letter = tolower(n.at(index)); + int charCode = n.at(index); + int letter = charCode<128 ? tolower(charCode) : charCode; if (!n.isEmpty()) { g_fileIndexLetterUsed[FMHL_All][letter].append(md); @@ -2237,7 +2240,8 @@ static void addMemberToSearchIndex( cd->templateMaster()==0) { QCString n = md->name(); - int letter = tolower(n.at(0)) & 0x7f; + int charCode = n.at(0); + int letter = charCode<128 ? tolower(charCode) : charCode; if (!n.isEmpty()) { bool isFriendToHide = hideFriendCompounds && @@ -2299,7 +2303,8 @@ static void addMemberToSearchIndex( ) { QCString n = md->name(); - int letter = tolower(n.at(0)) & 0x7f; + int charCode = n.at(0); + int letter = charCode<128 ? tolower(charCode) : charCode; if (!n.isEmpty()) { symbols[SEARCH_INDEX_ALL][letter].append(md); @@ -2412,7 +2417,8 @@ void writeSearchIndex() ClassDef *cd; for (;(cd=cli.current());++cli) { - int letter = tolower(cd->localName().at(0)); + int charCode = cd->localName().at(0); + int letter = charCode<128 ? tolower(charCode) : charCode; if (cd->isLinkable() && isId(letter)) { g_searchIndexSymbols[SEARCH_INDEX_ALL][letter].append(cd); @@ -2425,7 +2431,8 @@ void writeSearchIndex() NamespaceDef *nd; for (;(nd=nli.current());++nli) { - int letter = tolower(nd->name().at(0)); + int charCode = nd->name().at(0); + int letter = charCode<128 ? tolower(charCode) : charCode; if (nd->isLinkable() && isId(letter)) { g_searchIndexSymbols[SEARCH_INDEX_ALL][letter].append(nd); @@ -2442,7 +2449,8 @@ void writeSearchIndex() FileDef *fd; for (;(fd=fni.current());++fni) { - int letter = tolower(fd->name().at(0)); + int charCode = fd->name().at(0); + int letter = charCode<128 ? tolower(charCode) : charCode; if (fd->isLinkable() && isId(letter)) { g_searchIndexSymbols[SEARCH_INDEX_ALL][letter].append(fd); @@ -2772,7 +2780,7 @@ void writeSearchIndex() { if (!first) t << "," << endl; t << " " << j << ": \""; - for (p=32;p<MEMBER_INDEX_ENTRIES;p++) + for (p=0;p<MEMBER_INDEX_ENTRIES;p++) { t << (g_searchIndexSymbols[i][p].count()>0 ? "1" : "0"); } diff --git a/src/index.h b/src/index.h index 72ac764..bb62520 100644 --- a/src/index.h +++ b/src/index.h @@ -22,11 +22,12 @@ #include <qfile.h> #include <qlist.h> +class Definition; class MemberDef; class OutputList; class QTextStream; - +/** \brief Abstract interface for index generators. */ class IndexIntf { public: @@ -37,44 +38,56 @@ class IndexIntf virtual void decContentsDepth() = 0; virtual void addContentsItem(bool isDir, const char *name, const char *ref = 0, const char *file = 0, const char *anchor = 0) = 0; - virtual void addIndexItem(const char *level1, const char *level2, const char *contRef, - const char *memRef, const char *anchor,const MemberDef *md) = 0; + virtual void addIndexItem(Definition *context,MemberDef *md, + const char *anchor,const char *word) = 0; virtual void addIndexFile(const char *name) = 0; virtual void addImageFile(const char *name) = 0; virtual void addStyleSheetFile(const char *name) = 0; }; +/** \brief A list of index interfaces. + * + * This class itself implements all methods of IndexIntf and + * just forwards the calls to all items in the list. + */ class IndexList : public IndexIntf { private: QList<IndexIntf> m_intfs; + // --- foreach implementations for various number of arguments + void foreach(void (IndexIntf::*methodPtr)()) { QListIterator<IndexIntf> li(m_intfs); for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(); } + template<typename A1> void foreach(void (IndexIntf::*methodPtr)(A1),A1 a1) { QListIterator<IndexIntf> li(m_intfs); for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1); } - template<typename A1,typename A2,typename A3,typename A4,typename A5> - void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4,A5),A1 a1,A2 a2,A3 a3,A4 a4,A5 a5) + + template<typename A1,typename A2,typename A3,typename A4> + void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4),A1 a1,A2 a2,A3 a3,A4 a4) { QListIterator<IndexIntf> li(m_intfs); - for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4,a5); + for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4); } - template<typename A1,typename A2,typename A3,typename A4,typename A5,typename A6> - void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4,A5,A6),A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6) + + template<typename A1,typename A2,typename A3,typename A4,typename A5> + void foreach(void (IndexIntf::*methodPtr)(A1,A2,A3,A4,A5),A1 a1,A2 a2,A3 a3,A4 a4,A5 a5) { QListIterator<IndexIntf> li(m_intfs); - for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4,a5,a6); + for (li.toFirst();li.current();++li) (li.current()->*methodPtr)(a1,a2,a3,a4,a5); } public: + /** Creates a list of indexes */ IndexList() { m_intfs.setAutoDelete(TRUE); } + /** Add an index generator to the list */ void addIndex(IndexIntf *intf) { m_intfs.append(intf); } @@ -91,10 +104,10 @@ class IndexList : public IndexIntf const char *file = 0, const char *anchor = 0) { foreach<bool,const char *,const char *,const char *,const char*> (&IndexIntf::addContentsItem,isDir,name,ref,file,anchor); } - void addIndexItem(const char *level1, const char *level2, const char *contRef, - const char *memRef, const char *anchor,const MemberDef *md) - { foreach<const char *,const char *,const char *,const char *,const char *,const MemberDef *> - (&IndexIntf::addIndexItem,level1,level2,contRef,memRef,anchor,md); } + void addIndexItem(Definition *context,MemberDef *md, + const char *anchor=0,const char *word=0) + { foreach<Definition *,MemberDef *> + (&IndexIntf::addIndexItem,context,md,anchor,word); } void addIndexFile(const char *name) { foreach<const char *>(&IndexIntf::addIndexFile,name); } void addImageFile(const char *name) diff --git a/src/memberdef.cpp b/src/memberdef.cpp index b3843cd..cf71914 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -1402,16 +1402,17 @@ void MemberDef::writeDeclaration(OutputList &ol, } else // index member { - static bool separateMemPages = Config_getBool("SEPARATE_MEMBER_PAGES"); - QCString cfname = getOutputFileBase(); - QCString cfiname = d->getOutputFileBase(); - Doxygen::indexList.addIndexItem( - cname, // level1 - name(), // level2 - separateMemPages ? cfname : cfiname, // contRef - cfname, // memRef - anchor(), // anchor - this); // memberdef + //static bool separateMemPages = Config_getBool("SEPARATE_MEMBER_PAGES"); + //QCString cfname = getOutputFileBase(); + //QCString cfiname = d->getOutputFileBase(); + //Doxygen::indexList.addIndexItem( + // cname, // level1 + // name(), // level2 + // separateMemPages ? cfname : cfiname, // contRef + // cfname, // memRef + // anchor(), // anchor + // this); // memberdef + Doxygen::indexList.addIndexItem(d,this); } // *** write arguments @@ -1642,7 +1643,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, bool hasParameterList = FALSE; bool inFile = container->definitionType()==Definition::TypeFile; bool hasDocs = isDetailedSectionVisible(inGroup,inFile); - static bool separateMemPages = Config_getBool("SEPARATE_MEMBER_PAGES"); static bool optVhdl = Config_getBool("OPTIMIZE_OUTPUT_VHDL"); //printf("MemberDef::writeDocumentation(): name=`%s' hasDocs=`%d' containerType=%d inGroup=%d\n", // name().data(),hasDocs,container->definitionType(),inGroup); @@ -1672,22 +1672,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, QCString cfname = getOutputFileBase(); QCString cfiname = container->getOutputFileBase(); - // the next part is moved to declaration - //if (isEnumerate() && name().at(0)=='@') - //{ - // // don't add to index - //} - //else - //{ - // Doxygen::indexList.addIndexItem( - // ciname, // level1 - // name(), // level2 - // separateMemPages ? cfname : cfiname, // contRef - // cfname, // memRef - // memAnchor, // anchor - // this); // memberdef - //} - // get member name QCString doxyName=name(); // prepend scope if there is any. TODO: make this optional for C only docs @@ -2073,35 +2057,6 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, FALSE // isExample ); -#if 0 // old, now obsolete way to add parameter documentation - //printf("***** argumentList is documented\n"); - ol.startParamList(BaseOutputDocInterface::Param,theTranslator->trParameters()+": "); - ol.writeDescItem(); - ol.startDescTable(); - ArgumentListIterator ali(*docArgList); - Argument *a; - for (ali.toFirst();(a=ali.current());++ali) - { - if (a->hasDocumentation()) - { - ol.startDescTableTitle(); - ol.docify(a->name); - ol.endDescTableTitle(); - QCString doc = a->docs+"\n"; - ol.startDescTableData(); - ol.parseDoc(docFile(),docLine(), - getOuterScope()?getOuterScope():container, - this, // memberDef - a->docs+"\n", // docStr - TRUE, // indexWords - FALSE // isExample - ); - ol.endDescTableData(); - } - } - ol.endDescTable(); - ol.endParamList(); -#endif } // For enum, we also write the documented enum values @@ -2127,21 +2082,15 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, ol.addIndexItem(fmd->name(),cname); ol.addIndexItem(cname,fmd->name()); - //if (hasHtmlHelp) - //{ - // htmlHelp->addIndexItem(ciname, // level1 - // fmd->name(), // level2 - // separateMemPages ? cfname : cfiname, // contRef - // cfname, // memRef - // fmd->anchor()); // anchor - //} - Doxygen::indexList.addIndexItem( - ciname, // level1 - fmd->name(), // level2 - separateMemPages ? cfname : cfiname, // contRef - cfname, // memRef - fmd->anchor(), // anchor - fmd); // memberdef + //Doxygen::indexList.addIndexItem( + // ciname, // level1 + // fmd->name(), // level2 + // separateMemPages ? cfname : cfiname, // contRef + // cfname, // memRef + // fmd->anchor(), // anchor + // fmd); // memberdef + Doxygen::indexList.addIndexItem(container,fmd); + //ol.writeListItem(); ol.startDescTableTitle(); // this enables emphasis! ol.startDoxyAnchor(cfname,cname,fmd->anchor(),fmd->name(),fmd->argsString()); diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 2b41d4c..1c08b4e 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -415,6 +415,8 @@ void NamespaceDef::writeDocumentation(OutputList &ol) Doxygen::tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl; } + Doxygen::indexList.addIndexItem(this,0); + //---------------------------------------- start flexible part ------------------------------- QListIterator<LayoutDocEntry> eli( diff --git a/src/pagedef.cpp b/src/pagedef.cpp index efb361c..66576d9 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -160,7 +160,8 @@ void PageDef::writeDocumentation(OutputList &ol) void PageDef::writePageDocumentation(OutputList &ol) { ol.startTextBlock(); - ol.parseDoc(docFile(), // fileName + ol.parseDoc( + docFile(), // fileName docLine(), // startLine this, // context 0, // memberdef @@ -512,7 +512,7 @@ static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int len=0; result.resize(0); int cc; - while ((cc=getCurrentChar(expr,rest,j))!=EOF && cc==' ') + while ((cc=getCurrentChar(expr,rest,j))!=EOF && isspace(cc)) { len++; getNextChar(expr,rest,j); @@ -772,6 +772,7 @@ static int getNextId(const QCString &expr,int p,int *l) c=expr.at(p); p++; } + if (p<(int)expr.length()) ++p; // skip closing quote } else if (c=='/') // skip C Comment { diff --git a/src/pycode.l b/src/pycode.l index 0acc23e..53498ca 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -402,7 +402,7 @@ static void codify(const char* text) static void endCodeLine() { - if (g_currentFontClass) { g_code->endFontClass(); } + endFontClass(); g_code->endCodeLine(); } diff --git a/src/pyscanner.l b/src/pyscanner.l index 6c832f7..92b7bdd 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -304,12 +304,13 @@ static void handleCommentBlock(const QCString &doc,bool brief) int position = 0; bool needsEntry; + int lineNr = brief ? current->briefLine : current->docLine; while (parseCommentBlock( g_thisParser, (docBlockInBody && previous) ? previous : current, doc, // text yyFileName, // file - brief ? current->briefLine : current->docLine, // line of block start + lineNr, docBlockInBody ? FALSE : brief, docBlockJavaStyle, // javadoc style // or FALSE, docBlockInBody, diff --git a/src/qhp.cpp b/src/qhp.cpp index 15ecdab..f38cf39 100644 --- a/src/qhp.cpp +++ b/src/qhp.cpp @@ -18,6 +18,9 @@ #include "qhpxmlwriter.h" #include "message.h" #include "config.h" +#include "memberdef.h" +#include "groupdef.h" +#include "filedef.h" #include <qstringlist.h> #include <string.h> @@ -132,7 +135,7 @@ void Qhp::finalize() m_toc.close("toc"); m_doc.insert(m_toc); - // Finish index + // Finish index m_index.close("keywords"); m_doc.insert(m_index); @@ -184,65 +187,90 @@ void Qhp::addContentsItem(bool /*isDir*/, const char * name, } } -void Qhp::addIndexItem(const char * level1, const char * level2, - const char * contRef, const char * /*memRef*/, - const char * anchor, const MemberDef * /*md*/) +void Qhp::addIndexItem(Definition *context,MemberDef *md, + const char *anc,const char *word) { - QCString ref; - if ((m_prevIdName!=level1) || (m_prevIdRef!=contRef)) - { - m_prevIdName = level1; - m_prevIdRef = contRef; + (void)anc; + (void)word; - ref = makeFileName(contRef); + if (md) // member + { + static bool separateMemberPages = Config_getBool("SEPARATE_MEMBER_PAGES"); + if (context==0) // global member + { + if (md->getGroupDef()) + context = md->getGroupDef(); + else if (md->getFileDef()) + context = md->getFileDef(); + } + if (context==0) return; // should not happen + QCString cfname = md->getOutputFileBase(); + QCString cfiname = context->getOutputFileBase(); + QCString level1 = context->name(); + QCString level2 = word ? QCString(word) : md->name(); + QCString contRef = separateMemberPages ? cfname : cfiname; + QCString anchor = anc; + + QCString ref; + + // <keyword name="foo" id="MyApplication::foo" ref="doc.html#foo"/> + ref = makeRef(contRef, anchor); + QCString id = level1+"::"+level2; const char * attributes[] = - { "name", level1, + { + "name", level2, + "id", id, + "ref", ref, + 0 + }; + m_index.openClose("keyword", attributes); + } + else if (context) // container + { + // <keyword name="Foo" id="Foo" ref="doc.html"/> + QCString contRef = context->getOutputFileBase(); + QCString level1 = word ? QCString(word) : context->name(); + QCString ref; + if (anc) + { + ref = makeRef(contRef,anc); + } + else + { + ref = makeFileName(contRef); + } + const char * attributes[] = + { + "name", level1, "id", level1, "ref", ref, 0 }; m_index.openClose("keyword", attributes); } - /* - <keyword name="foo" id="MyApplication::foo" ref="doc.html#foo"/> - */ - ref = makeRef(contRef, anchor); - QCString id(level1); - id += "::"; - id += level2; - const char * attributes[] = - { "name", level2, - "id", id, - "ref", ref, - 0 - }; - m_index.openClose("keyword", attributes); } -void -Qhp::addIndexFile(const char * name) +void Qhp::addIndexFile(const char * name) { addFile(name); } -/*static*/ QCString -Qhp::getQhpFileName() +QCString Qhp::getQhpFileName() { return "index.qhp"; } -/*static*/ QCString -Qhp::getFullProjectName() +QCString Qhp::getFullProjectName() { - QCString const projectName = Config_getString("PROJECT_NAME"); - QCString const versionText = Config_getString("PROJECT_NUMBER"); + QCString projectName = Config_getString("PROJECT_NAME"); + QCString versionText = Config_getString("PROJECT_NUMBER"); + if (projectName.isEmpty()) projectName="Root"; return projectName + (versionText.isEmpty() ? QCString("") : QCString(" ") + versionText); } -void -Qhp::handlePrevSection() +void Qhp::handlePrevSection() { /* <toc> @@ -33,9 +33,11 @@ class Qhp : public IndexIntf void decContentsDepth(); void addContentsItem(bool isDir, const char * name, const char * ref, const char * file, const char * anchor); - void addIndexItem(const char * level1, const char * level2, - const char * contRef, const char * memRef, - const char * anchor, const MemberDef * md); + //void addIndexItem(const char * level1, const char * level2, + // const char * contRef, const char * memRef, + // const char * anchor, const MemberDef * md); + void addIndexItem(Definition *context,MemberDef *md, + const char *anchor,const char *word); void addIndexFile(const char * name); void addImageFile(const char * name); void addStyleSheetFile(const char * name); @@ -62,8 +64,8 @@ class Qhp : public IndexIntf int m_prevSectionLevel; int m_sectionLevel; - QCString m_prevIdName; - QCString m_prevIdRef; + //QCString m_prevIdName; + //QCString m_prevIdRef; }; #endif // DOXYGEN_QHP_H diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index e321508..cff30e0 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -39,8 +39,8 @@ #include "dirdef.h" #include "vhdldocgen.h" -#define DBG_RTF(x) x; -//#define DBG_RTF(x) +//#define DBG_RTF(x) x; +#define DBG_RTF(x) static QCString dateToRTFDateString() { diff --git a/src/scanner.l b/src/scanner.l index dd1eb77..9e9c5f9 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -772,6 +772,10 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) <FindMembersPHP>"<?"("php"?) { // PHP code start BEGIN( FindMembers ); } +<FindMembersPHP>"<script"{BN}+"language"{BN}*"="{BN}*['"]?"php"['"]?{BN}*">" { // PHP code start + lineCount() ; + BEGIN( FindMembers ); + } <FindMembersPHP>[^\n<]+ { // Non-PHP code text, ignore } <FindMembersPHP>\n { // Non-PHP code text, ignore @@ -779,7 +783,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) } <FindMembersPHP>. { // Non-PHP code text, ignore } -<FindMembers>"?>" { // PHP code end +<FindMembers>"?>"|"</script>" { // PHP code end if (insidePHP) BEGIN( FindMembersPHP ); else @@ -5368,12 +5372,13 @@ static void handleCommentBlock(const QCString &doc,bool brief) bool needsEntry=FALSE; if (docBlockInBody && hideInBodyDocs) return; //printf("parseCommentBlock [%s]\n",doc.data()); + int lineNr = brief ? current->briefLine : current->docLine; // line of block start while (parseCommentBlock( g_thisParser, docBlockInBody && previous ? previous : current, doc, // text yyFileName, // file - brief ? current->briefLine : current->docLine, // line of block start + lineNr, // line of block start docBlockInBody ? FALSE : brief, docBlockInBody ? FALSE : docBlockAutoBrief, docBlockInBody, diff --git a/src/search.js b/src/search.js index 49655c5..8acef8c 100644 --- a/src/search.js +++ b/src/search.js @@ -238,10 +238,10 @@ function SearchBox(name, resultsPath, inFrame, label) if (child.className=='SelectItem') { var node = child.firstChild; - if (j==id) - { + if (j==id) + { node.innerHTML='•'; - } + } else { node.innerHTML=' '; @@ -324,7 +324,7 @@ function SearchBox(name, resultsPath, inFrame, label) var resultsPageWithSearch; var hasResultsPage; - if (indexSectionsWithContent[this.searchIndex].charAt(code-32) == '1') + if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1') { resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html'; resultsPageWithSearch = resultsPage+'?'+escape(searchValue); @@ -453,20 +453,20 @@ function SearchResults(name) if (element) { if (element.style.display == 'block') - { - element.style.display = 'none'; + { + element.style.display = 'none'; } else - { - element.style.display = 'block'; + { + element.style.display = 'block'; } } } - // Searches for the passed string. If there is no parameter, + // Searches for the passed string. If there is no parameter, // it takes it from the URL query. // - // Always returns true, since other documents may try to call it + // Always returns true, since other documents may try to call it // and that may or may not be possible. this.Search = function(search) { @@ -501,20 +501,20 @@ function SearchResults(name) matches++; } else - { - row.style.display = 'none'; + { + row.style.display = 'none'; } } i++; } document.getElementById("Searching").style.display='none'; if (matches == 0) // no results - { - document.getElementById("NoMatches").style.display='block'; + { + document.getElementById("NoMatches").style.display='block'; } else // at least one result - { - document.getElementById("NoMatches").style.display='none'; + { + document.getElementById("NoMatches").style.display='none'; } this.lastMatchCount = matches; return true; @@ -606,9 +606,9 @@ function SearchResults(name) while (1) // search for last child { tmpElem = document.getElementById('Item'+newIndex+'_c'+n); - if (tmpElem) + if (tmpElem) { - focusItem = tmpElem; + focusItem = tmpElem; } else // found it! { diff --git a/src/search_js.h b/src/search_js.h index 51fdb00..b24b562 100644 --- a/src/search_js.h +++ b/src/search_js.h @@ -238,10 +238,10 @@ " if (child.className=='SelectItem')\n" " {\n" " var node = child.firstChild;\n" -" if (j==id)\n" -" {\n" +" if (j==id)\n" +" {\n" " node.innerHTML='•';\n" -" } \n" +" }\n" " else\n" " {\n" " node.innerHTML=' ';\n" @@ -324,7 +324,7 @@ " var resultsPageWithSearch;\n" " var hasResultsPage;\n" "\n" -" if (indexSectionsWithContent[this.searchIndex].charAt(code-32) == '1')\n" +" if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1')\n" " {\n" " resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';\n" " resultsPageWithSearch = resultsPage+'?'+escape(searchValue);\n" @@ -453,20 +453,20 @@ " if (element)\n" " {\n" " if (element.style.display == 'block')\n" -" { \n" -" element.style.display = 'none'; \n" +" {\n" +" element.style.display = 'none';\n" " }\n" " else\n" -" { \n" -" element.style.display = 'block'; \n" +" {\n" +" element.style.display = 'block';\n" " }\n" " }\n" " }\n" "\n" -" // Searches for the passed string. If there is no parameter, \n" +" // Searches for the passed string. If there is no parameter,\n" " // it takes it from the URL query.\n" " //\n" -" // Always returns true, since other documents may try to call it \n" +" // Always returns true, since other documents may try to call it\n" " // and that may or may not be possible.\n" " this.Search = function(search)\n" " {\n" @@ -501,20 +501,20 @@ " matches++;\n" " }\n" " else\n" -" { \n" -" row.style.display = 'none'; \n" +" {\n" +" row.style.display = 'none';\n" " }\n" " }\n" " i++;\n" " }\n" " document.getElementById(\"Searching\").style.display='none';\n" " if (matches == 0) // no results\n" -" { \n" -" document.getElementById(\"NoMatches\").style.display='block'; \n" +" {\n" +" document.getElementById(\"NoMatches\").style.display='block';\n" " }\n" " else // at least one result\n" -" { \n" -" document.getElementById(\"NoMatches\").style.display='none'; \n" +" {\n" +" document.getElementById(\"NoMatches\").style.display='none';\n" " }\n" " this.lastMatchCount = matches;\n" " return true;\n" @@ -606,9 +606,9 @@ " while (1) // search for last child\n" " {\n" " tmpElem = document.getElementById('Item'+newIndex+'_c'+n);\n" -" if (tmpElem) \n" +" if (tmpElem)\n" " {\n" -" focusItem = tmpElem; \n" +" focusItem = tmpElem;\n" " }\n" " else // found it!\n" " {\n" diff --git a/src/translator_fr.h b/src/translator_fr.h index 575e923..a4427ca 100644 --- a/src/translator_fr.h +++ b/src/translator_fr.h @@ -100,7 +100,7 @@ // Translator class (by the local maintainer) when the localized // translator is made up-to-date again. -class TranslatorFrench : public TranslatorAdapter_1_5_4 +class TranslatorFrench : public Translator { public: @@ -158,7 +158,7 @@ class TranslatorFrench : public TranslatorAdapter_1_5_4 /*! header that is put before the list of typedefs. */ virtual QCString trMemberTypedefDocumentation() { - return "Documentation des définitions de type membre"; } + return "Documentation des définitions de type membres"; } /*! header that is put before the list of enumerations. */ virtual QCString trMemberEnumerationDocumentation() @@ -386,7 +386,7 @@ class TranslatorFrench : public TranslatorAdapter_1_5_4 if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - result+="des fonctions, variables, macros, énumérations, et définitions de type "; + result+="des fonctions, variables, macros, enumérations, et définitions de type "; } else { @@ -812,7 +812,7 @@ class TranslatorFrench : public TranslatorAdapter_1_5_4 if (i<numEntries-2) // not the fore last entry result+=", "; else // the fore last entry - result+=" et "; + result+=", et "; } } return result; @@ -998,7 +998,7 @@ class TranslatorFrench : public TranslatorAdapter_1_5_4 /*! header that is put before the list of constructor/destructors. */ virtual QCString trConstructorDocumentation() { - return "Documentation des constructeurs et destructeurs"; + return "Documentation des constructeurs et destructeur"; } /*! Used in the file documentation to point to the corresponding sources. */ virtual QCString trGotoSourceCode() @@ -1192,7 +1192,7 @@ class TranslatorFrench : public TranslatorAdapter_1_5_4 "};\n" "\\endcode\n" "Si la valeur 240 est attribuée au tag \\c MAX_DOT_GRAPH_HEIGHT " - "du fichier de configuration, cela générera le graphe suivant :" + "du fichier de configuration, cela génèrera le graphe suivant :" "<p><center><img alt=\"\" src=\"graph_legend."+Config_getEnum("DOT_IMAGE_FORMAT")+"\"></center>\n" "<p>\n" "Les rectangles du graphe ci-dessus ont la signification suivante :\n" @@ -1622,7 +1622,7 @@ class TranslatorFrench : public TranslatorAdapter_1_5_4 { if (numDocuments==0) { - return "Désolé aucun document ne correspond à votre requête."; + return "Désolé, aucun document ne correspond à votre requête."; } else if (numDocuments==1) { @@ -1737,6 +1737,207 @@ class TranslatorFrench : public TranslatorAdapter_1_5_4 virtual QCString trEnumerationValueDocumentation() { return "Documentation des énumérations"; } + ////////////////////////////////////////////////////////////////////////// + // new since 1.5.4 (mainly for Fortran) + ////////////////////////////////////////////////////////////////////////// + + /*! header that is put before the list of member subprograms (Fortran). */ + virtual QCString trMemberFunctionDocumentationFortran() + { return "Documentation des fonctions membres/subroutine"; } + + /*! This is put above each page as a link to the list of annotated data types (Fortran). */ + virtual QCString trCompoundListFortran() + { return "Liste des types de données"; } + + /*! This is put above each page as a link to all members of compounds (Fortran). */ + virtual QCString trCompoundMembersFortran() + { return "Champs de données"; } + + /*! This is an introduction to the annotated compound list (Fortran). */ + virtual QCString trCompoundListDescriptionFortran() + { return "Liste des types de données avec une brève description :"; } + + /*! This is an introduction to the page with all data types (Fortran). */ + virtual QCString trCompoundMembersDescriptionFortran(bool extractAll) + { + QCString result="Liste de tous les "; + result+="membres de types de données "; + if (!extractAll) + { + result+="documentés "; + } + result+="avec liens vers "; + if (!extractAll) + { + result+="la documentation de la structure des données de chaque membre :"; + } + else + { + result+="les types des données auxquels ils appartiennent :"; + } + return result; + } + + /*! This is used in LaTeX as the title of the chapter with the + * annotated compound index (Fortran). + */ + virtual QCString trCompoundIndexFortran() + { return "Index du type de données"; } + + /*! This is used in LaTeX as the title of the chapter containing + * the documentation of all data types (Fortran). + */ + virtual QCString trTypeDocumentation() + { return "Documentation du type de données"; } + + /*! This is used in the documentation of a file as a header before the + * list of (global) subprograms (Fortran). + */ + virtual QCString trSubprograms() + { return "Fonctions/Subroutines"; } + + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for subprograms (Fortran) + */ + virtual QCString trSubprogramDocumentation() + { return "Documentation de la Fonction/Subroutine"; } + + /*! This is used in the documentation of a file/namespace/group before + * the list of links to documented compounds (Fortran) + */ + virtual QCString trDataTypes() + { return "Les types de données"; } + + /*! used as the title of page containing all the index of all modules (Fortran). */ + virtual QCString trModulesList() + { return "Liste des modules"; } + + /*! used as an introduction to the modules list (Fortran) */ + virtual QCString trModulesListDescription(bool extractAll) + { + QCString result="Liste de tous les modules"; + if (!extractAll) result+="documentés "; + result+="avec une brève description :"; + return result; + } + + /*! used as the title of the HTML page of a module/type (Fortran) */ + virtual QCString trCompoundReferenceFortran(const char *clName, + ClassDef::CompoundType compType, + bool isTemplate) + { + QCString result="Réference "; + if (isTemplate) result+="du gabarit (template) "; + switch(compType) + { + case ClassDef::Class: result+="du module "; break; + case ClassDef::Struct: result+="du type "; break; + case ClassDef::Union: result+="de l'union "; break; + case ClassDef::Interface: result+="de l'interface "; break; + case ClassDef::Protocol: result+="du protocole "; break; + case ClassDef::Category: result+="de la catégorie "; break; + case ClassDef::Exception: result+="de l'exception "; break; + } + result+=(QCString)clName; + return result; + } + /*! used as the title of the HTML page of a module (Fortran) */ + virtual QCString trModuleReference(const char *namespaceName) + { + QCString result="Référence du module "; + result+= namespaceName; + return result; + } + + /*! This is put above each page as a link to all members of modules. (Fortran) */ + virtual QCString trModulesMembers() + { return "Membres du module"; } + + /*! This is an introduction to the page with all modules members (Fortran) */ + virtual QCString trModulesMemberDescription(bool extractAll) + { + QCString result="Liste de tous les membres "; + if (!extractAll) result+="documentés "; + result+="du module avec lien vers "; + if (extractAll) + { + result+="la documentation du module de chaque membre :"; + } + else + { + result+="les modules auxquels ils appartiennent :"; + } + return result; + } + + /*! This is used in LaTeX as the title of the chapter with the + * index of all modules (Fortran). + */ + virtual QCString trModulesIndex() + { return "Index des modules"; } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trModule(bool first_capital, bool singular) + { + QCString result((first_capital ? "Module" : "module")); + if (!singular) result+="s"; + return result; + } + + /*! This is put at the bottom of a module documentation page and is + * followed by a list of files that were used to generate the page. + */ + virtual QCString trGeneratedFromFilesFortran(ClassDef::CompoundType compType, + bool single) + { + // single is true implies a single file + QCString result=(QCString)"La documentation de "; + switch(compType) + { + case ClassDef::Class: result+="ce module"; break; + case ClassDef::Struct: result+="ce type"; break; + case ClassDef::Union: result+="cette union"; break; + case ClassDef::Interface: result+="cette interface"; break; + case ClassDef::Protocol: result+="ce protocole"; break; + case ClassDef::Category: result+="cette catégorie"; break; + case ClassDef::Exception: result+="cette exception"; break; + } + result+=" a été générée à partir "; + if (single) result+="du fichier suivant :"; else result+="des fichiers suivants :"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trType(bool first_capital, bool singular) + { + QCString result((first_capital ? "Type" : "type")); + if (!singular) result+="s"; + return result; + } + + /*! This is used for translation of the word that will possibly + * be followed by a single name or by a list of names + * of the category. + */ + virtual QCString trSubprogram(bool first_capital, bool singular) + { + QCString result((first_capital ? "Sous-programme" : "sous-programme")); + if (!singular) result+="s"; + return result; + } + + /*! C# Type Constraint list */ + virtual QCString trTypeConstraints() + { + return "Les constraintes du type"; + } + ////////////////////////////////////////////////////////////////////////// // new since 1.6.0 (mainly for the new search engine) ////////////////////////////////////////////////////////////////////////// @@ -1744,7 +1945,7 @@ class TranslatorFrench : public TranslatorAdapter_1_5_4 /*! directory relation for \a name */ virtual QCString trDirRelation(const char *name) { - return QCString(name)+" Relation"; + return "Relation " + QCString(name); } /*! Loading message shown when loading search results */ diff --git a/src/util.cpp b/src/util.cpp index 3a96fce..a427b67 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -3136,13 +3136,10 @@ static QCString getCanonicalTypeForIdentifier( //printf(" mtype=%s\n",mType?mType->name().data():"<none>"); - if (cd && cd==d) - { - if (tSpec) *tSpec=""; - return ""; - } - else if (cd) // resolves to a known class type + if (cd) // resolves to a known class type { + if (cd==d && tSpec) *tSpec=""; + if (mType && mType->isTypedef()) // but via a typedef { result = resolvedType; @@ -3248,7 +3245,8 @@ static QCString extractCanonicalType(Definition *d,FileDef *fs,QCString type) { canType += ct; } - //printf(" word=%s templSpec=%s canType=%s\n",word.data(),templSpec.data(),canType.data()); + //printf(" word=%s templSpec=%s canType=%s ct=%s\n", + // word.data(),templSpec.data(),canType.data(),ct.data()); if (!templSpec.isEmpty()) // if we didn't use up the templSpec already // (i.e. type is not a template specialization) // then resolve any identifiers inside. @@ -4095,16 +4093,14 @@ static bool getScopeDefs(const char *docScope,const char *scope, return FALSE; } -//static bool isLowerCase(QCString &s) -//{ -// char *p=s.data(); -// if (p==0) return TRUE; -// int c; -// while ((c=*p++)) if (!islower(c)) return FALSE; -// return TRUE; -//} - - +static bool isLowerCase(QCString &s) +{ + char *p=s.data(); + if (p==0) return TRUE; + int c; + while ((c=*p++)) if (!islower(c)) return FALSE; + return TRUE; +} /*! Returns an object to reference to given its name and context * @post return value TRUE implies *resContext!=0 or *resMember!=0 @@ -4136,10 +4132,12 @@ bool resolveRef(/* in */ const char *scName, ClassDef *cd=0; NamespaceDef *nd=0; - //if (!inSeeBlock && scopePos==-1 && isLowerCase(tsName)) - //{ // link to lower case only name => do not try to autolink - // return FALSE; - //} + // the following if() was commented out for releases in the range + // 1.5.2 to 1.6.1, but has been restored as a result of bug report 594787. + if (!inSeeBlock && scopePos==-1 && isLowerCase(tsName)) + { // link to lower case only name => do not try to autolink + return FALSE; + } //printf("scName=%s fullName=%s\n",scName,fullName.data()); diff --git a/src/vhdlcode.l b/src/vhdlcode.l index 57d5eaf..ed49db6 100644 --- a/src/vhdlcode.l +++ b/src/vhdlcode.l @@ -237,9 +237,10 @@ static void startCodeLine() } } +static void endFontClass(); static void endCodeLine() { - if (g_currentFontClass) { g_code->endFontClass(); } + endFontClass(); g_code->endCodeLine(); } diff --git a/src/vhdlscanner.l b/src/vhdlscanner.l index fd0dba4..e4b7256 100644 --- a/src/vhdlscanner.l +++ b/src/vhdlscanner.l @@ -1704,6 +1704,7 @@ static void handleCommentBlock(const QCString &doc,bool brief) int position=0; bool needsEntry=FALSE; Protection protection=Public; + int lineNr = iDocLine; if (brief) current->briefLine = iDocLine; else @@ -1715,7 +1716,7 @@ static void handleCommentBlock(const QCString &doc,bool brief) current, doc, // text yyFileName, // file - iDocLine, // line of block start + lineNr, // line of block start brief, docBlockAutoBrief, FALSE, |