Changeset 846 for trunk/tools/qdoc3


Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
104 edited
53 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/qdoc3/apigenerator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/apigenerator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/archiveextractor.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/archiveextractor.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/atom.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/atom.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/bookgenerator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/bookgenerator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/ccodeparser.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/ccodeparser.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/codechunk.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/codechunk.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5656  The CodeChunk class represents a tiny piece of C++ code.
    5757
    58   The class provides convertion between a list of lexemes and a string.  It adds
     58  The class provides conversion between a list of lexemes and a string.  It adds
    5959  spaces at the right place for consistent style.  The tiny pieces of code it
    6060  represents are data types, enum values, and default parameter values.
  • trunk/tools/qdoc3/codemarker.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    178178{
    179179    if (sizeof(const Node *) == sizeof(ulong)) {
    180         return QString::number(reinterpret_cast<ulong>(node));
     180        return QString::number(reinterpret_cast<quintptr>(node));
    181181    }
    182182    else {
     
    258258{
    259259    QString tag;
     260    QString name = node->name();
    260261
    261262    switch (node->type()) {
     
    278279        tag = QLatin1String("@property");
    279280        break;
     281#ifdef QDOC_QML
     282    case Node::Fake:
     283        if (node->subType() == Node::QmlClass) {
     284            if (node->name().startsWith(QLatin1String("QML:")))
     285                name = name.mid(4);                 // remove the "QML:" prefix
     286        }
     287        tag = QLatin1String("@property");
     288        break;
     289#endif
    280290    default:
    281291        tag = QLatin1String("@unknown");
    282292        break;
    283293    }
    284     return QLatin1Char('<') + tag + QLatin1Char('>') + protect(node->name())
     294    return QLatin1Char('<') + tag + QLatin1Char('>') + protect(name)
    285295        + QLatin1String("</") + tag + QLatin1Char('>');
    286296}
     
    458468{
    459469    if (!fs.isEmpty()) {
    460         Section section(fs.name,fs.singularMember,fs.pluralMember);
     470        Section section(fs.name,fs.divClass,fs.singularMember,fs.pluralMember);
    461471        section.members = fs.memberMap.values();
    462472        section.reimpMembers = fs.reimpMemberMap.values();
     
    615625  the specified QmlClassNode.
    616626 */
    617 QList<Section> CodeMarker::qmlSections(const QmlClassNode* , SynopsisStyle )
     627QList<Section> CodeMarker::qmlSections(const QmlClassNode* ,
     628                                       SynopsisStyle ,
     629                                       const Tree* )
    618630{
    619631    return QList<Section>();
     
    621633#endif
    622634
     635const Node* CodeMarker::resolveTarget(const QString& ,
     636                                      const Tree* ,
     637                                      const Node* ,
     638                                      const Node* )
     639{
     640    return 0;
     641}
     642
    623643QT_END_NAMESPACE
  • trunk/tools/qdoc3/codemarker.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5959{
    6060    QString name;
     61    QString divClass;
    6162    QString singularMember;
    6263    QString pluralMember;
     
    6768    Section() { }
    6869    Section(const QString& name0,
     70            const QString& divClass0,
    6971            const QString& singularMember0,
    7072            const QString& pluralMember0)
    71         : name(name0),
     73        : name(name0),
     74          divClass(divClass0),
    7275          singularMember(singularMember0),
    7376          pluralMember(pluralMember0) { }
     
    8083    const InnerNode *innerNode;
    8184    QString name;
     85    QString divClass;
    8286    QString singularMember;
    8387    QString pluralMember;
     
    8791
    8892    FastSection(const InnerNode *innerNode0,
    89                 const QString& name0 = "",
    90                 const QString& singularMember0 = "member",
    91                 const QString& pluralMember0 = "members")
     93                const QString& name0,
     94                const QString& divClass0,
     95                const QString& singularMember0,
     96                const QString& pluralMember0)
    9297        : innerNode(innerNode0),
    9398          name(name0),
     99          divClass(divClass0),
    94100          singularMember(singularMember0),
    95101          pluralMember(pluralMember0) { }
    96102    bool isEmpty() const {
    97         return (memberMap.isEmpty() && inherited.isEmpty() &&
     103        return (memberMap.isEmpty() &&
     104                inherited.isEmpty() &&
    98105                reimpMemberMap.isEmpty());
    99106    }
    100107
    101108};
     109
     110#if 0
     111                const QString& name0 = "",
     112                const QString& divClass0 = "",
     113                const QString& singularMember0 = "member",
     114                const QString& pluralMember0 = "members")
     115#endif
    102116
    103117class CodeMarker
     
    140154#ifdef QDOC_QML
    141155    virtual QList<Section> qmlSections(const QmlClassNode* qmlClassNode,
    142                                        SynopsisStyle style);
    143 #endif
    144     virtual const Node *resolveTarget(const QString& target,
    145                                       const Tree *tree,
    146                                       const Node *relative) = 0;
    147     virtual QStringList macRefsForNode(const Node *node);
     156                                       SynopsisStyle style,
     157                                       const Tree* tree);
     158#endif
     159    virtual const Node* resolveTarget(const QString& target,
     160                                      const Tree* tree,
     161                                      const Node* relative,
     162                                      const Node* self = 0);
     163    virtual QStringList macRefsForNode(const Node* node);
    148164
    149165    static void initialize(const Config& config);
  • trunk/tools/qdoc3/codeparser.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4444*/
    4545
    46 #include <QtCore>
    4746#include "codeparser.h"
    4847#include "node.h"
    4948#include "tree.h"
    5049#include "config.h"
     50#include <QDebug>
    5151
    5252QT_BEGIN_NAMESPACE
     
    6060#define COMMAND_NONREENTRANT            Doc::alias(QLatin1String("nonreentrant"))
    6161#define COMMAND_OBSOLETE                Doc::alias(QLatin1String("obsolete"))
     62#define COMMAND_PAGEKEYWORDS            Doc::alias(QLatin1String("pagekeywords"))
    6263#define COMMAND_PRELIMINARY             Doc::alias(QLatin1String("preliminary"))
    6364#define COMMAND_INPUBLICGROUP           Doc::alias(QLatin1String("inpublicgroup"))
     
    7071QList<CodeParser *> CodeParser::parsers;
    7172bool CodeParser::showInternal = false;
     73QMap<QString,QString> CodeParser::nameToTitle;
    7274
    7375/*!
     
    171173                           << COMMAND_NONREENTRANT
    172174                           << COMMAND_OBSOLETE
     175                           << COMMAND_PAGEKEYWORDS
    173176                           << COMMAND_PRELIMINARY
    174177                           << COMMAND_INPUBLICGROUP
     
    231234        node->setSince(arg);
    232235    }
     236    else if (command == COMMAND_PAGEKEYWORDS) {
     237        node->addPageKeywords(arg);
     238    }
    233239    else if (command == COMMAND_SUBTITLE) {
    234240        if (node->type() == Node::Fake) {
     
    246252            FakeNode *fake = static_cast<FakeNode *>(node);
    247253            fake->setTitle(arg);
     254            nameToTitle.insert(fake->name(),arg);
    248255        }
    249256        else
     
    252259}
    253260
     261/*!
     262  Find the page title given the page \a name and return it.
     263 */
     264const QString CodeParser::titleFromName(const QString& name)
     265{
     266    const QString t = nameToTitle.value(name);
     267    return t;
     268}
     269
    254270QT_END_NAMESPACE
  • trunk/tools/qdoc3/codeparser.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    7979    static void terminate();
    8080    static CodeParser *parserForLanguage(const QString& language);
     81    static const QString titleFromName(const QString& name);
    8182
    8283 protected:
     
    8990    static QList<CodeParser *> parsers;
    9091    static bool showInternal;
     92    static QMap<QString,QString> nameToTitle;
    9193};
    9294
  • trunk/tools/qdoc3/command.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4848#include "command.h"
    4949
     50#include <stdlib.h>
     51
    5052QT_BEGIN_NAMESPACE
    5153
     
    7072        toolName.truncate(space);
    7173
     74#ifdef QT_BOOTSTRAPPED
     75    int status = system(qPrintable(actualCommand));
     76    int exitCode = WEXITSTATUS(status);
     77    if (status == -1 || exitCode != EXIT_SUCCESS)
     78        location.fatal(QString("Error executing '$1': $2").arg(toolName).arg(exitCode));
     79#else
    7280    QProcess process;
    7381    process.start(QLatin1String("sh"),
     
    9098                          "It emitted these errors:\n%2")
    9199                       .arg(actualCommand).arg(errors));
     100#endif
    92101}
    93102
  • trunk/tools/qdoc3/command.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/config.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4444*/
    4545
    46 #include <QtCore>
     46#include <QDir>
     47#include <QVariant>
     48#include <QFile>
     49#include <QTemporaryFile>
     50#include <QTextStream>
    4751
    4852#include "archiveextractor.h"
     
    525529    QStringList::ConstIterator e = fileExtensions.begin();
    526530    while (e != fileExtensions.end()) {
    527         QString filePath = findFile(location, files, dirs, fileBase + "." + *e,
    528                                      userFriendlyFilePath);
     531        QString filePath = findFile(location,
     532                                    files,
     533                                    dirs,
     534                                    fileBase + "." + *e,
     535                                    userFriendlyFilePath);
    529536        if (!filePath.isEmpty())
    530537            return filePath;
     
    672679    }
    673680
    674     QString text = fin.readAll();
     681    QTextStream stream(&fin);
     682    stream.setCodec("UTF-8");
     683    QString text = stream.readAll();
    675684    text += QLatin1String("\n\n");
    676685    text += QChar('\0');
  • trunk/tools/qdoc3/config.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    120120
    121121#define CONFIG_ALIAS                    "alias"
     122#define CONFIG_APPLICATION              "application"
    122123#define CONFIG_BASE                     "base"      // ### don't document for now
    123124#define CONFIG_CODEINDENT               "codeindent"
     
    141142#define CONFIG_LANGUAGE                 "language"
    142143#define CONFIG_MACRO                    "macro"
     144#define CONFIG_NATURALLANGUAGE          "naturallanguage"
    143145#define CONFIG_OBSOLETELINKS            "obsoletelinks"
     146#define CONFIG_APPLICATION              "application"
    144147#define CONFIG_OUTPUTDIR                "outputdir"
     148#define CONFIG_OUTPUTENCODING           "outputencoding"
    145149#define CONFIG_OUTPUTLANGUAGE           "outputlanguage"
    146150#define CONFIG_OUTPUTFORMATS            "outputformats"
     
    148152#define CONFIG_QHP                      "qhp"
    149153#define CONFIG_QUOTINGINFORMATION       "quotinginformation"
     154#define CONFIG_SCRIPTDIRS               "scriptdirs"
     155#define CONFIG_SCRIPTS                  "scripts"
    150156#define CONFIG_SLOW                     "slow"
    151157#define CONFIG_SHOWINTERNAL             "showinternal"
    152158#define CONFIG_SOURCEDIRS               "sourcedirs"
     159#define CONFIG_SOURCEENCODING           "sourceencoding"
    153160#define CONFIG_SOURCES                  "sources"
    154161#define CONFIG_SPURIOUS                 "spurious"
     162#define CONFIG_STYLEDIRS                "styledirs"
     163#define CONFIG_STYLES                   "styles"
    155164#define CONFIG_STYLESHEETS              "stylesheets"
    156165#define CONFIG_TABSIZE                  "tabsize"
  • trunk/tools/qdoc3/cppcodemarker.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    146146    else {
    147147        QString fullName;
    148         for (;;) {
     148        while (node) {
    149149            fullName.prepend(plainName(node));
    150150            if (node->parent() == relative || node->parent()->name().isEmpty())
     
    483483            FastSection privateFunctions(classe,
    484484                                         "Private Functions",
     485                                         "",
    485486                                         "private function",
    486487                                         "private functions");
    487             FastSection privateSlots(classe, "Private Slots", "private slot", "private slots");
    488             FastSection privateTypes(classe, "Private Types", "private type", "private types");
     488            FastSection privateSlots(classe, "Private Slots", "", "private slot", "private slots");
     489            FastSection privateTypes(classe, "Private Types", "", "private type", "private types");
    489490            FastSection protectedFunctions(classe,
    490491                                           "Protected Functions",
     492                                           "",
    491493                                           "protected function",
    492494                                           "protected functions");
    493495            FastSection protectedSlots(classe,
    494496                                       "Protected Slots",
     497                                       "",
    495498                                       "protected slot",
    496499                                       "protected slots");
    497500            FastSection protectedTypes(classe,
    498501                                       "Protected Types",
     502                                       "",
    499503                                       "protected type",
    500504                                       "protected types");
    501505            FastSection protectedVariables(classe,
    502506                                           "Protected Variables",
     507                                           "",
    503508                                           "protected type",
    504509                                           "protected variables");
    505510            FastSection publicFunctions(classe,
    506511                                        "Public Functions",
     512                                        "",
    507513                                        "public function",
    508514                                        "public functions");
    509             FastSection publicSignals(classe, "Signals", "signal", "signals");
    510             FastSection publicSlots(classe, "Public Slots", "public slot", "public slots");
    511             FastSection publicTypes(classe, "Public Types", "public type", "public types");
     515            FastSection publicSignals(classe, "Signals", "", "signal", "signals");
     516            FastSection publicSlots(classe, "Public Slots", "", "public slot", "public slots");
     517            FastSection publicTypes(classe, "Public Types", "", "public type", "public types");
    512518            FastSection publicVariables(classe,
    513519                                        "Public Variables",
    514                                         "public type",
     520                                        "",
     521                                        "public variable",
    515522                                        "public variables");
    516             FastSection properties(classe, "Properties", "property", "properties");
     523            FastSection properties(classe, "Properties", "", "property", "properties");
    517524            FastSection relatedNonMembers(classe,
    518525                                          "Related Non-Members",
     526                                          "",
    519527                                          "related non-member",
    520528                                          "related non-members");
    521529            FastSection staticPrivateMembers(classe,
    522530                                             "Static Private Members",
     531                                             "",
    523532                                             "static private member",
    524533                                             "static private members");
    525534            FastSection staticProtectedMembers(classe,
    526535                                               "Static Protected Members",
     536                                               "",
    527537                                               "static protected member",
    528538                                               "static protected members");
    529539            FastSection staticPublicMembers(classe,
    530540                                            "Static Public Members",
     541                                            "",
    531542                                            "static public member",
    532543                                            "static public members");
    533             FastSection macros(inner, "Macros", "macro", "macros");
     544            FastSection macros(inner, "Macros", "", "macro", "macros");
    534545
    535546            NodeList::ConstIterator r = classe->relatedNodes().begin();
     
    667678        }
    668679        else if (style == Detailed) {
    669             FastSection memberFunctions(classe,"Member Function Documentation");
    670             FastSection memberTypes(classe,"Member Type Documentation");
    671             FastSection memberVariables(classe,"Member Variable Documentation");
    672             FastSection properties(classe,"Property Documentation");
    673             FastSection relatedNonMembers(classe,"Related Non-Members");
    674             FastSection macros(classe,"Macro Documentation");
     680            FastSection memberFunctions(classe,"Member Function Documentation","func","member","members");
     681            FastSection memberTypes(classe,"Member Type Documentation","types","member","members");
     682            FastSection memberVariables(classe,"Member Variable Documentation","vars","member","members");
     683            FastSection properties(classe,"Property Documentation","prop","member","members");
     684            FastSection relatedNonMembers(classe,"Related Non-Members","relnonmem","member","members");
     685            FastSection macros(classe,"Macro Documentation","macros","member","members");
    675686
    676687            NodeList::ConstIterator r = classe->relatedNodes().begin();
     
    718729        }
    719730        else {
    720             FastSection all(classe);
     731            FastSection all(classe,"","","member","members");
    721732
    722733            QStack<const ClassNode *> stack;
     
    748759            FastSection namespaces(inner,
    749760                                   "Namespaces",
     761                                   style == Detailed ? "nmspace" : "",
    750762                                   "namespace",
    751763                                   "namespaces");
    752764            FastSection classes(inner,
    753765                                "Classes",
     766                                style == Detailed ? "classes" : "",
    754767                                "class",
    755768                                "classes");
    756769            FastSection types(inner,
    757                               style == Summary ?
    758                               "Types" : "Type Documentation",
     770                              style == Summary ? "Types" : "Type Documentation",
     771                              style == Detailed ? "types" : "",
    759772                              "type",
    760773                              "types");
     
    762775                                  style == Summary ?
    763776                                  "Functions" : "Function Documentation",
     777                                  style == Detailed ? "func" : "",
    764778                                  "function",
    765779                                  "functions");
     
    767781                               style == Summary ?
    768782                               "Macros" : "Macro Documentation",
     783                               style == Detailed ? "macros" : "",
    769784                               "macro",
    770785                               "macros");
     
    811826}
    812827
    813 const Node *CppCodeMarker::resolveTarget(const QString &target,
    814                                          const Tree *tree,
    815                                          const Node *relative)
     828const Node *CppCodeMarker::resolveTarget(const QString& target,
     829                                         const Tree* tree,
     830                                         const Node* relative,
     831                                         const Node* self)
    816832{
    817833    if (target.endsWith("()")) {
     
    855871        QStringList path = target.split("::");
    856872        const Node *node;
     873        int flags = Tree::SearchBaseClasses |
     874            Tree::SearchEnumValues |
     875            Tree::NonFunction;
    857876        if ((node = tree->findNode(path,
    858877                                   relative,
    859                                    Tree::SearchBaseClasses |
    860                                    Tree::SearchEnumValues |
    861                                    Tree::NonFunction)))
     878                                   flags,
     879                                   self)))
    862880            return node;
    863881    }
     
    882900    static QRegExp multiLineComment("/(?:( )?\\*(?:[^*]+|\\*(?! /))*\\*\\1/)");
    883901    multiLineComment.setMinimal(true);
    884     static QRegExp singleLineComment("//(?!!)[^!\n]*");
     902    static QRegExp singleLineComment("[^:]//(?!!)[^!\\n]*");
    885903    static QRegExp preprocessor("(?:^|\n)(#[ \t]*(?:include|if|elif|endif|error|pragma|define"
    886904                                "|warning)(?:(?:\\\\\n|\\n#)[^\n]*)*)");
     
    10681086        }
    10691087        else if (mlpos == -1) {
    1070             pos = slpos;
    1071             len = singleLineComment.matchedLength();
     1088            pos = slpos + 1;
     1089            len = singleLineComment.matchedLength() - 1;
    10721090        }
    10731091        else {
    10741092            if (slpos < mlpos) {
    1075                 pos = slpos;
    1076                 len = singleLineComment.matchedLength();
     1093                pos = slpos + 1;
     1094                len = singleLineComment.matchedLength() - 1;
    10771095            }
    10781096            else {
     
    11101128 */
    11111129QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode,
    1112                                           SynopsisStyle style)
     1130                                          SynopsisStyle style,
     1131                                          const Tree* tree)
    11131132{
    11141133    QList<Section> sections;
     
    11171136            FastSection qmlproperties(qmlClassNode,
    11181137                                      "Properties",
     1138                                      "",
    11191139                                      "property",
    11201140                                      "properties");
    11211141            FastSection qmlattachedproperties(qmlClassNode,
    11221142                                              "Attached Properties",
     1143                                              "",
    11231144                                              "property",
    11241145                                              "properties");
    11251146            FastSection qmlsignals(qmlClassNode,
    1126                                 "Signals",
    1127                                 "signal",
    1128                                 "signals");
     1147                                   "Signals",
     1148                                   "",
     1149                                   "signal",
     1150                                   "signals");
    11291151            FastSection qmlattachedsignals(qmlClassNode,
    1130                                            "QML Attached Signals",
     1152                                           "Attached Signals",
     1153                                           "",
    11311154                                           "signal",
    11321155                                           "signals");
    11331156            FastSection qmlmethods(qmlClassNode,
    11341157                                   "Methods",
     1158                                   "",
    11351159                                   "method",
    11361160                                   "methods");
    11371161            FastSection qmlattachedmethods(qmlClassNode,
    1138                                            "QML Attached Methods",
     1162                                           "Attached Methods",
     1163                                           "",
    11391164                                           "method",
    11401165                                           "methods");
     
    11801205        }
    11811206        else if (style == Detailed) {
    1182             FastSection qmlproperties(qmlClassNode, "Property Documentation");
    1183             FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation");
    1184             FastSection qmlsignals(qmlClassNode,"Signal Documentation");
    1185             FastSection qmlattachedsignals(qmlClassNode,"Attached Signal Documentation");
    1186             FastSection qmlmethods(qmlClassNode,"Method Documentation");
    1187             FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation");
     1207            FastSection qmlproperties(qmlClassNode, "Property Documentation","qmlprop","member","members");
     1208            FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation","qmlattprop",
     1209                                              "member","members");
     1210            FastSection qmlsignals(qmlClassNode,"Signal Documentation","qmlsig","member","members");
     1211            FastSection qmlattachedsignals(qmlClassNode,"Attached Signal Documentation","qmlattsig",
     1212                                           "member","members");
     1213            FastSection qmlmethods(qmlClassNode,"Method Documentation","qmlmeth","member","members");
     1214            FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation","qmlattmeth",
     1215                                           "member","members");
    11881216            NodeList::ConstIterator c = qmlClassNode->childNodes().begin();
    11891217            while (c != qmlClassNode->childNodes().end()) {
     
    12181246            append(sections,qmlattachedmethods);
    12191247        }
     1248        else {
     1249            FastSection all(qmlClassNode,"","","member","members");
     1250
     1251            QStack<const QmlClassNode*> stack;
     1252            stack.push(qmlClassNode);
     1253
     1254            while (!stack.isEmpty()) {
     1255                const QmlClassNode* ancestorClass = stack.pop();
     1256
     1257                NodeList::ConstIterator c = ancestorClass->childNodes().begin();
     1258                while (c != ancestorClass->childNodes().end()) {
     1259                    //              if ((*c)->access() != Node::Private)
     1260                    if ((*c)->subType() == Node::QmlPropertyGroup) {
     1261                        const QmlPropGroupNode* qpgn = static_cast<const QmlPropGroupNode*>(*c);
     1262                        NodeList::ConstIterator p = qpgn->childNodes().begin();
     1263                        while (p != qpgn->childNodes().end()) {
     1264                            if ((*p)->type() == Node::QmlProperty) {
     1265                                insert(all,*p,style,Okay);
     1266                            }
     1267                            ++p;
     1268                        }
     1269                    }
     1270                    else
     1271                        insert(all,*c,style,Okay);
     1272                    ++c;
     1273                }
     1274
     1275                if (!ancestorClass->links().empty()) {
     1276                    if (ancestorClass->links().contains(Node::InheritsLink)) {
     1277                        QPair<QString,QString> linkPair;
     1278                        linkPair = ancestorClass->links()[Node::InheritsLink];
     1279                        QStringList strList(linkPair.first);
     1280                        const Node* n = tree->findNode(strList,Node::Fake);
     1281                        if (n && n->subType() == Node::QmlClass) {
     1282                            const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n);
     1283                            stack.prepend(qcn);
     1284                        }
     1285                    }
     1286                }
     1287            }
     1288            append(sections, all);
     1289        }
    12201290    }
    12211291
  • trunk/tools/qdoc3/cppcodemarker.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    8181                            Status status);
    8282    QList<Section> qmlSections(const QmlClassNode* qmlClassNode,
    83                                SynopsisStyle style);
    84     const Node *resolveTarget(const QString& target,
    85                               const Tree *tree,
    86                               const Node *relative);
     83                               SynopsisStyle style,
     84                               const Tree* tree);
     85    const Node* resolveTarget(const QString& target,
     86                              const Tree* tree,
     87                              const Node* relative,
     88                              const Node* self = 0);
    8789
    8890private:
  • trunk/tools/qdoc3/cppcodeparser.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4444*/
    4545
    46 #include <QtCore>
    4746#include <qfile.h>
    4847
    4948#include <stdio.h>
    5049#include <errno.h>
     50#include <qdebug.h>
    5151
    5252#include "codechunk.h"
     
    9696#define COMMAND_QMLATTACHEDMETHOD       Doc::alias("qmlattachedmethod")
    9797#define COMMAND_QMLDEFAULT              Doc::alias("default")
     98#define COMMAND_QMLBASICTYPE            Doc::alias("qmlbasictype")
    9899#endif
    99100
     
    281282                                    Tree *tree)
    282283{
    283     FILE *in = fopen(QFile::encodeName(filePath), "r");
    284     if (!in) {
     284    QFile in(filePath);
     285    if (!in.open(QIODevice::ReadOnly)) {
    285286        location.error(tr("Cannot open C++ header file '%1'").arg(filePath));
    286287        return;
     
    295296    if (!fileTokenizer.version().isEmpty())
    296297        tree->setVersion(fileTokenizer.version());
    297     fclose(in);
     298    in.close();
    298299
    299300    if (fileLocation.fileName() == "qiterator.h")
     
    312313                                    Tree *tree)
    313314{
    314     FILE *in = fopen(QFile::encodeName(filePath), "r");
    315     if (!in) {
     315    QFile in(filePath);
     316    if (!in.open(QIODevice::ReadOnly)) {
    316317        location.error(tr("Cannot open C++ source file '%1' (%2)").arg(filePath).arg(strerror(errno)));
    317318        return;
     
    325326    usedNamespaces.clear();
    326327    matchDocsAndStuff();
    327     fclose(in);
     328    in.close();
    328329}
    329330
     
    492493                }
    493494
    494                
     495
    495496                /*
    496497                    There are several functions with the correct
     
    537538                           << COMMAND_QMLATTACHEDSIGNAL
    538539                           << COMMAND_QMLMETHOD
    539                            << COMMAND_QMLATTACHEDMETHOD;
     540                           << COMMAND_QMLATTACHEDMETHOD
     541                           << COMMAND_QMLBASICTYPE;
    540542#else
    541543                           << COMMAND_VARIABLE;
     
    544546
    545547/*!
    546   Process the topic \a command in context \a doc with argument \a arg. 
     548  Process the topic \a command in context \a doc with argument \a arg.
    547549 */
    548550Node *CppCodeParser::processTopicCommand(const Doc& doc,
     
    727729                classNode = static_cast<const ClassNode*>(n);
    728730        }
    729         return new QmlClassNode(tre->root(), names[0], classNode);
     731        if (names[0].startsWith("Qt"))
     732            return new QmlClassNode(tre->root(), QLatin1String("QML:")+names[0], classNode);
     733        else
     734            return new QmlClassNode(tre->root(), names[0], classNode);
     735    }
     736    else if (command == COMMAND_QMLBASICTYPE) {
     737        return new QmlBasicTypeNode(tre->root(), arg);
    730738    }
    731739    else if ((command == COMMAND_QMLSIGNAL) ||
     
    737745        QmlClassNode* qmlClass = 0;
    738746        if (splitQmlMethodArg(doc,arg,type,element)) {
     747            if (element.startsWith(QLatin1String("Qt")))
     748                element = QLatin1String("QML:") + element;
    739749            Node* n = tre->findNode(QStringList(element),Node::Fake);
    740750            if (n && n->subType() == Node::QmlClass) {
     
    897907                                << COMMAND_PREVIOUSPAGE
    898908                                << COMMAND_INDEXPAGE
    899 #ifdef QDOC_QML       
     909#ifdef QDOC_QML
    900910                                << COMMAND_STARTPAGE
    901911                                << COMMAND_QMLINHERITS
    902912                                << COMMAND_QMLDEFAULT;
    903 #else   
     913#else
    904914                                << COMMAND_STARTPAGE;
    905 #endif   
     915#endif
    906916}
    907917
     
    10181028    else if (command == COMMAND_QMLINHERITS) {
    10191029        setLink(node, Node::InheritsLink, arg);
    1020     }
     1030        if (node->subType() == Node::QmlClass) {
     1031            QmlClassNode::addInheritedBy(arg,node);
     1032        }
     1033   }
    10211034    else if (command == COMMAND_QMLDEFAULT) {
    10221035        QmlPropGroupNode* qpgn = static_cast<QmlPropGroupNode*>(node);
     
    11051118    else
    11061119        return false;
     1120}
     1121
     1122/*!
     1123  Skip to \a target. If \a target is found before the end
     1124  of input, return true. Otherwise return false.
     1125 */
     1126bool CppCodeParser::skipTo(int target)
     1127{
     1128    while ((tok != Tok_Eoi) && (tok != target))
     1129        readToken();
     1130    return (tok == target ? true : false);
    11071131}
    11081132
     
    13501374    if (!matchDataType(&returnType)) {
    13511375        if (tokenizer->parsingFnOrMacro()
    1352                 && (match(Tok_Q_DECLARE_FLAGS) || match(Tok_Q_PROPERTY)))
     1376                && (match(Tok_Q_DECLARE_FLAGS) ||
     1377                    match(Tok_Q_PROPERTY) ||
     1378                    match(Tok_Q_PRIVATE_PROPERTY)))
    13531379            returnType = CodeChunk(previousLexeme());
    13541380        else {
     
    16331659    QString namespaceName = previousLexeme();
    16341660    NamespaceNode *namespasse = 0;
    1635     if (parent)
     1661    if (parent) {
    16361662        namespasse = static_cast<NamespaceNode*>(parent->findNode(namespaceName, Node::Namespace));
     1663    }
    16371664    if (!namespasse) {
    16381665        namespasse = new NamespaceNode(parent, namespaceName);
     
    17831810bool CppCodeParser::matchProperty(InnerNode *parent)
    17841811{
    1785     if (!match(Tok_Q_PROPERTY) &&
    1786         !match(Tok_Q_OVERRIDE) &&
    1787         !match(Tok_QDOC_PROPERTY))
     1812    int expected_tok = Tok_LeftParen;
     1813    if (match(Tok_Q_PRIVATE_PROPERTY)) {
     1814        expected_tok = Tok_Comma;
     1815        if (!skipTo(Tok_Comma))
     1816            return false;
     1817    }
     1818    else if (!match(Tok_Q_PROPERTY) &&
     1819             !match(Tok_Q_OVERRIDE) &&
     1820             !match(Tok_QDOC_PROPERTY)) {
    17881821        return false;
    1789     if (!match(Tok_LeftParen))
     1822    }
     1823   
     1824    if (!match(expected_tok))
    17901825        return false;
    17911826
     
    18311866            tre->addPropertyFunction(property, value, PropertyNode::Setter);
    18321867            property->setWritable(true);
    1833         } else if (key == "STORED")
     1868        }
     1869        else if (key == "STORED")
    18341870            property->setStored(value.toLower() == "true");
    1835         else if (key == "DESIGNABLE")
    1836             property->setDesignable(value.toLower() == "true");
     1871        else if (key == "DESIGNABLE") {
     1872            QString v = value.toLower();
     1873            if (v == "true")
     1874                property->setDesignable(true);
     1875            else if (v == "false")
     1876                property->setDesignable(false);
     1877            else {
     1878                property->setDesignable(false);
     1879                property->setRuntimeDesFunc(value);
     1880            }
     1881        }
    18371882        else if (key == "RESET")
    18381883            tre->addPropertyFunction(property, value, PropertyNode::Resetter);
     
    18401885            tre->addPropertyFunction(property, value, PropertyNode::Notifier);
    18411886        }
    1842 
     1887        else if (key == "SCRIPTABLE") {
     1888            QString v = value.toLower();
     1889            if (v == "true")
     1890                property->setScriptable(true);
     1891            else if (v == "false")
     1892                property->setScriptable(false);
     1893            else {
     1894                property->setScriptable(false);
     1895                property->setRuntimeScrFunc(value);
     1896            }
     1897        }
     1898        else if (key == "COSTANT")
     1899            property->setConstant();
     1900        else if (key == "FINAL")
     1901            property->setFinal();
    18431902    }
    18441903    match(Tok_RightParen);
     
    19121971        case Tok_Q_OVERRIDE:
    19131972        case Tok_Q_PROPERTY:
     1973        case Tok_Q_PRIVATE_PROPERTY:
    19141974        case Tok_QDOC_PROPERTY:
    19151975            matchProperty(parent);
     
    21002160                    ++a;
    21012161                }
    2102 #endif               
     2162#endif
    21032163            }
    21042164
     
    22492309{
    22502310    QString examplePath = fake->name();
    2251 
    2252     // we can assume that this file always exists
    2253     QString proFileName = examplePath + "/" +
    2254         examplePath.split("/").last() + ".pro";
    2255 
     2311    QString proFileName = examplePath + "/" + examplePath.split("/").last() + ".pro";
    22562312    QString userFriendlyFilePath;
     2313
    22572314    QString fullPath = Config::findFile(fake->doc().location(),
    22582315                                        exampleFiles,
     
    22602317                                        proFileName,
    22612318                                        userFriendlyFilePath);
    2262    
     2319
    22632320    if (fullPath.isEmpty()) {
    22642321        QString tmp = proFileName;
     
    22712328                                    userFriendlyFilePath);
    22722329        if (fullPath.isEmpty()) {
    2273             fake->doc().location().warning(
    2274                tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName));
    2275             return;
     2330            proFileName = examplePath + "/" + examplePath.split("/").last() + ".qmlproject";
     2331            userFriendlyFilePath.clear();
     2332            fullPath = Config::findFile(fake->doc().location(),
     2333                                        exampleFiles,
     2334                                        exampleDirs,
     2335                                        proFileName,
     2336                                        userFriendlyFilePath);
     2337            if (fullPath.isEmpty()) {
     2338                fake->doc().location().warning(
     2339                    tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName));
     2340                return;
     2341            }
    22762342        }
    22772343    }
     
    22832349    QString imagesPath = fullPath + "/images";
    22842350    QStringList imageFiles = Config::getFilesHere(imagesPath,exampleImageFilter);
    2285 
    2286 #if 0   
    2287     qDebug() << "examplePath:" << examplePath;
    2288     qDebug() << " exampleFiles" <<  exampleFiles;
    2289     qDebug() << "imagesPath:" << imagesPath;
    2290     qDebug() << "fullPath:" << fullPath;
    2291     qDebug() << " imageFiles" <<  imageFiles;
    2292 #endif   
    22932351
    22942352    if (!exampleFiles.isEmpty()) {
     
    23042362            }
    23052363            else if (fileName.contains("/qrc_") || fileName.contains("/moc_")
    2306                     || fileName.contains("/ui_"))
     2364                || fileName.contains("/ui_"))
    23072365                i.remove();
    23082366        }
     
    23112369
    23122370        // add any qmake Qt resource files and qmake project files
    2313         exampleFiles += Config::getFilesHere(fullPath, "*.qrc *.pro");
     2371        exampleFiles += Config::getFilesHere(fullPath, "*.qrc *.pro qmldir");
    23142372    }
    23152373
  • trunk/tools/qdoc3/cppcodeparser.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    120120    QString lexeme();
    121121    bool match(int target);
     122    bool skipTo(int target);
    122123    bool matchCompat();
    123124    bool matchTemplateAngles(CodeChunk *type = 0);
  • trunk/tools/qdoc3/cpptoqsconverter.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/cpptoqsconverter.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/dcfsection.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/dcfsection.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/doc.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    27472747}
    27482748
    2749 #if notyet // ###
    2750 Doc::SectioningUnit Doc::sectioningUnit() const
    2751 {
    2752     if (priv == 0 || priv->extra == 0) {
    2753         return DocPrivateExtra().sectioningUnit;
    2754     }
    2755     else {
    2756         return priv->extra->sectioningUnit;
    2757     }
    2758 }
    2759 #endif
    2760 
    27612749const QSet<QString> &Doc::parameterNames() const
    27622750{
     
    30373025    result.reserve(title.size());
    30383026
    3039     bool slurping = false;
     3027    bool dashAppended = false;
    30403028    bool begun = false;
    30413029    int lastAlnum = 0;
     
    30483036            result += QLatin1Char(c);
    30493037            begun = true;
    3050             slurping = false;
     3038            dashAppended = false;
    30513039            lastAlnum = result.size();
    30523040        }
    3053         else if (!slurping) {
     3041        else if (!dashAppended) {
    30543042            if (begun)
    30553043                result += QLatin1Char('-');
    3056             slurping = true;
     3044            dashAppended = true;
    30573045        }
     3046#if 0
     3047        // This was screwing things up.
    30583048        else {
    3059             // !alnum && slurping -> nothin
     3049            result += title[i];
     3050            lastAlnum = result.size();
    30603051        }
     3052#endif       
    30613053    }
    30623054    result.truncate(lastAlnum);
  • trunk/tools/qdoc3/doc.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4949#include <QSet>
    5050#include <QString>
     51#include <QMap>
    5152
    5253#include "location.h"
  • trunk/tools/qdoc3/editdistance.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/editdistance.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/generator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4343  generator.cpp
    4444*/
    45 #include <QtCore>
    4645#include <qdir.h>
    4746#include <qdebug.h>
     
    6867QStringList Generator::exampleDirs;
    6968QStringList Generator::exampleImgExts;
     69QStringList Generator::scriptFiles;
     70QStringList Generator::scriptDirs;
     71QStringList Generator::styleFiles;
     72QStringList Generator::styleDirs;
    7073QString Generator::outDir;
    7174QString Generator::project;
     
    126129            config.lastLocation().fatal(tr("Cannot create output directory '%1'")
    127130                                        .arg(outDir + "/images/used-in-examples"));
     131        if (!dirInfo.mkdir(outDir + "/scripts"))
     132            config.lastLocation().fatal(tr("Cannot create output directory '%1'")
     133                                        .arg(outDir + "/scripts"));
     134        if (!dirInfo.mkdir(outDir + "/style"))
     135            config.lastLocation().fatal(tr("Cannot create output directory '%1'")
     136                                        .arg(outDir + "/style"));
    128137    }
    129138
    130139    imageFiles = config.getStringList(CONFIG_IMAGES);
    131140    imageDirs = config.getStringList(CONFIG_IMAGEDIRS);
     141    scriptFiles = config.getStringList(CONFIG_SCRIPTS);
     142    scriptDirs = config.getStringList(CONFIG_SCRIPTDIRS);
     143    styleFiles = config.getStringList(CONFIG_STYLES);
     144    styleDirs = config.getStringList(CONFIG_STYLEDIRS);
    132145    exampleDirs = config.getStringList(CONFIG_EXAMPLEDIRS);
    133146    exampleImgExts = config.getStringList(CONFIG_EXAMPLES + Config::dot +
     
    167180                ++e;
    168181            }
     182
     183            QStringList noExts;
     184            QStringList scripts =
     185                config.getStringList(CONFIG_SCRIPTS+Config::dot+(*g)->format());
     186            e = scripts.begin();
     187            while (e != scripts.end()) {
     188                QString userFriendlyFilePath;
     189                QString filePath = Config::findFile(config.lastLocation(),
     190                                                    scriptFiles,
     191                                                    scriptDirs,
     192                                                    *e,
     193                                                    noExts,
     194                                                    userFriendlyFilePath);
     195                if (!filePath.isEmpty())
     196                    Config::copyFile(config.lastLocation(),
     197                                     filePath,
     198                                     userFriendlyFilePath,
     199                                     (*g)->outputDir() +
     200                                     "/scripts");
     201                ++e;
     202            }
     203
     204            QStringList styles =
     205                config.getStringList(CONFIG_STYLES+Config::dot+(*g)->format());
     206            e = styles.begin();
     207            while (e != styles.end()) {
     208                QString userFriendlyFilePath;
     209                QString filePath = Config::findFile(config.lastLocation(),
     210                                                    styleFiles,
     211                                                    styleDirs,
     212                                                    *e,
     213                                                    noExts,
     214                                                    userFriendlyFilePath);
     215                if (!filePath.isEmpty())
     216                    Config::copyFile(config.lastLocation(),
     217                                     filePath,
     218                                     userFriendlyFilePath,
     219                                     (*g)->outputDir() +
     220                                     "/style");
     221                ++e;
     222            }
    169223        }
    170224        ++g;
     
    228282    imageDirs.clear();
    229283    outDir = "";
     284    QmlClassNode::clear();
    230285}
    231286
     
    323378
    324379    if (node->type() == Node::Function) {
    325 #if 0       
     380#if 0
    326381        const FunctionNode *func = (const FunctionNode *) node;
    327382        if (func->isOverload() && func->metaness() != FunctionNode::Ctor)
    328383            generateOverload(node, marker);
    329 #endif       
     384#endif
    330385    }
    331386    else if (node->type() == Node::Fake) {
     
    348403                generateReimplementedFrom(func, marker);
    349404        }
    350        
     405
    351406        if (!generateText(node->doc().body(), node, marker))
    352407            if (node->isReimp())
     
    453508            if (func->reimplementedFrom() != 0)
    454509                generateReimplementedFrom(func, marker);
    455 #endif           
     510#endif
    456511        }
    457512    }
     
    545600  files comprising the example, and the list of images used
    546601  by the example. The images are copied into a subtree of
    547   \c{...doc/html/images/used-in-examples/...} 
     602  \c{...doc/html/images/used-in-examples/...}
    548603 */
    549604void Generator::generateFileList(const FakeNode* fake,
     
    641696    }
    642697#endif
    643 
    644 void Generator::generateModuleWarning(const ClassNode *classe,
    645                                       CodeMarker *marker)
    646 {
    647     QString module = classe->moduleName();
    648     if (!module.isEmpty()) {
    649         Text text;
    650         if (!editionModuleMap["DesktopLight"].contains(module)) {
    651             text << Atom::ParaLeft
    652                  << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
    653                  << "This class is not part of the Qt GUI Framework Edition."
    654                  << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD)
    655                  << Atom::ParaRight;
    656         }
    657         else if (module == "Qt3Support") {
    658             text << Atom::ParaLeft
    659                  << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)
    660                  << "Note to Qt GUI Framework Edition users:"
    661                  << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD)
    662                  << " This class is only available in the "
    663                  << Atom(Atom::AutoLink, "Qt Full Framework Edition")
    664                  << "." << Atom::ParaRight;
    665         }
    666 
    667         generateText(text, classe, marker);
    668     }
    669 }
    670698
    671699QString Generator::indent(int level, const QString& markedCode)
     
    954982            NodeList::ConstIterator c = innerNode->childNodes().begin();
    955983            while (c != innerNode->childNodes().end()) {
    956                 switch ((*c)->threadSafeness()) {
    957                 case Node::Reentrant:
    958                     reentrant.append(*c);
    959                     if (threadSafeness == Node::ThreadSafe)
     984               
     985                if ((*c)->status() != Node::Obsolete){
     986                    switch ((*c)->threadSafeness()) {
     987                    case Node::Reentrant:
     988                        reentrant.append(*c);
     989                        if (threadSafeness == Node::ThreadSafe)
     990                            exceptions = true;
     991                        break;
     992                    case Node::ThreadSafe:
     993                        threadsafe.append(*c);
     994                        if (threadSafeness == Node::Reentrant)
     995                            exceptions = true;
     996                        break;
     997                    case Node::NonReentrant:
     998                        nonreentrant.append(*c);
    960999                        exceptions = true;
    961                     break;
    962                 case Node::ThreadSafe:
    963                     threadsafe.append(*c);
    964                     if (threadSafeness == Node::Reentrant)
    965                         exceptions = true;
    966                     break;
    967                 case Node::NonReentrant:
    968                     nonreentrant.append(*c);
    969                     exceptions = true;
    970                     break;
    971                 default:
    972                     break;
     1000                        break;
     1001                    default:
     1002                        break;
     1003                    }
    9731004                }
    9741005                ++c;
    9751006            }
    976             if (!exceptions) 
     1007            if (!exceptions)
    9771008                text << ".";
    9781009            else if (threadSafeness == Node::Reentrant) {
     
    10411072        text << Atom::ParaLeft
    10421073             << "This "
    1043              << typeString(node)
    1044              << " was introduced in ";
     1074             << typeString(node);
     1075        if (node->type() == Node::Enum)
     1076            text << " was introduced or modified in ";
     1077        else
     1078            text << " was introduced in ";
    10451079        if (project.isEmpty())
    10461080             text << "version";
     
    10611095         << "This function overloads ";
    10621096    QString t = node->name() + "()";
    1063     text << Atom::AutoLink << t 
     1097    text << Atom::AutoLink << t
    10641098         << Atom::ParaRight;
    10651099    generateText(text, node, marker);
     
    12141248}
    12151249
     1250void Generator::appendSortedQmlNames(Text& text,
     1251                                     const Node* base,
     1252                                     const NodeList& subs,
     1253                                     CodeMarker *marker)
     1254{
     1255    QMap<QString,Text> classMap;
     1256    int index = 0;
     1257
     1258#ifdef DEBUG_MULTIPLE_QDOCCONF_FILES
     1259    qDebug() << "Generator::appendSortedQmlNames():" << base->name() << "is inherited by...";
     1260#endif
     1261    for (int i = 0; i < subs.size(); ++i) {
     1262        Text t;
     1263#ifdef DEBUG_MULTIPLE_QDOCCONF_FILES
     1264        qDebug() << "    " << subs[i]->name();
     1265#endif
     1266        appendFullName(t, subs[i], base, marker);
     1267        classMap[t.toString().toLower()] = t;
     1268    }
     1269
     1270    QStringList names = classMap.keys();
     1271    names.sort();
     1272
     1273    foreach (const QString &name, names) {
     1274        text << classMap[name];
     1275        text << separator(index++, names.count());
     1276    }
     1277}
     1278
    12161279int Generator::skipAtoms(const Atom *atom, Atom::Type type) const
    12171280{
  • trunk/tools/qdoc3/generator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    125125                          const QString& tag);
    126126    void generateExampleFiles(const FakeNode *fake, CodeMarker *marker);
    127     void generateModuleWarning(const ClassNode *classe, CodeMarker *marker);
    128127
    129128    virtual int skipAtoms(const Atom *atom, Atom::Type type) const;
     
    171170                           CodeMarker *marker);
    172171
     172 protected:
     173    void appendSortedQmlNames(Text& text,
     174                              const Node* base,
     175                              const NodeList& subs,
     176                              CodeMarker *marker);
     177
     178 private:
    173179    QString amp;
    174180    QString lt;
     
    186192    static QStringList exampleDirs;
    187193    static QStringList exampleImgExts;
     194    static QStringList scriptFiles;
     195    static QStringList scriptDirs;
     196    static QStringList styleFiles;
     197    static QStringList styleDirs;
    188198    static QString outDir;
    189199    static QString project;
  • trunk/tools/qdoc3/helpprojectwriter.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4040****************************************************************************/
    4141
    42 #include <QtXml>
    4342#include <QHash>
    4443#include <QMap>
     44//#include <qdebug.h>
    4545
    4646#include "atom.h"
     
    5050#include "node.h"
    5151#include "tree.h"
     52#include <qdebug.h>
    5253
    5354QT_BEGIN_NAMESPACE
     
    9293            subproject.indexTitle = config.getString(subprefix + "indexTitle");
    9394            subproject.sortPages = config.getBool(subprefix + "sortPages");
     95            subproject.type = config.getString(subprefix + "type");
    9496            readSelectors(subproject, config.getStringList(subprefix + "selectors"));
    9597            project.subprojects[name] = subproject;
     
    118120    typeHash["variable"] = Node::Variable;
    119121    typeHash["target"] = Node::Target;
     122#ifdef QDOC_QML
     123    typeHash["qmlproperty"] = Node::QmlProperty;
     124    typeHash["qmlsignal"] = Node::QmlSignal;
     125    typeHash["qmlmethod"] = Node::QmlMethod;
     126#endif
    120127
    121128    QHash<QString, Node::SubType> subTypeHash;
     
    129136#ifdef QDOC_QML
    130137    subTypeHash["qmlclass"] = Node::QmlClass;
     138    subTypeHash["qmlpropertygroup"] = Node::QmlPropertyGroup;
     139    subTypeHash["qmlbasictype"] = Node::QmlBasicType;
    131140#endif
    132141
     
    178187    QStringList details;
    179188
    180     if (node->parent() && !node->parent()->name().isEmpty()) {
     189    if (node->type() == Node::QmlProperty) {
     190        // "name"
     191        details << node->name();
     192        // "id"
     193        details << node->parent()->parent()->name()+"::"+node->name();
     194    }
     195    else if (node->parent() && !node->parent()->name().isEmpty()) {
    181196        // "name"
    182197        if (node->type() == Node::Enum || node->type() == Node::Typedef)
     
    186201        // "id"
    187202        details << node->parent()->name()+"::"+node->name();
    188     } else if (node->type() == Node::Fake) {
     203    }
     204    else if (node->type() == Node::Fake) {
    189205        const FakeNode *fake = static_cast<const FakeNode *>(node);
    190 #ifdef QDOC_QML
    191206        if (fake->subType() == Node::QmlClass) {
    192207            details << (QmlClassNode::qmlOnly ? fake->name() : fake->fullTitle());
    193208            details << "QML." + fake->name();
    194         } else
    195 #endif
    196         {
     209        }
     210        else {
    197211            details << fake->fullTitle();
    198212            details << fake->fullTitle();
    199213        }
    200     } else {
     214    }
     215    else {
    201216        details << node->name();
    202217        details << node->name();
    203218    }
    204219    details << tree->fullDocumentLocation(node);
    205 
    206220    return details;
    207221}
    208222
    209223bool HelpProjectWriter::generateSection(HelpProject &project,
    210                         QXmlStreamWriter & /* writer */, const Node *node)
     224                                        QXmlStreamWriter & /* writer */,
     225                                        const Node *node)
    211226{
    212227    if (!node->url().isEmpty())
     
    227242        const FakeNode *fake = static_cast<const FakeNode *>(node);
    228243        objName = fake->fullTitle();
    229     } else
     244    }
     245    else
    230246        objName = tree->fullDocumentName(node);
    231 
     247   
    232248    // Only add nodes to the set for each subproject if they match a selector.
    233249    // Those that match will be listed in the table of contents.
     
    236252        SubProject subproject = project.subprojects[name];
    237253        // No selectors: accept all nodes.
    238         if (subproject.selectors.isEmpty())
     254        if (subproject.selectors.isEmpty()) {
    239255            project.subprojects[name].nodes[objName] = node;
     256        }
    240257        else if (subproject.selectors.contains(node->type())) {
    241258            // Accept only the node types in the selectors hash.
     
    248265                if (subproject.selectors[node->type()].contains(fakeNode->subType()) &&
    249266                    fakeNode->subType() != Node::ExternalPage &&
    250                     !fakeNode->fullTitle().isEmpty())
     267                    !fakeNode->fullTitle().isEmpty()) {
    251268
    252269                    project.subprojects[name].nodes[objName] = node;
     270                }
    253271            }
    254272        }
     
    291309
    292310        case Node::Property:
     311        case Node::QmlProperty:
     312        case Node::QmlSignal:
     313        case Node::QmlMethod:
    293314            project.keywords.append(keywordDetails(node));
    294315            break;
     
    401422    if (!generateSection(project, writer, node))
    402423        return;
    403 
     424   
    404425    if (node->isInnerNode()) {
    405426        const InnerNode *inner = static_cast<const InnerNode *>(node);
     
    410431            if (node->access() == Node::Private)
    411432                continue;
    412             if (node->type() == Node::Fake)
    413                 childMap[static_cast<const FakeNode *>(node)->fullTitle()] = node;
     433            if (node->type() == Node::Fake) {
     434                /*
     435                  Don't visit QML property group nodes,
     436                  but visit their children, which are all
     437                  QML property nodes.
     438                 */
     439                if (node->subType() == Node::QmlPropertyGroup) {
     440                    const InnerNode* inner = static_cast<const InnerNode*>(node);
     441                    foreach (const Node* n, inner->childNodes()) {
     442                        if (n->access() == Node::Private)
     443                            continue;
     444                        childMap[tree->fullDocumentName(n)] = n;
     445                    }
     446                }
     447                else
     448                    childMap[static_cast<const FakeNode *>(node)->fullTitle()] = node;
     449            }
    414450            else {
    415451                if (node->type() == Node::Function) {
     
    495531            writer.writeAttribute("ref", href);
    496532            writer.writeAttribute("title", fakeNode->fullTitle());
    497             //            qDebug() << "Title:" << fakeNode->fullTitle();
    498533           
    499             if (fakeNode->subType() == Node::HeaderFile) {
    500 
     534            if ((fakeNode->subType() == Node::HeaderFile) || (fakeNode->subType() == Node::QmlClass)) {
    501535                // Write subsections for all members, obsolete members and Qt 3
    502536                // members.
    503                 if (!project.memberStatus[node].isEmpty()) {
     537                if (!project.memberStatus[node].isEmpty() || (fakeNode->subType() == Node::QmlClass)) {
    504538                    QString membersPath = href.left(href.size()-5) + "-members.html";
    505539                    writer.writeStartElement("section");
     
    594628        SubProject subproject = project.subprojects[name];
    595629
    596         if (!name.isEmpty()) {
    597             writer.writeStartElement("section");
    598             QString indexPath = tree->fullDocumentLocation(tree->findFakeNodeByTitle(subproject.indexTitle));
    599             writer.writeAttribute("ref", HtmlGenerator::cleanRef(indexPath));
    600             writer.writeAttribute("title", subproject.title);
    601             project.files.insert(indexPath);
    602         }
    603         if (subproject.sortPages) {
    604             QStringList titles = subproject.nodes.keys();
    605             titles.sort();
    606             foreach (const QString &title, titles)
    607                 writeNode(project, writer, subproject.nodes[title]);
     630        if (subproject.type == QLatin1String("manual")) {
     631
     632            const FakeNode *indexPage = tree->findFakeNodeByTitle(subproject.indexTitle);
     633            if (indexPage) {
     634                Text indexBody = indexPage->doc().body();
     635                const Atom *atom = indexBody.firstAtom();
     636                QStack<int> sectionStack;
     637                bool inItem = false;
     638
     639                while (atom) {
     640                    switch (atom->type()) {
     641                    case Atom::ListLeft:
     642                        sectionStack.push(0);
     643                        break;
     644                    case Atom::ListRight:
     645                        if (sectionStack.pop() > 0)
     646                            writer.writeEndElement(); // section
     647                        break;
     648                    case Atom::ListItemLeft:
     649                        inItem = true;
     650                        break;
     651                    case Atom::ListItemRight:
     652                        inItem = false;
     653                        break;
     654                    case Atom::Link:
     655                        if (inItem) {
     656                            if (sectionStack.top() > 0)
     657                                writer.writeEndElement(); // section
     658
     659                            const FakeNode *page = tree->findFakeNodeByTitle(atom->string());
     660                            writer.writeStartElement("section");
     661                            QString indexPath = tree->fullDocumentLocation(page);
     662                            writer.writeAttribute("ref", HtmlGenerator::cleanRef(indexPath));
     663                            writer.writeAttribute("title", atom->string());
     664                            project.files.insert(indexPath);
     665
     666                            sectionStack.top() += 1;
     667                        }
     668                        break;
     669                    default:
     670                        ;
     671                    }
     672
     673                    if (atom == indexBody.lastAtom())
     674                        break;
     675                    atom = atom->next();
     676                }
     677            } else
     678                rootNode->doc().location().warning(
     679                    tr("Failed to find index: %1").arg(subproject.indexTitle)
     680                    );
     681
    608682        } else {
    609             // Find a contents node and navigate from there, using the NextLink values.
    610             foreach (const Node *node, subproject.nodes) {
    611                 QString nextTitle = node->links().value(Node::NextLink).first;
    612                 if (!nextTitle.isEmpty() &&
    613                     node->links().value(Node::ContentsLink).first.isEmpty()) {
    614 
    615                     FakeNode *nextPage = const_cast<FakeNode *>(tree->findFakeNodeByTitle(nextTitle));
    616 
    617                     // Write the contents node.
    618                     writeNode(project, writer, node);
    619 
    620                     while (nextPage) {
    621                         writeNode(project, writer, nextPage);
    622                         nextTitle = nextPage->links().value(Node::NextLink).first;
    623                         if(nextTitle.isEmpty())
    624                             break;
    625                         nextPage = const_cast<FakeNode *>(tree->findFakeNodeByTitle(nextTitle));
     683
     684            if (!name.isEmpty()) {
     685                writer.writeStartElement("section");
     686                QString indexPath = tree->fullDocumentLocation(tree->findFakeNodeByTitle(subproject.indexTitle));
     687                writer.writeAttribute("ref", HtmlGenerator::cleanRef(indexPath));
     688                writer.writeAttribute("title", subproject.title);
     689                project.files.insert(indexPath);
     690            }
     691            if (subproject.sortPages) {
     692                QStringList titles = subproject.nodes.keys();
     693                titles.sort();
     694                foreach (const QString &title, titles) {
     695                    writeNode(project, writer, subproject.nodes[title]);
     696                }
     697            } else {
     698                // Find a contents node and navigate from there, using the NextLink values.
     699                foreach (const Node *node, subproject.nodes) {
     700                    QString nextTitle = node->links().value(Node::NextLink).first;
     701                    if (!nextTitle.isEmpty() &&
     702                        node->links().value(Node::ContentsLink).first.isEmpty()) {
     703
     704                        FakeNode *nextPage = const_cast<FakeNode *>(tree->findFakeNodeByTitle(nextTitle));
     705
     706                        // Write the contents node.
     707                        writeNode(project, writer, node);
     708
     709                        while (nextPage) {
     710                            writeNode(project, writer, nextPage);
     711                            nextTitle = nextPage->links().value(Node::NextLink).first;
     712                            if(nextTitle.isEmpty())
     713                                break;
     714                            nextPage = const_cast<FakeNode *>(tree->findFakeNodeByTitle(nextTitle));
     715                        }
     716                        break;
    626717                    }
    627                     break;
    628                 }
    629             }
    630         }
    631 
    632         if (!name.isEmpty())
    633             writer.writeEndElement(); // section
     718                }
     719            }
     720
     721            if (!name.isEmpty())
     722                writer.writeEndElement(); // section
     723        }
    634724    }
    635725
  • trunk/tools/qdoc3/helpprojectwriter.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    6161    QHash<Node::Type, QSet<FakeNode::SubType> > selectors;
    6262    bool sortPages;
     63    QString type;
    6364    QHash<QString, const Node *> nodes;
    6465};
  • trunk/tools/qdoc3/htmlgenerator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4545
    4646#include "codemarker.h"
     47#include "codeparser.h"
    4748#include "helpprojectwriter.h"
    4849#include "htmlgenerator.h"
     
    5556#include <qlist.h>
    5657#include <qiterator.h>
     58#include <qtextcodec.h>
    5759
    5860QT_BEGIN_NAMESPACE
    5961
    6062#define COMMAND_VERSION                 Doc::alias("version")
     63int HtmlGenerator::id = 0;
     64bool HtmlGenerator::debugging_on = false;
     65
     66#if 0
     67QString HtmlGenerator::divNavTop = "<div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>";
     68#endif
     69
     70QString HtmlGenerator::divNavTop = "";
    6171
    6272QString HtmlGenerator::sinceTitles[] =
     
    7282        "    New Properties",
    7383        "    New Variables",
     84        "    New QML Elements",
    7485        "    New Qml Properties",
    7586        "    New Qml Signals",
     
    202213
    203214HtmlGenerator::HtmlGenerator()
    204     : helpProjectWriter(0), inLink(false), inContents(false),
    205       inSectionHeading(false), inTableHeader(false), numTableRows(0),
    206       threeColumnEnumValueTable(true), funcLeftParen("\\S(\\()"),
    207       myTree(0), slow(false), obsoleteLinks(false)
     215    : helpProjectWriter(0),
     216      inLink(false),
     217      inContents(false),
     218      inSectionHeading(false),
     219      inTableHeader(false),
     220      numTableRows(0),
     221      threeColumnEnumValueTable(true),
     222      application(Online),
     223      funcLeftParen("\\S(\\()"),
     224      myTree(0),
     225      slow(false),
     226      obsoleteLinks(false)
    208227{
    209228}
     
    249268                                  Config::dot +
    250269                                  HTMLGENERATOR_POSTHEADER);
     270    postPostHeader = config.getString(HtmlGenerator::format() +
     271                                      Config::dot +
     272                                      HTMLGENERATOR_POSTPOSTHEADER);
     273    creatorPostHeader = config.getString(HtmlGenerator::format() +
     274                                  Config::dot +
     275                                  HTMLGENERATOR_CREATORPOSTHEADER);
     276    creatorPostPostHeader = config.getString(HtmlGenerator::format() +
     277                                      Config::dot +
     278                                      HTMLGENERATOR_CREATORPOSTPOSTHEADER);
    251279    footer = config.getString(HtmlGenerator::format() +
    252280                              Config::dot +
     
    261289    project = config.getString(CONFIG_PROJECT);
    262290
     291    QString app = config.getString(CONFIG_APPLICATION);
     292    if (app == "online")
     293        application = Online;
     294    else if (app == "creator")
     295        application = Creator;
     296    else
     297        application = Creator;
     298
    263299    projectDescription = config.getString(CONFIG_DESCRIPTION);
    264300    if (projectDescription.isEmpty() && !project.isEmpty())
     
    266302
    267303    projectUrl = config.getString(CONFIG_URL);
     304
     305    outputEncoding = config.getString(CONFIG_OUTPUTENCODING);
     306    if (outputEncoding.isEmpty())
     307        outputEncoding = QLatin1String("ISO-8859-1");
     308    outputCodec = QTextCodec::codecForName(outputEncoding.toLocal8Bit());
     309
     310    naturalLanguage = config.getString(CONFIG_NATURALLANGUAGE);
     311    if (naturalLanguage.isEmpty())
     312        naturalLanguage = QLatin1String("en");
    268313
    269314    QSet<QString> editionNames = config.subVars(CONFIG_EDITION);
     
    322367void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker)
    323368{
    324     // Copy the stylesheets from the directory containing the qdocconf file.
    325     // ### This should be changed to use a special directory in doc/src.
    326     QStringList::ConstIterator styleIter = stylesheets.begin();
    327     QDir configPath = QDir::current();
    328     while (styleIter != stylesheets.end()) {
    329         QString filePath = configPath.absoluteFilePath(*styleIter);
    330         Config::copyFile(Location(), filePath, filePath, outputDir());
    331         ++styleIter;
    332     }
    333 
    334369    myTree = tree;
    335370    nonCompatClasses.clear();
     
    342377    legaleseTexts.clear();
    343378    serviceClasses.clear();
     379    qmlClasses.clear();
    344380    findAllClasses(tree->root());
    345381    findAllFunctions(tree->root());
    346382    findAllLegaleseTexts(tree->root());
    347383    findAllNamespaces(tree->root());
    348 #ifdef ZZZ_QDOC_QML
    349     findAllQmlClasses(tree->root());
    350 #endif
    351384    findAllSince(tree->root());
    352385
     
    390423                dcfQmakeRoot);
    391424
    392     generateIndex(project.toLower().simplified().replace(" ", "-"),
    393                   projectUrl,
    394                   projectDescription);
     425    QString fileBase = project.toLower().simplified().replace(" ", "-");
     426    generateIndex(fileBase, projectUrl, projectDescription);
     427    generatePageIndex(outputDir() + "/" + fileBase + ".pageindex", marker);
    395428
    396429    helpProjectWriter->generate(myTree);
     
    410443}
    411444
     445/*!
     446  Generate html from an instance of Atom.
     447 */
    412448int HtmlGenerator::generateAtom(const Atom *atom,
    413449                                const Node *relative,
     
    432468            }
    433469            else {
    434                 out() << protect(atom->string());
     470                out() << protectEnc(atom->string());
    435471            }
    436472        }
    437473        else {
    438             out() << protect(atom->string());
     474            out() << protectEnc(atom->string());
    439475        }
    440476        break;
     
    484520        out() << formattingLeftMap()[ATOM_FORMATTING_TELETYPE];
    485521        if (inLink) {
    486             out() << protect(plainCode(atom->string()));
     522            out() << protectEnc(plainCode(atom->string()));
    487523        }
    488524        else {
     
    492528        break;
    493529    case Atom::Code:
    494         out() << "<pre>"
     530        out() << "<pre class=\"highlightedCode brush: cpp\">"
    495531              << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
    496532                                                 marker,relative))
    497533              << "</pre>\n";
    498         break;
     534        break;
    499535#ifdef QDOC_QML
    500536    case Atom::Qml:
    501         out() << "<pre>"
     537        out() << "<pre class=\"highlightedCode brush: cpp\">"
    502538              << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
    503539                                                 marker,relative))
    504540              << "</pre>\n";
    505         break;
     541        break;
    506542#endif
    507543    case Atom::CodeNew:
    508544        out() << "<p>you can rewrite it as</p>\n"
    509               << "<pre>"
     545              << "<pre class=\"highlightedCode brush: cpp\">"
    510546              << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()),
    511547                                                 marker,relative))
     
    516552        // fallthrough
    517553    case Atom::CodeBad:
    518         out() << "<pre><font color=\"#404040\">"
    519               << trimmedTrailing(protect(plainCode(indent(codeIndent,atom->string()))))
    520               << "</font></pre>\n";
    521         break;
     554        out() << "<pre class=\"highlightedCode brush: cpp\">"
     555              << trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string()))))
     556              << "</pre>\n";
     557        break;
    522558    case Atom::FootnoteLeft:
    523559        // ### For now
     
    575611        }
    576612        else if (atom->string() == "classes") {
    577             generateCompactList(relative, marker, nonCompatClasses);
     613            generateCompactList(relative, marker, nonCompatClasses, true);
     614        }
     615        else if (atom->string() == "qmlclasses") {
     616            generateCompactList(relative, marker, qmlClasses, true);
    578617        }
    579618        else if (atom->string().contains("classesbymodule")) {
     
    623662        }
    624663        else if (atom->string() == "compatclasses") {
    625             generateCompactList(relative, marker, compatClasses);
     664            generateCompactList(relative, marker, compatClasses, false);
    626665        }
    627666        else if (atom->string() == "obsoleteclasses") {
    628             generateCompactList(relative, marker, obsoleteClasses);
     667            generateCompactList(relative, marker, obsoleteClasses, false);
    629668        }
    630669        else if (atom->string() == "functionindex") {
     
    635674        }
    636675        else if (atom->string() == "mainclasses") {
    637             generateCompactList(relative, marker, mainClasses);
     676            generateCompactList(relative, marker, mainClasses, true);
    638677        }
    639678        else if (atom->string() == "services") {
    640             generateCompactList(relative, marker, serviceClasses);
     679            generateCompactList(relative, marker, serviceClasses, false);
    641680        }
    642681        else if (atom->string() == "overviews") {
     
    677716            NewClassMaps::const_iterator ncmap;
    678717            ncmap = newClassMaps.find(atom->string());
     718            NewClassMaps::const_iterator nqcmap;
     719            nqcmap = newQmlClassMaps.find(atom->string());
    679720            if ((nsmap != newSinceMaps.constEnd()) && !nsmap.value().isEmpty()) {
    680721                QList<Section> sections;
    681722                QList<Section>::ConstIterator s;
    682723                for (int i=0; i<LastSinceType; ++i)
    683                     sections.append(Section(sinceTitle(i),QString(),QString()));
     724                    sections.append(Section(sinceTitle(i),QString(),QString(),QString()));
    684725
    685726                NodeMultiMap::const_iterator n = nsmap.value().constBegin();
     
    687728                    const Node* node = n.value();
    688729                    switch (node->type()) {
     730                      case Node::Fake:
     731                          if (node->subType() == Node::QmlClass) {
     732                              sections[QmlClass].appendMember((Node*)node);
     733                          }
     734                          break;
    689735                      case Node::Namespace:
    690736                          sections[Namespace].appendMember((Node*)node);
     
    769815                              << Doc::canonicalTitle((*s).name)
    770816                              << "\"></a>\n";
    771                         out() << "<h3>" << protect((*s).name) << "</h3>\n";
     817                        out() << "<h3>" << protectEnc((*s).name) << "</h3>\n";
    772818                        if (idx == Class)
    773                             generateCompactList(0, marker, ncmap.value(), QString("Q"));
     819                            generateCompactList(0, marker, ncmap.value(), false, QString("Q"));
     820                        else if (idx == QmlClass)
     821                            generateCompactList(0, marker, nqcmap.value(), false, QString("Q"));
    774822                        else if (idx == MemberFunction) {
    775823                            ParentMaps parentmaps;
     
    793841                                      << "\">";
    794842                                QStringList pieces = fullName(pmap.key(), 0, marker).split("::");
    795                                 out() << protect(pieces.last());
     843                                out() << protectEnc(pieces.last());
    796844                                out() << "</a>"  << ":</p>\n";
    797845
    798846                                generateSection(nlist, 0, marker, CodeMarker::Summary);
    799                                 out() << "<br />";
     847                                out() << "<br/>";
    800848                                ++pmap;
    801849                            }
     
    818866                text = atom->next()->string();
    819867            if (atom->type() == Atom::Image)
    820                 out() << "<p align=\"center\">";
     868                out() << "<p class=\"centerAlign\">";
    821869            if (fileName.isEmpty()) {
    822870                out() << "<font color=\"red\">[Missing image "
    823                       << protect(atom->string()) << "]</font>";
     871                      << protectEnc(atom->string()) << "]</font>";
    824872            }
    825873            else {
    826                 out() << "<img src=\"" << protect(fileName) << "\"";
     874                out() << "<img src=\"" << protectEnc(fileName) << "\"";
    827875                if (!text.isEmpty())
    828                     out() << " alt=\"" << protect(text) << "\"";
     876                    out() << " alt=\"" << protectEnc(text) << "\"";
    829877                out() << " />";
    830878                helpProjectWriter->addExtraFile(fileName);
     
    837885        break;
    838886    case Atom::LegaleseLeft:
    839         out() << "<div style=\"padding: 0.5em; background: #e0e0e0; color: black\">";
     887        out() << "<div class=\"LegaleseLeft\">";
    840888        break;
    841889    case Atom::LegaleseRight:
     
    843891        break;
    844892    case Atom::LineBreak:
    845         out() << "<br />";
     893        out() << "<br/>";
    846894        break;
    847895    case Atom::Link:
     
    879927            threeColumnEnumValueTable = isThreeColumnEnumValueTable(atom);
    880928            if (threeColumnEnumValueTable) {
    881                 out() << "<p><table class=\"valuelist\" border=\"1\" cellpadding=\"2\" "
    882                       << "cellspacing=\"1\" width=\"100%\">\n"
    883                       << "<tr><th width=\"25%\">Constant</th>"
    884                       << "<th width=\"15%\">Value</th>"
    885                       << "<th width=\"60%\">Description</th></tr>\n";
     929                out() << "<table class=\"valuelist\">";
     930                if (++numTableRows % 2 == 1)
     931                        out() << "<tr class=\"odd\">";
     932                else
     933                        out() << "<tr class=\"even\">";
     934
     935                out() << "<th class=\"tblConst\">Constant</th>"
     936                      << "<th class=\"tblval\">Value</th>"
     937                      << "<th class=\"tbldscr\">Description</th></tr>\n";
    886938            }
    887939            else {
    888                 out() << "<p><table  class=\"valuelist\" border=\"1\" cellpadding=\"2\" "
    889                       << "cellspacing=\"1\" width=\"40%\">\n"
    890                       << "<tr><th width=\"60%\">Constant</th><th "
    891                       << "width=\"40%\">Value</th></tr>\n";
     940                out() << "<table class=\"valuelist\">"
     941                      << "<tr><th class=\"tblConst\">Constant</th><th class=\"tblVal\">Value</th></tr>\n";
    892942            }
    893943        }
    894944        else {
    895             out() << "<ol type=";
     945            out() << "<ol class=";
    896946            if (atom->string() == ATOM_LIST_UPPERALPHA) {
    897947                out() << "\"A\"";
    898             }
     948            } /* why type? changed to */
    899949            else if (atom->string() == ATOM_LIST_LOWERALPHA) {
    900950                out() << "\"a\"";
     
    923973            // ### Trenton
    924974
    925             out() << "<tr><td valign=\"top\"><tt>"
    926                   << protect(plainCode(marker->markedUpEnumValue(atom->next()->string(),
     975            out() << "<tr><td  class=\"topAlign\"><tt>"
     976                  << protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(),
    927977                                                                 relative)))
    928                   << "</tt></td><td align=\"center\" valign=\"top\">";
     978                  << "</tt></td><td class=\" topAlign\">";
    929979
    930980            QString itemValue;
     
    937987                out() << "?";
    938988            else
    939                 out() << "<tt>" << protect(itemValue) << "</tt>";
     989                out() << "<tt>" << protectEnc(itemValue) << "</tt>";
    940990
    941991            skipAhead = 1;
     
    9521002        else if (atom->string() == ATOM_LIST_VALUE) {
    9531003            if (threeColumnEnumValueTable) {
    954                 out() << "</td><td valign=\"top\">";
     1004                out() << "</td><td  class=\"topAlign\">";
    9551005                if (matchAhead(atom, Atom::ListItemRight))
    9561006                    out() << "&nbsp;";
     
    9821032        }
    9831033        else if (atom->string() == ATOM_LIST_VALUE) {
    984             out() << "</table></p>\n";
     1034            out() << "</table>\n";
    9851035        }
    9861036        else {
     
    10271077                sectionNumber.last() = QString::number(sectionNumber.last().toInt() + 1);
    10281078            }
    1029             out() << "<a name=\"sec-" << sectionNumber.join("-") << "\"></a>\n";
     1079            out() << "<a name=\"sec-" << sectionNumber.join("-") << "\"></a>" << divNavTop << "\n";
    10301080        }
    10311081#else
    10321082        out() << "<a name=\"" << Doc::canonicalTitle(Text::sectionHeading(atom).toString())
    1033               << "\"></a>\n";
     1083              << "\"></a>" << divNavTop << "\n";
    10341084#endif
    10351085        break;
     
    10531103        }
    10541104        else {
    1055             out() << protect(atom->string());
     1105            out() << protectEnc(atom->string());
    10561106        }
    10571107        break;
     
    10631113        if (!atom->string().isEmpty()) {
    10641114            if (atom->string().contains("%"))
    1065                 out() << "<p><table class=\"generic\" width=\"" << atom->string() << "\" "
    1066                       << "align=\"center\" cellpadding=\"2\" "
    1067                       << "cellspacing=\"1\" border=\"0\">\n";
     1115                out() << "<table class=\"generic\">\n "; // width=\"" << atom->string() << "\">\n ";
    10681116            else {
    1069                 out() << "<p><table class=\"generic\" align=\"center\" cellpadding=\"2\" "
    1070                       << "cellspacing=\"1\" border=\"0\">\n";
     1117                out() << "<table class=\"generic\">\n";
    10711118            }
    10721119        }
    10731120        else {
    1074             out() << "<p><table class=\"generic\" align=\"center\" cellpadding=\"2\" "
    1075                   << "cellspacing=\"1\" border=\"0\">\n";
     1121            out() << "<table class=\"generic\">\n";
    10761122        }
    10771123        numTableRows = 0;
    10781124        break;
    10791125    case Atom::TableRight:
    1080         out() << "</table></p>\n";
     1126        out() << "</table>\n";
    10811127        break;
    10821128    case Atom::TableHeaderLeft:
    1083         out() << "<thead><tr valign=\"top\" class=\"qt-style\">";
     1129        out() << "<thead><tr class=\"qt-style topAlign\">";
    10841130        inTableHeader = true;
    10851131        break;
     
    10881134        if (matchAhead(atom, Atom::TableHeaderLeft)) {
    10891135            skipAhead = 1;
    1090             out() << "\n<tr valign=\"top\" class=\"qt-style\">";
     1136            out() << "\n<tr class=\"qt-style topAlign\">";
    10911137        }
    10921138        else {
     
    10971143    case Atom::TableRowLeft:
    10981144        if (++numTableRows % 2 == 1)
    1099             out() << "<tr valign=\"top\" class=\"odd\">";
     1145            out() << "<tr class=\"odd topAlign\">";
    11001146        else
    1101             out() << "<tr valign=\"top\" class=\"even\">";
     1147            out() << "<tr class=\"even topAlign\">";
    11021148        break;
    11031149    case Atom::TableRowRight:
     
    11071153        {
    11081154            if (inTableHeader)
    1109                 out() << "<th";
     1155                out() << "<th ";
    11101156            else
    1111                 out() << "<td";
     1157                out() << "<td ";
    11121158
    11131159            QStringList spans = atom->string().split(",");
     
    11171163                if (spans.at(1) != "1")
    11181164                    out() << " rowspan=\"" << spans.at(1) << "\"";
     1165            if (inTableHeader)
    11191166                out() << ">";
     1167            else
     1168                out() << "><p>";
    11201169            }
    11211170            if (matchAhead(atom, Atom::ParaLeft))
     
    11271176            out() << "</th>";
    11281177        else
    1129             out() << "</td>";
     1178            out() << "</p></td>";
    11301179        if (matchAhead(atom, Atom::ParaLeft))
    11311180            skipAhead = 1;
     
    11641213        break;
    11651214    case Atom::UnhandledFormat:
    1166         out() << "<font color=\"red\"><b>&lt;Missing HTML&gt;</b></font>";
     1215        out() << "<b class=\"redFont\">&lt;Missing HTML&gt;</b>";
    11671216        break;
    11681217    case Atom::UnknownCommand:
    1169         out() << "<font color=\"red\"><b><code>\\" << protect(atom->string())
    1170               << "</code></b></font>";
     1218        out() << "<b class=\"redFont\"><code>\\" << protectEnc(atom->string())
     1219              << "</code></b>";
    11711220        break;
    11721221#ifdef QDOC_QML
     
    11821231}
    11831232
     1233/*!
     1234  Generate a reference page for a C++ class.
     1235 */
    11841236void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
    11851237                                          CodeMarker *marker)
     
    11981250        rawTitle = marker->plainName(inner);
    11991251        fullTitle = marker->plainFullName(inner);
    1200         title = rawTitle + " Namespace Reference";
     1252        title = rawTitle + " Namespace";
    12011253    }
    12021254    else if (inner->type() == Node::Class) {
     
    12171269                     << Atom(Atom::LineBreak);
    12181270
    1219     QString fixedModule = inner->moduleName();
    1220     if (fixedModule == "Qt3SupportLight")
    1221         fixedModule = "Qt3Support";
    1222     if (!fixedModule.isEmpty())
    1223         subtitleText << "[" << Atom(Atom::AutoLink, fixedModule) << " module]";
    1224 
    1225     if (fixedModule.isEmpty()) {
    1226         QMultiMap<QString, QString> publicGroups = myTree->publicGroups();
    1227         QList<QString> groupNames = publicGroups.values(inner->name());
    1228         if (!groupNames.isEmpty()) {
    1229             qSort(groupNames.begin(), groupNames.end());
    1230             subtitleText << "[";
    1231             for (int j=0; j<groupNames.count(); j++) {
    1232                 subtitleText <<  Atom(Atom::AutoLink, groupNames[j]);
    1233                 if (j<groupNames.count()-1)
    1234                     subtitleText <<", ";
    1235             }
    1236             subtitleText << "]";
    1237         }
    1238     }
    1239 
    1240     generateHeader(title, inner, marker, true);
    1241     generateTitle(title, subtitleText, SmallSubTitle, inner, marker);
    1242 
    1243 #ifdef QDOC_QML
    1244     if (classe && !classe->qmlElement().isEmpty()) {
    1245         generateInstantiatedBy(classe,marker);
    1246     }
    1247 #endif
    1248    
     1271    generateHeader(title, inner, marker);
     1272    sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay);
     1273    generateTableOfContents(inner,marker,&sections);
     1274    generateTitle(title, subtitleText, SmallSubTitle, inner, marker);   
    12491275    generateBrief(inner, marker);
    12501276    generateIncludes(inner, marker);
    12511277    generateStatus(inner, marker);
    12521278    if (classe) {
    1253         generateModuleWarning(classe, marker);
    12541279        generateInherits(classe, marker);
    12551280        generateInheritedBy(classe, marker);
     1281#ifdef QDOC_QML
     1282        if (!classe->qmlElement().isEmpty()) {
     1283            generateInstantiatedBy(classe,marker);
     1284        }
     1285#endif
    12561286    }
    12571287    generateThreadSafeness(inner, marker);
     
    12831313    bool needOtherSection = false;
    12841314
    1285     sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay);
     1315    /*
     1316      sections is built above for the call to generateTableOfContents().
     1317     */
    12861318    s = sections.begin();
    12871319    while (s != sections.end()) {
     
    12921324        else {
    12931325            if (!s->members.isEmpty()) {
    1294                 out() << "<hr />\n";
     1326               // out() << "<hr />\n";
    12951327                out() << "<a name=\""
    12961328                      << registerRef((*s).name.toLower())
    1297                       << "\"></a>\n";
    1298                 out() << "<h2>" << protect((*s).name) << "</h2>\n";
     1329                      << "\"></a>" << divNavTop << "\n";
     1330                out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
    12991331                generateSection(s->members, inner, marker, CodeMarker::Summary);
    13001332            }
    13011333            if (!s->reimpMembers.isEmpty()) {
    13021334                QString name = QString("Reimplemented ") + (*s).name;
    1303                 out() << "<hr />\n";
     1335              //  out() << "<hr />\n";
    13041336                out() << "<a name=\""
    13051337                      << registerRef(name.toLower())
    1306                       << "\"></a>\n";
    1307                 out() << "<h2>" << protect(name) << "</h2>\n";
     1338                      << "\"></a>" << divNavTop << "\n";
     1339                out() << "<h2>" << protectEnc(name) << "</h2>\n";
    13081340                generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary);
    13091341            }
     
    13111343            if (!s->inherited.isEmpty()) {
    13121344                out() << "<ul>\n";
    1313                 generateSectionInheritedList(*s, inner, marker, true);
     1345                generateSectionInheritedList(*s, inner, marker);
    13141346                out() << "</ul>\n";
    13151347            }
     
    13311363    }
    13321364
    1333     out() << "<a name=\"" << registerRef("details") << "\"></a>\n";
     1365    out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << "\n";
    13341366
    13351367    if (!inner->doc().isEmpty()) {
    1336         out() << "<hr />\n"
     1368        generateExtractionMark(inner, DetailedDescriptionMark);
     1369        //out() << "<hr />\n"
     1370        out() << "<div class=\"descr\">\n" // QTBUG-9504
    13371371              << "<h2>" << "Detailed Description" << "</h2>\n";
    13381372        generateBody(inner, marker);
     1373        out() << "</div>\n"; // QTBUG-9504
    13391374        generateAlsoList(inner, marker);
     1375        generateExtractionMark(inner, EndMark);
    13401376    }
    13411377
     
    13431379    s = sections.begin();
    13441380    while (s != sections.end()) {
    1345         out() << "<hr />\n";
    1346         out() << "<h2>" << protect((*s).name) << "</h2>\n";
     1381        //out() << "<hr />\n";
     1382        if (!(*s).divClass.isEmpty())
     1383            out() << "<div class=\"" << (*s).divClass << "\">\n"; // QTBUG-9504
     1384        out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
    13471385
    13481386        NodeList::ConstIterator m = (*s).members.begin();
     
    13931431            ++m;
    13941432        }
     1433        if (!(*s).divClass.isEmpty())
     1434            out() << "</div>\n"; // QTBUG-9504
    13951435        ++s;
    13961436    }
     
    14191459}
    14201460
     1461/*!
     1462  Generate the html page for a qdoc file that doesn't map
     1463  to an underlying c++ file.
     1464 */
    14211465void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
    14221466{
     
    14291473    QList<Section>::const_iterator s;
    14301474
    1431     QString htmlTitle = fake->fullTitle();
     1475    QString fullTitle = fake->fullTitle();
     1476    QString htmlTitle = fullTitle;
    14321477    if (fake->subType() == Node::File && !fake->subTitle().isEmpty()) {
    14331478        subTitleSize = SmallSubTitle;
    14341479        htmlTitle += " (" + fake->subTitle() + ")";
    14351480    }
    1436 
    1437     generateHeader(htmlTitle, fake, marker, true);
    1438     generateTitle(fake->fullTitle(),
     1481    else if (fake->subType() == Node::QmlBasicType) {
     1482        fullTitle = "QML Basic Type: " + fullTitle;
     1483        htmlTitle = fullTitle;
     1484    }
     1485
     1486    generateHeader(htmlTitle, fake, marker);
     1487       
     1488    /*
     1489      Generate the TOC for the new doc format.
     1490      Don't generate a TOC for the home page.
     1491    */
     1492    const QmlClassNode* qml_cn = 0;
     1493    if (fake->subType() == Node::QmlClass) {
     1494        qml_cn = static_cast<const QmlClassNode*>(fake);
     1495        sections = marker->qmlSections(qml_cn,CodeMarker::Summary,0);
     1496        generateTableOfContents(fake,marker,&sections);
     1497    }
     1498    else if (fake->name() != QString("index.html"))
     1499        generateTableOfContents(fake,marker,0);
     1500
     1501    generateTitle(fullTitle,
    14391502                  Text() << fake->subTitle(),
    14401503                  subTitleSize,
     
    14481511
    14491512        if (moduleNamespaceMap.contains(fake->name())) {
     1513            out() << "<a name=\"" << registerRef("namespaces") << "\"></a>" << divNavTop << "\n";
    14501514            out() << "<h2>Namespaces</h2>\n";
    14511515            generateAnnotatedList(fake, marker, moduleNamespaceMap[fake->name()]);
    14521516        }
    14531517        if (moduleClassMap.contains(fake->name())) {
     1518            out() << "<a name=\"" << registerRef("classes") << "\"></a>" << divNavTop << "\n";
    14541519            out() << "<h2>Classes</h2>\n";
    14551520            generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]);
     
    15051570#ifdef QDOC_QML
    15061571    else if (fake->subType() == Node::QmlClass) {
    1507         const QmlClassNode* qml_cn = static_cast<const QmlClassNode*>(fake);
    15081572        const ClassNode* cn = qml_cn->classNode();
     1573        generateBrief(qml_cn, marker);
    15091574        generateQmlInherits(qml_cn, marker);
     1575        generateQmlInheritedBy(qml_cn, marker);
    15101576        generateQmlInstantiates(qml_cn, marker);
    1511         generateBrief(qml_cn, marker);
    1512         sections = marker->qmlSections(qml_cn,CodeMarker::Summary);
     1577
     1578        QString allQmlMembersLink = generateAllQmlMembersFile(qml_cn, marker);
     1579        if (!allQmlMembersLink.isEmpty()) {
     1580            out() << "<li><a href=\"" << allQmlMembersLink << "\">"
     1581                  << "List of all members, including inherited members</a></li>\n";
     1582        }
     1583
    15131584        s = sections.begin();
    15141585        while (s != sections.end()) {
    1515             out() << "<a name=\"" << registerRef((*s).name) << "\"></a>\n";
    1516             out() << "<h2>" << protect((*s).name) << "</h2>\n";
     1586            out() << "<a name=\"" << registerRef((*s).name.toLower())
     1587                  << "\"></a>" << divNavTop << "\n";
     1588            out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
    15171589            generateQmlSummary(*s,fake,marker);
    15181590            ++s;
    15191591        }
    15201592
    1521         out() << "<a name=\"" << registerRef("details") << "\"></a>\n";
     1593        generateExtractionMark(fake, DetailedDescriptionMark);
     1594        out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << "\n";
    15221595        out() << "<h2>" << "Detailed Description" << "</h2>\n";
    15231596        generateBody(fake, marker);
     
    15251598            generateQmlText(cn->doc().body(), cn, marker, fake->name());
    15261599        generateAlsoList(fake, marker);
    1527         out() << "<hr />\n";
    1528 
    1529         sections = marker->qmlSections(qml_cn,CodeMarker::Detailed);
     1600        generateExtractionMark(fake, EndMark);
     1601        //out() << "<hr />\n";
     1602
     1603        sections = marker->qmlSections(qml_cn,CodeMarker::Detailed,0);
    15301604        s = sections.begin();
    15311605        while (s != sections.end()) {
    1532             out() << "<h2>" << protect((*s).name) << "</h2>\n";
     1606            out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
    15331607            NodeList::ConstIterator m = (*s).members.begin();
    15341608            while (m != (*s).members.end()) {
    15351609                generateDetailedQmlMember(*m, fake, marker);
    1536                 out() << "<br />\n";
     1610                out() << "<br/>\n";
    15371611                fakeSection.keywords += qMakePair((*m)->name(),
    15381612                                                  linkForNode(*m,0));
     
    15491623    s = sections.begin();
    15501624    while (s != sections.end()) {
    1551         out() << "<a name=\"" << registerRef((*s).name) << "\"></a>\n";
    1552         out() << "<h2>" << protect((*s).name) << "</h2>\n";
     1625        out() << "<a name=\"" << registerRef((*s).name) << "\"></a>" << divNavTop << "\n";
     1626        out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
    15531627        generateSectionList(*s, fake, marker, CodeMarker::Summary);
    15541628        ++s;
     
    15571631    Text brief = fake->doc().briefText();
    15581632    if (fake->subType() == Node::Module && !brief.isEmpty()) {
    1559         out() << "<a name=\"" << registerRef("details") << "\"></a>\n";
     1633        generateExtractionMark(fake, DetailedDescriptionMark);
     1634        out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << "\n";
     1635        out() << "<div class=\"descr\">\n"; // QTBUG-9504
    15601636        out() << "<h2>" << "Detailed Description" << "</h2>\n";
    15611637    }
     1638    else {
     1639        generateExtractionMark(fake, DetailedDescriptionMark);
     1640        out() << "<div class=\"descr\"> <a name=\"" << registerRef("details") << "\"></a>\n"; // QTBUG-9504
     1641    }
    15621642
    15631643    generateBody(fake, marker);
     1644    out() << "</div>\n"; // QTBUG-9504
    15641645    generateAlsoList(fake, marker);
     1646    generateExtractionMark(fake, EndMark);
    15651647
    15661648    if (!fake->groupMembers().isEmpty()) {
     
    15781660    s = sections.begin();
    15791661    while (s != sections.end()) {
    1580         out() << "<hr />\n";
    1581         out() << "<h2>" << protect((*s).name) << "</h2>\n";
     1662        //out() << "<hr />\n";
     1663        out() << "<h2>" << protectEnc((*s).name) << "</h2>\n";
    15821664
    15831665        NodeList::ConstIterator m = (*s).members.begin();
     
    16151697}
    16161698
    1617 QString HtmlGenerator::fileExtension(const Node * /* node */)
     1699/*!
     1700  Returns "html" for this subclass of Generator.
     1701 */
     1702QString HtmlGenerator::fileExtension(const Node * /* node */) const
    16181703{
    16191704    return "html";
     1705}
     1706
     1707/*!
     1708  Output breadcrumb list in the html file.
     1709 */
     1710void HtmlGenerator::generateBreadCrumbs(const QString& title,
     1711                                        const Node *node,
     1712                                        CodeMarker *marker)
     1713{
     1714    Text breadcrumb;
     1715    if (node->type() == Node::Class) {
     1716        const ClassNode* cn = static_cast<const ClassNode*>(node);
     1717        QString name =  node->moduleName();
     1718        out() << "              <li><a href=\"modules.html\">Modules</a></li>";
     1719        if (!name.isEmpty()) {
     1720            out() << "              <li>";
     1721            breadcrumb << Atom(Atom::AutoLink,name);
     1722            generateText(breadcrumb, node, marker);
     1723            out() << "</li>\n";
     1724        }
     1725        if (!cn->name().isEmpty())
     1726            out() << "              <li>" << protectEnc(cn->name()) << "</li>\n";
     1727    }
     1728    else if (node->type() == Node::Fake) {
     1729        const FakeNode* fn = static_cast<const FakeNode*>(node);
     1730        if (node->subType() == Node::Module) {
     1731            out() << "              <li><a href=\"modules.html\">Modules</a></li>";
     1732            QString name =  node->name();
     1733            if (!name.isEmpty())
     1734                out() << "              <li>" << protectEnc(name) << "</li>\n";
     1735        }
     1736        else if (node->subType() == Node::Group) {
     1737            if (fn->name() == QString("modules"))
     1738                out() << "              <li>Modules</li>";
     1739            else {
     1740                out() << "              <li>" << protectEnc(title) << "</li>";
     1741            }
     1742        }
     1743        else if (node->subType() == Node::Page) {
     1744            if (fn->name() == QString("qdeclarativeexamples.html")) {
     1745                out() << "              <li><a href=\"all-examples.html\">Examples</a></li>";
     1746                out() << "              <li>QML Examples &amp; Demos</li>";
     1747            }
     1748            else if (fn->name().startsWith("examples-")) {
     1749                out() << "              <li><a href=\"all-examples.html\">Examples</a></li>";
     1750                out() << "              <li>" << protectEnc(title) << "</li>";
     1751            }
     1752            else if (fn->name() == QString("namespaces.html")) {
     1753                out() << "              <li>Namespaces</li>";
     1754            }
     1755            else {
     1756                out() << "              <li>" << protectEnc(title) << "</li>";
     1757            }
     1758        }
     1759        else if (node->subType() == Node::QmlClass) {
     1760            out() << "              <li><a href=\"qdeclarativeelements.html\">QML Elements</a></li>";
     1761            out() << "              <li>" << protectEnc(title) << "</li>";
     1762        }
     1763        else if (node->subType() == Node::Example) {
     1764            out() << "              <li><a href=\"all-examples.html\">Examples</a></li>";
     1765            QStringList sl = fn->name().split('/');
     1766            if (sl.contains("declarative"))
     1767                out() << "              <li><a href=\"qdeclarativeexamples.html\">QML Examples &amp; Demos</a></li>";
     1768            else {
     1769                QString name = protectEnc("examples-" + sl.at(0) + ".html"); // this generates an empty link
     1770                QString t = CodeParser::titleFromName(name);
     1771            }
     1772            out() << "              <li>" << protectEnc(title) << "</li>";
     1773        }
     1774    }
     1775    else if (node->type() == Node::Namespace) {
     1776        out() << "              <li><a href=\"namespaces.html\">Namespaces</a></li>";
     1777        out() << "              <li>" << protectEnc(title) << "</li>";
     1778    }
    16201779}
    16211780
    16221781void HtmlGenerator::generateHeader(const QString& title,
    16231782                                   const Node *node,
    1624                                    CodeMarker *marker,
    1625                                    bool mainPage)
    1626 {
    1627     out() << "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
    1628 
    1629     out() << "<!DOCTYPE html\n"
    1630              "    PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n"
    1631              "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
    1632 
     1783                                   CodeMarker *marker)
     1784{
     1785    out() << QString("<?xml version=\"1.0\" encoding=\"%1\"?>\n").arg(outputEncoding);
     1786    out() << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
     1787    out() << QString("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"%1\" lang=\"%1\">\n").arg(naturalLanguage);
     1788    out() << "<head>\n";
     1789    out() << "  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
    16331790    QString shortVersion;
    1634     if ((project != "Qtopia") && (project != "Qt Extended")) {
    1635         shortVersion = project + " " + shortVersion + ": ";
    1636         if (node && !node->doc().location().isEmpty())
    1637             out() << "<!-- " << node->doc().location().fileName() << " -->\n";
    1638 
    1639         shortVersion = myTree->version();
    1640         if (shortVersion.count(QChar('.')) == 2)
    1641             shortVersion.truncate(shortVersion.lastIndexOf(QChar('.')));
    1642         if (!shortVersion.isEmpty()) {
    1643             if (project == "QSA")
    1644                 shortVersion = "QSA " + shortVersion + ": ";
    1645             else
    1646                 shortVersion = "Qt " + shortVersion + ": ";
    1647         }
    1648     }
    1649 
    1650     out() << "<head>\n"
    1651              "  <title>" << shortVersion << protect(title) << "</title>\n";
    1652     if (!style.isEmpty())
    1653         out() << "    <style type=\"text/css\">" << style << "</style>\n";
    1654 
    1655     const QMap<QString, QString> &metaMap = node->doc().metaTagMap();
    1656     if (!metaMap.isEmpty()) {
    1657         QMapIterator<QString, QString> i(metaMap);
    1658         while (i.hasNext()) {
    1659             i.next();
    1660             out() << "    <meta name=\"" << protect(i.key()) << "\" contents=\""
    1661                   << protect(i.value()) << "\" />\n";
    1662         }
    1663     }
    1664 
    1665     navigationLinks.clear();
     1791    shortVersion = project + " " + shortVersion + ": ";
     1792    if (node && !node->doc().location().isEmpty())
     1793        out() << "<!-- " << node->doc().location().fileName() << " -->\n";
     1794
     1795    shortVersion = myTree->version();
     1796    if (shortVersion.count(QChar('.')) == 2)
     1797        shortVersion.truncate(shortVersion.lastIndexOf(QChar('.')));
     1798    if (!shortVersion.isEmpty()) {
     1799        if (project == "QSA")
     1800            shortVersion = "QSA " + shortVersion + ": ";
     1801        else
     1802            shortVersion = "Qt " + shortVersion + ": ";
     1803    }
     1804
     1805    // Generating page title
     1806    out() << "  <title>" << shortVersion << protectEnc(title) << "</title>\n";
     1807    // Adding style sheet
     1808    out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />\n";
     1809    // Adding jquery and functions - providing online tools and search features
     1810    out() << "  <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n";
     1811    out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
     1812
     1813
     1814    // Adding syntax highlighter         // future release
     1815
     1816    // Setting some additional style sheet related details depending on configuration (e.g. Online/Creator)
     1817
     1818    switch (application) {
     1819    case Online:
     1820    // Adding style and js for small windows
     1821        out() << "  <script src=\"./scripts/superfish.js\" type=\"text/javascript\"></script>\n";
     1822        out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/superfish.css\" />";
     1823        out() << "  <script src=\"./scripts/narrow.js\" type=\"text/javascript\"></script>\n";
     1824        out() << "  <link rel=\"stylesheet\" type=\"text/css\" href=\"style/narrow.css\" />\n";
     1825        // Browser spec styles
     1826        out() << "  <!--[if IE]>\n";
     1827        out() << "<meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n";
     1828        out() << "<meta http-equiv=\"imagetoolbar\" content=\"no\">\n";
     1829        out() << "<![endif]-->\n";
     1830        out() << "<!--[if lt IE 7]>\n";
     1831        out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n";
     1832        out() << "<![endif]-->\n";
     1833        out() << "<!--[if IE 7]>\n";
     1834        out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n";
     1835        out() << "<![endif]-->\n";
     1836        out() << "<!--[if IE 8]>\n";
     1837        out() << "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n";
     1838        out() << "<![endif]-->\n";
     1839
     1840        out() << "</head>\n";
     1841        // CheckEmptyAndLoadList activating search
     1842        out() << "<body class=\"\" onload=\"CheckEmptyAndLoadList();\">\n";
     1843        break;
     1844    case Creator:
     1845        out() << "</head>\n";
     1846        out() << "<body class=\"offline narrow creator\">\n"; // offline narrow
     1847        break;
     1848    default:
     1849        out() << "</head>\n";
     1850        out() << "<body>\n";
     1851        break;
     1852    }
     1853
     1854#ifdef GENERATE_MAC_REFS   
     1855    if (mainPage)
     1856        generateMacRef(node, marker);
     1857#endif   
     1858 
     1859    switch (application) {
     1860    case Online:
     1861        out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version());
     1862        generateBreadCrumbs(title,node,marker);
     1863        out() << QString(postPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
     1864        break;
     1865    case Creator:
     1866        out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
     1867        generateBreadCrumbs(title,node,marker);
     1868        out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
     1869        break;
     1870    default: // default -- not used except if one forgets to set any of the above settings to true
     1871        out() << QString(creatorPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
     1872        generateBreadCrumbs(title,node,marker);
     1873        out() << QString(creatorPostPostHeader).replace("\\" + COMMAND_VERSION, myTree->version());
     1874        break;
     1875    }
     1876
     1877        navigationLinks.clear();
    16661878
    16671879    if (node && !node->links().empty()) {
     
    16881900            navigationLinks += "</a>]\n";
    16891901        }
    1690         if (node->links().contains(Node::ContentsLink)) {
    1691             linkPair = node->links()[Node::ContentsLink];
    1692             linkNode = findNodeForTarget(linkPair.first, node, marker);
    1693             if (!linkNode || linkNode == node)
    1694                 anchorPair = linkPair;
    1695             else
    1696                 anchorPair = anchorForNode(linkNode);
    1697 
    1698             out() << "  <link rel=\"contents\" href=\""
    1699                   << anchorPair.first << "\" />\n";
    1700 
    1701             navigationLinks += "[<a href=\"" + anchorPair.first + "\">";
    1702             if (linkPair.first == linkPair.second && !anchorPair.second.isEmpty())
    1703                 navigationLinks += protect(anchorPair.second);
    1704             else
    1705                 navigationLinks += protect(linkPair.second);
    1706             navigationLinks += "</a>]\n";
    1707         }
    17081902        if (node->links().contains(Node::NextLink)) {
    17091903            linkPair = node->links()[Node::NextLink];
     
    17231917                navigationLinks += protect(linkPair.second);
    17241918            navigationLinks += "</a>]\n";
    1725         }
    1726         if (node->links().contains(Node::IndexLink)) {
    1727             linkPair = node->links()[Node::IndexLink];
    1728             linkNode = findNodeForTarget(linkPair.first, node, marker);
    1729             if (!linkNode || linkNode == node)
    1730                 anchorPair = linkPair;
    1731             else
    1732                 anchorPair = anchorForNode(linkNode);
    1733             out() << "  <link rel=\"index\" href=\""
    1734                   << anchorPair.first << "\" />\n";
    17351919        }
    17361920        if (node->links().contains(Node::StartLink)) {
     
    17461930    }
    17471931
    1748     foreach (const QString &stylesheet, stylesheets) {
    1749         out() << "  <link href=\"" << stylesheet << "\" rel=\"stylesheet\" "
    1750               << "type=\"text/css\" />\n";
    1751     }
    1752 
    1753     foreach (const QString &customHeadElement, customHeadElements) {
    1754         out() << "  " << customHeadElement << "\n";
    1755     }
    1756 
    1757     out() << "</head>\n"
    1758              "<body>\n";
    1759     if (mainPage)
    1760         generateMacRef(node, marker);
    1761     out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version());
    1762 
    1763 
    17641932    if (node && !node->links().empty())
    1765         out() << "<p>\n" << navigationLinks << "</p>\n";
     1933        out() << "<p class=\"naviNextPrevious headerNavi\">\n" << navigationLinks << "</p><p/>\n";
    17661934}
    17671935
     
    17721940                                  CodeMarker *marker)
    17731941{
    1774     out() << "<h1 class=\"title\">" << protect(title);
     1942    if (!title.isEmpty())
     1943        out() << "<h1 class=\"title\">" << protectEnc(title) << "</h1>\n";
    17751944    if (!subTitle.isEmpty()) {
    1776         out() << "<br />";
     1945        out() << "<span";
    17771946        if (subTitleSize == SmallSubTitle)
    1778             out() << "<span class=\"small-subtitle\">";
     1947            out() << " class=\"small-subtitle\">";
    17791948        else
    1780             out() << "<span class=\"subtitle\">";
     1949            out() << " class=\"subtitle\">";
    17811950        generateText(subTitle, relative, marker);
    17821951        out() << "</span>\n";
    17831952    }
    1784     out() << "</h1>\n";
    17851953}
    17861954
     
    17881956{
    17891957    if (node && !node->links().empty())
    1790         out() << "<p>\n" << navigationLinks << "</p>\n";
     1958        out() << "<p class=\"naviNextPrevious footerNavi\">\n" << navigationLinks << "</p>\n";
    17911959
    17921960    out() << QString(footer).replace("\\" + COMMAND_VERSION, myTree->version())
    1793           << QString(address).replace("\\" + COMMAND_VERSION, myTree->version())
    1794           << "</body>\n"
    1795              "</html>\n";
     1961          << QString(address).replace("\\" + COMMAND_VERSION, myTree->version());
     1962
     1963    switch (application) {
     1964    case Online:
     1965        out() << "  <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n";
     1966        out() << "  <script type=\"text/javascript\">\n";
     1967        out() << "  var _gaq = _gaq || [];\n";
     1968        out() << "  _gaq.push(['_setAccount', 'UA-4457116-5']);\n";
     1969        out() << "  _gaq.push(['_trackPageview']);\n";
     1970        out() << "  (function() {\n";
     1971        out() << "  var ga = document.createElement('script'); ";
     1972        out() << "ga.type = 'text/javascript'; ga.async = true;\n";
     1973        out() << "  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + ";
     1974        out() << "'.google-analytics.com/ga.js';\n";
     1975        out() << "  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n";
     1976        out() << "  })();\n";
     1977        out() << "  </script>\n";
     1978        out() << "</body>\n";
     1979        break;
     1980    case Creator:
     1981        out() << "</body>\n";
     1982        break;
     1983    default:
     1984        out() << "</body>\n";
     1985    }
     1986          out() <<   "</html>\n";
    17961987}
    17971988
     
    18011992    Text brief = node->doc().briefText();
    18021993    if (!brief.isEmpty()) {
     1994        generateExtractionMark(node, BriefMark);
    18031995        out() << "<p>";
    18041996        generateText(brief, node, marker);
     1997
    18051998        if (!relative || node == relative)
    18061999            out() << " <a href=\"#";
     
    18082001            out() << " <a href=\"" << linkForNode(node, relative) << "#";
    18092002        out() << registerRef("details") << "\">More...</a></p>\n";
     2003
     2004
     2005        generateExtractionMark(node, EndMark);
    18102006    }
    18112007}
     
    18142010{
    18152011    if (!inner->includes().isEmpty()) {
    1816         out() << "<pre>"
     2012        out() << "<pre class=\"highlightedCode brush: cpp\">"
    18172013              << trimmedTrailing(highlightedCode(indent(codeIndent,
    18182014                                                        marker->markedUpIncludes(inner->includes())),
     
    18222018}
    18232019
     2020/*!
     2021  Generates a table of contents beginning at \a node.
     2022 */
    18242023void HtmlGenerator::generateTableOfContents(const Node *node,
    18252024                                            CodeMarker *marker,
     
    18292028
    18302029{
     2030    return;
    18312031    if (!node->doc().hasTableOfContents())
    18322032        return;
     
    18442044    QString tdTag;
    18452045    if (numColumns > 1) {
    1846         tdTag = "<td width=\"" + QString::number((100 + numColumns - 1) / numColumns) + "%\">";
    1847         out() << "<p><table class=\"toc\" width=\"100%\">\n<tr valign=\"top\">"
     2046        tdTag = "<td>"; /* width=\"" + QString::number((100 + numColumns - 1) / numColumns) + "%\">";*/
     2047        out() << "<table class=\"toc\">\n<tr class=\"topAlign\">"
    18482048              << tdTag << "\n";
    18492049    }
     
    18972097
    18982098    if (numColumns > 1)
    1899         out() << "</td></tr></table></p>\n";
    1900 
     2099        out() << "</td></tr></table>\n";
     2100
     2101    inContents = false;
     2102    inLink = false;
     2103}
     2104
     2105/*!
     2106  Revised for the new doc format.
     2107  Generates a table of contents beginning at \a node.
     2108 */
     2109void HtmlGenerator::generateTableOfContents(const Node *node,
     2110                                            CodeMarker *marker,
     2111                                            QList<Section>* sections)
     2112{
     2113    QList<Atom*> toc;
     2114    if (node->doc().hasTableOfContents())
     2115        toc = node->doc().tableOfContents();
     2116    if (toc.isEmpty() && !sections && (node->subType() != Node::Module))
     2117        return;
     2118
     2119    QStringList sectionNumber;
     2120    int detailsBase = 0;
     2121
     2122    // disable nested links in table of contents
     2123    inContents = true;
     2124    inLink = true;
     2125
     2126    out() << "<div class=\"toc\">\n";
     2127    out() << "<h3><a name=\"toc\">Contents</a></h3>\n";
     2128    sectionNumber.append("1");
     2129    out() << "<ul>\n";
     2130
     2131    if (node->subType() == Node::Module) {
     2132        if (moduleNamespaceMap.contains(node->name())) {
     2133            out() << "<li class=\"level"
     2134                  << sectionNumber.size()
     2135                  << "\"><a href=\"#"
     2136                  << registerRef("namespaces")
     2137                  << "\">Namespaces</a></li>\n";
     2138        }
     2139        if (moduleClassMap.contains(node->name())) {
     2140            out() << "<li class=\"level"
     2141                  << sectionNumber.size()
     2142                  << "\"><a href=\"#"
     2143                  << registerRef("classes")
     2144                  << "\">Classes</a></li>\n";
     2145        }
     2146        out() << "<li class=\"level"
     2147              << sectionNumber.size()
     2148              << "\"><a href=\"#"
     2149              << registerRef("details")
     2150              << "\">Detailed Description</a></li>\n";
     2151        for (int i = 0; i < toc.size(); ++i) {
     2152            if (toc.at(i)->string().toInt() == 1) {
     2153                detailsBase = 1;
     2154                break;
     2155            }
     2156        }
     2157    }
     2158    else if (sections && ((node->type() == Node::Class) ||
     2159                          (node->type() == Node::Namespace) ||
     2160                          (node->subType() == Node::QmlClass))) {
     2161        QList<Section>::ConstIterator s = sections->begin();
     2162        while (s != sections->end()) {
     2163            if (!s->members.isEmpty() || !s->reimpMembers.isEmpty()) {
     2164                out() << "<li class=\"level"
     2165                      << sectionNumber.size()
     2166                      << "\"><a href=\"#"
     2167                      << registerRef((*s).pluralMember)
     2168                      << "\">" << (*s).name
     2169                      << "</a></li>\n";
     2170            }
     2171            ++s;
     2172        }
     2173        out() << "<li class=\"level"
     2174              << sectionNumber.size()
     2175              << "\"><a href=\"#"
     2176              << registerRef("details")
     2177              << "\">Detailed Description</a></li>\n";
     2178        for (int i = 0; i < toc.size(); ++i) {
     2179            if (toc.at(i)->string().toInt() == 1) {
     2180                detailsBase = 1;
     2181                break;
     2182            }
     2183        }
     2184    }
     2185
     2186    for (int i = 0; i < toc.size(); ++i) {
     2187        Atom *atom = toc.at(i);
     2188        int nextLevel = atom->string().toInt() + detailsBase;
     2189        if (sectionNumber.size() < nextLevel) {
     2190            do {
     2191                sectionNumber.append("1");
     2192            } while (sectionNumber.size() < nextLevel);
     2193        }
     2194        else {
     2195            while (sectionNumber.size() > nextLevel) {
     2196                sectionNumber.removeLast();
     2197            }
     2198            sectionNumber.last() = QString::number(sectionNumber.last().toInt() + 1);
     2199        }
     2200        int numAtoms;
     2201        Text headingText = Text::sectionHeading(atom);
     2202        QString s = headingText.toString();
     2203        out() << "<li class=\"level"
     2204              << sectionNumber.size()
     2205              << "\">";
     2206        out() << "<a href=\""
     2207              << "#"
     2208              << Doc::canonicalTitle(s)
     2209              << "\">";
     2210        generateAtomList(headingText.firstAtom(), node, marker, true, numAtoms);
     2211        out() << "</a></li>\n";
     2212    }
     2213    while (!sectionNumber.isEmpty()) {
     2214        sectionNumber.removeLast();
     2215    }
     2216    out() << "</ul>\n";
     2217    out() << "</div>\n";
    19012218    inContents = false;
    19022219    inLink = false;
     
    19102227    if (bar.prev.begin() != 0 || bar.current.begin() != 0 ||
    19112228         bar.next.begin() != 0) {
    1912         out() << "<p align=\"right\">";
     2229        out() << "<p class=\"rightAlign\">";
    19132230        if (bar.prev.begin() != 0) {
    19142231#if 0
     
    19192236#endif
    19202237        }
    1921         if (bar.current.begin() != 0) {
    1922             out() << "[<a href=\"" << "home"
    1923                   << ".html\">Home</a>]\n";
    1924         }
    1925         if (bar.next.begin() != 0) {
    1926             out() << "[<a href=\"" << fileBase(node, bar.next)
    1927                   << ".html\">Next: ";
    1928             generateText(Text::sectionHeading(bar.next.begin()), node, marker);
    1929             out() << "</a>]\n";
    1930         }
    1931         out() << "</p>\n";
     2238        if (fake->name() != QString("index.html")) {
     2239            if (bar.current.begin() != 0) {
     2240                out() << "[<a href=\"" << "home"
     2241                      << ".html\">Home</a>]\n";
     2242            }
     2243            if (bar.next.begin() != 0) {
     2244                out() << "[<a href=\"" << fileBase(node, bar.next)
     2245                      << ".html\">Next: ";
     2246                generateText(Text::sectionHeading(bar.next.begin()), node, marker);
     2247                out() << "</a>]\n";
     2248            }
     2249            out() << "</p>\n";
     2250        }
    19322251    }
    19332252}
     
    19492268    beginSubPage(inner->location(), fileName);
    19502269    QString title = "List of All Members for " + inner->name();
    1951     generateHeader(title, inner, marker, false);
     2270    generateHeader(title, inner, marker);
    19522271    generateTitle(title, Text(), SmallSubTitle, inner, marker);
    19532272    out() << "<p>This is the complete list of members for ";
    19542273    generateFullName(inner, 0, marker);
     2274    out() << ", including inherited members.</p>\n";
     2275
     2276    Section section = sections.first();
     2277    generateSectionList(section, 0, marker, CodeMarker::SeparateList);
     2278
     2279    generateFooter();
     2280    endSubPage();
     2281    return fileName;
     2282}
     2283
     2284/*!
     2285  This function creates an html page on which are listed all
     2286  the members of QML class \a qml_cn, including the inherited
     2287  members. The \a marker is used for formatting stuff.
     2288 */
     2289QString HtmlGenerator::generateAllQmlMembersFile(const QmlClassNode* qml_cn,
     2290                                                 CodeMarker* marker)
     2291{
     2292    QList<Section> sections;
     2293    QList<Section>::ConstIterator s;
     2294
     2295    sections = marker->qmlSections(qml_cn,CodeMarker::SeparateList,myTree);
     2296    if (sections.isEmpty())
     2297        return QString();
     2298
     2299    QString fileName = fileBase(qml_cn) + "-members." + fileExtension(qml_cn);
     2300    beginSubPage(qml_cn->location(), fileName);
     2301    QString title = "List of All Members for " + qml_cn->name();
     2302    generateHeader(title, qml_cn, marker);
     2303    generateTitle(title, Text(), SmallSubTitle, qml_cn, marker);
     2304    out() << "<p>This is the complete list of members for ";
     2305    generateFullName(qml_cn, 0, marker);
    19552306    out() << ", including inherited members.</p>\n";
    19562307
     
    19932344
    19942345    beginSubPage(inner->location(), fileName);
    1995     generateHeader(title, inner, marker, false);
     2346    generateHeader(title, inner, marker);
    19962347    generateTitle(title, Text(), SmallSubTitle, inner, marker);
    19972348
     
    20102361    out() << "<p><ul><li><a href=\""
    20112362          << linkForNode(inner, 0) << "\">"
    2012           << protect(inner->name())
     2363          << protectEnc(inner->name())
    20132364          << " class reference</a></li></ul></p>\n";
    20142365
    20152366    for (i = 0; i < sections.size(); ++i) {
    2016         out() << "<h2>" << protect(sections.at(i).name) << "</h2>\n";
     2367        out() << "<h2>" << protectEnc(sections.at(i).name) << "</h2>\n";
    20172368        generateSectionList(sections.at(i), inner, marker, CodeMarker::Summary);
    20182369    }
     
    20202371    sections = marker->sections(inner, CodeMarker::Detailed, status);
    20212372    for (i = 0; i < sections.size(); ++i) {
    2022         out() << "<hr />\n";
    2023         out() << "<h2>" << protect(sections.at(i).name) << "</h2>\n";
     2373        //out() << "<hr />\n";
     2374        out() << "<h2>" << protectEnc(sections.at(i).name) << "</h2>\n";
    20242375
    20252376        NodeList::ConstIterator m = sections.at(i).members.begin();
     
    20862437                                          const NodeMap &nodeMap)
    20872438{
    2088     out() << "<p><table width=\"100%\" class=\"annotated\" cellpadding=\"2\" "
    2089           << "cellspacing=\"1\" border=\"0\">\n";
     2439    out() << "<table class=\"annotated\">\n";
    20902440
    20912441    int row = 0;
     
    20972447
    20982448        if (++row % 2 == 1)
    2099             out() << "<tr valign=\"top\" class=\"odd\">";
     2449            out() << "<tr class=\"odd topAlign\">";
    21002450        else
    2101             out() << "<tr valign=\"top\" class=\"even\">";
    2102         out() << "<th>";
     2451            out() << "<tr class=\"even topAlign\">";
     2452        out() << "<td class=\"tblName\"><p>";
    21032453        generateFullName(node, relative, marker);
    2104         out() << "</th>";
     2454        out() << "</p></td>";
    21052455
    21062456        if (!(node->type() == Node::Fake)) {
    21072457            Text brief = node->doc().trimmedBriefText(name);
    21082458            if (!brief.isEmpty()) {
    2109                 out() << "<td>";
     2459                out() << "<td class=\"tblDescr\"><p>";
    21102460                generateText(brief, node, marker);
    2111                 out() << "</td>";
     2461                out() << "</p></td>";
    21122462            }
    21132463        }
    21142464        else {
    2115             out() << "<td>";
    2116             out() << protect(node->doc().briefText().toString());
    2117             out() << "</td>";
     2465            out() << "<td class=\"tblDescr\"><p>";
     2466            out() << protectEnc(node->doc().briefText().toString());
     2467            out() << "</p></td>";
    21182468        }
    21192469        out() << "</tr>\n";
    21202470    }
    2121     out() << "</table></p>\n";
     2471    out() << "</table>\n";
    21222472}
    21232473
     
    21342484                                        CodeMarker *marker,
    21352485                                        const NodeMap &classMap,
     2486                                        bool includeAlphabet,
    21362487                                        QString commonPrefix)
    21372488{
    21382489    const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_'
    2139     const int NumColumns = 4; // number of columns in the result
    21402490
    21412491    if (classMap.isEmpty())
     
    22062556    NodeMap paragraph[NumParagraphs+1];
    22072557    QString paragraphName[NumParagraphs+1];
     2558    QSet<char> usedParagraphNames;
    22082559
    22092560    NodeMap::ConstIterator c = classMap.begin();
     
    22192570            key = pieces.last().toLower();
    22202571
    2221         int paragraphNo = NumParagraphs - 1;
     2572        int paragraphNr = NumParagraphs - 1;
    22222573
    22232574        if (key[0].digitValue() != -1) {
    2224             paragraphNo = key[0].digitValue();
     2575            paragraphNr = key[0].digitValue();
    22252576        }
    22262577        else if (key[0] >= QLatin1Char('a') && key[0] <= QLatin1Char('z')) {
    2227             paragraphNo = 10 + key[0].unicode() - 'a';
    2228         }
    2229 
    2230         paragraphName[paragraphNo] = key[0].toUpper();
    2231         paragraph[paragraphNo].insert(key, c.value());
     2578            paragraphNr = 10 + key[0].unicode() - 'a';
     2579        }
     2580
     2581        paragraphName[paragraphNr] = key[0].toUpper();
     2582        usedParagraphNames.insert(key[0].toLower().cell());
     2583        paragraph[paragraphNr].insert(key, c.value());
    22322584        ++c;
    22332585    }
     
    22422594    */
    22432595    int paragraphOffset[NumParagraphs + 1];     // 37 + 1
    2244     int i, j, k;
    2245 
    22462596    paragraphOffset[0] = 0;
    2247     for (j = 0; j < NumParagraphs; j++)         // j = 0..36
    2248         paragraphOffset[j + 1] = paragraphOffset[j] + paragraph[j].count();
    2249 
    2250     int firstOffset[NumColumns + 1];            // 4 + 1
    2251     int currentOffset[NumColumns];              // 4
    2252     int currentParagraphNo[NumColumns];         // 4
    2253     int currentOffsetInParagraph[NumColumns];   // 4
    2254 
    2255     int numRows = (classMap.count() + NumColumns - 1) / NumColumns;
    2256     int curParagNo = 0;
    2257 
    2258     for (i = 0; i < NumColumns; i++) {          // i = 0..3
    2259         firstOffset[i] = qMin(i * numRows, classMap.size());
    2260         currentOffset[i] = firstOffset[i];
    2261 
    2262         for (j = curParagNo; j < NumParagraphs; j++) {
    2263             if (paragraphOffset[j] > firstOffset[i])
    2264                 break;
    2265             if (paragraphOffset[j] <= firstOffset[i])
    2266                 curParagNo = j;
    2267         }
    2268         currentParagraphNo[i] = curParagNo;
    2269         currentOffsetInParagraph[i] = firstOffset[i] -
    2270                                       paragraphOffset[curParagNo];
    2271     }
    2272     firstOffset[NumColumns] = classMap.count();
    2273 
    2274     out() << "<p><table class=\"generic\" width=\"100%\">\n";
    2275     for (k = 0; k < numRows; k++) {
    2276         out() << "<tr>\n";
    2277         for (i = 0; i < NumColumns; i++) {
    2278             if (currentOffset[i] >= firstOffset[i + 1]) {
    2279                 // this column is finished
    2280                 out() << "<td>\n</td>\n";
    2281             }
    2282             else {
    2283                 while ((currentParagraphNo[i] < NumParagraphs) &&
    2284                        (currentOffsetInParagraph[i] == paragraph[currentParagraphNo[i]].count())) {
    2285                     ++currentParagraphNo[i];
    2286                     currentOffsetInParagraph[i] = 0;
    2287                 }
    2288 #if 0
    2289                 if (currentParagraphNo[i] >= NumParagraphs) {
    2290                     qDebug() << "### Internal error ###" << __FILE__ << __LINE__
    2291                              << currentParagraphNo[i] << NumParagraphs;
    2292                     currentParagraphNo[i] = NumParagraphs - 1;
    2293                 }
    2294 #endif
    2295                 out() << "<td align=\"right\">";
    2296                 if (currentOffsetInParagraph[i] == 0) {
    2297                     // start a new paragraph
    2298                     out() << "<b>"
    2299                           << paragraphName[currentParagraphNo[i]]
    2300                           << "&nbsp;</b>";
    2301                 }
    2302                 out() << "</td>\n";
    2303 
    2304                 out() << "<td>";
    2305                 if ((currentParagraphNo[i] < NumParagraphs) &&
    2306                     !paragraphName[currentParagraphNo[i]].isEmpty()) {
    2307                     NodeMap::Iterator it;
    2308                     it = paragraph[currentParagraphNo[i]].begin();
    2309                     for (j = 0; j < currentOffsetInParagraph[i]; j++)
    2310                         ++it;
    2311 
    2312                     // Previously, we used generateFullName() for this, but we
    2313                     // require some special formatting.
    2314                     out() << "<a href=\""
    2315                         << linkForNode(it.value(), relative)
    2316                         << "\">";
    2317                     QStringList pieces = fullName(it.value(), relative, marker).split("::");
    2318                     out() << protect(pieces.last());
    2319                     out() << "</a>";
    2320                     if (pieces.size() > 1) {
    2321                         out() << " (";
    2322                         generateFullName(it.value()->parent(), relative, marker);
    2323                         out() << ")";
    2324                     }
    2325                 }
    2326                 out() << "</td>\n";
    2327 
    2328                 currentOffset[i]++;
    2329                 currentOffsetInParagraph[i]++;
    2330             }
    2331         }
    2332         out() << "</tr>\n";
    2333     }
    2334     out() << "</table></p>\n";
     2597    for (int i=0; i<NumParagraphs; i++)         // i = 0..36
     2598        paragraphOffset[i+1] = paragraphOffset[i] + paragraph[i].count();
     2599
     2600    int curParNr = 0;
     2601    int curParOffset = 0;
     2602
     2603    /*
     2604      Output the alphabet as a row of links.
     2605     */
     2606    if (includeAlphabet) {
     2607        out() << "<p  class=\"centerAlign functionIndex\"><b>";
     2608        for (int i = 0; i < 26; i++) {
     2609            QChar ch('a' + i);
     2610            if (usedParagraphNames.contains(char('a' + i)))
     2611                out() << QString("<a href=\"#%1\">%2</a>&nbsp;").arg(ch).arg(ch.toUpper());
     2612        }
     2613        out() << "</b></p>\n";
     2614    }
     2615
     2616    /*
     2617      Output a <div> element to contain all the <dl> elements.
     2618     */
     2619    out() << "<div class=\"flowListDiv\">\n";
     2620
     2621    for (int i=0; i<classMap.count()-1; i++) {
     2622        while ((curParNr < NumParagraphs) &&
     2623               (curParOffset == paragraph[curParNr].count())) {
     2624            ++curParNr;
     2625            curParOffset = 0;
     2626        }
     2627
     2628        /*
     2629          Starting a new paragraph means starting a new <dl>.
     2630        */
     2631        if (curParOffset == 0) {
     2632            if (i > 0)
     2633                out() << "</dl>\n";
     2634            if (++numTableRows % 2 == 1)
     2635                out() << "<dl class=\"flowList odd\">";
     2636            else
     2637                out() << "<dl class=\"flowList even\">";
     2638            out() << "<dt class=\"alphaChar\">";
     2639            if (includeAlphabet) {
     2640                QChar c = paragraphName[curParNr][0].toLower();
     2641                out() << QString("<a name=\"%1\"></a>").arg(c);
     2642            }
     2643            out() << "<b>"
     2644                  << paragraphName[curParNr]
     2645                  << "</b>";
     2646            out() << "</dt>\n";
     2647        }
     2648
     2649        /*
     2650          Output a <dd> for the current offset in the current paragraph.
     2651         */
     2652        out() << "<dd>";
     2653        if ((curParNr < NumParagraphs) &&
     2654            !paragraphName[curParNr].isEmpty()) {
     2655            NodeMap::Iterator it;
     2656            it = paragraph[curParNr].begin();
     2657            for (int i=0; i<curParOffset; i++)
     2658                ++it;
     2659
     2660            /*
     2661              Previously, we used generateFullName() for this, but we
     2662              require some special formatting.
     2663            */
     2664            out() << "<a href=\"" << linkForNode(it.value(), relative) << "\">";
     2665           
     2666            QStringList pieces;
     2667            if (it.value()->subType() == Node::QmlClass)
     2668                pieces << it.value()->name();
     2669            else
     2670                pieces = fullName(it.value(), relative, marker).split("::");
     2671            out() << protectEnc(pieces.last());
     2672            out() << "</a>";
     2673            if (pieces.size() > 1) {
     2674                out() << " (";
     2675                generateFullName(it.value()->parent(), relative, marker);
     2676                out() << ")";
     2677            }
     2678        }
     2679        out() << "</dd>\n";
     2680        curParOffset++;
     2681    }
     2682    out() << "</dl>\n";
     2683    out() << "</div>\n";
    23352684}
    23362685
     
    23382687                                          CodeMarker *marker)
    23392688{
    2340     out() << "<p align=\"center\"><font size=\"+1\"><b>";
     2689    out() << "<p  class=\"centerAlign functionIndex\"><b>";
    23412690    for (int i = 0; i < 26; i++) {
    23422691        QChar ch('a' + i);
    23432692        out() << QString("<a href=\"#%1\">%2</a>&nbsp;").arg(ch).arg(ch.toUpper());
    23442693    }
    2345     out() << "</b></font></p>\n";
     2694    out() << "</b></p>\n";
    23462695
    23472696    char nextLetter = 'a';
     
    23582707        out() << "<p>";
    23592708#endif
    2360         out() << protect(f.key()) << ":";
     2709        out() << protectEnc(f.key()) << ":";
    23612710
    23622711        currentLetter = f.key()[0].unicode();
     
    23912740    while (it != legaleseTexts.end()) {
    23922741        Text text = it.key();
    2393         out() << "<hr />\n";
     2742        //out() << "<hr />\n";
    23942743        generateText(text, relative, marker);
    23952744        out() << "<ul>\n";
     
    24042753}
    24052754
    2406 /*void HtmlGenerator::generateSynopsis(const Node *node,
    2407                                      const Node *relative,
    2408                                      CodeMarker *marker,
    2409                                      CodeMarker::SynopsisStyle style)
    2410 {
    2411     QString marked = marker->markedUpSynopsis(node, relative, style);
    2412     QRegExp templateTag("(<[^@>]*>)");
    2413     if (marked.indexOf(templateTag) != -1) {
    2414         QString contents = protect(marked.mid(templateTag.pos(1),
    2415                                               templateTag.cap(1).length()));
    2416         marked.replace(templateTag.pos(1), templateTag.cap(1).length(),
    2417                         contents);
    2418     }
    2419     marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])</@param>"),
    2420                    "<i>\\1<sub>\\2</sub></i>");
    2421     marked.replace("<@param>", "<i>");
    2422     marked.replace("</@param>", "</i>");
    2423 
    2424     if (style == CodeMarker::Summary)
    2425         marked.replace("@name>", "b>");
    2426 
    2427     if (style == CodeMarker::SeparateList) {
    2428         QRegExp extraRegExp("<@extra>.*</@extra>");
    2429         extraRegExp.setMinimal(true);
    2430         marked.replace(extraRegExp, "");
    2431     }
    2432     else {
    2433         marked.replace("<@extra>", "&nbsp;&nbsp;<tt>");
    2434         marked.replace("</@extra>", "</tt>");
    2435     }
    2436 
    2437     if (style != CodeMarker::Detailed) {
    2438         marked.replace("<@type>", "");
    2439         marked.replace("</@type>", "");
    2440     }
    2441     out() << highlightedCode(marked, marker, relative);
    2442 }*/
    2443 
    24442755#ifdef QDOC_QML
    24452756void HtmlGenerator::generateQmlItem(const Node *node,
     
    24512762    QRegExp templateTag("(<[^@>]*>)");
    24522763    if (marked.indexOf(templateTag) != -1) {
    2453         QString contents = protect(marked.mid(templateTag.pos(1),
     2764        QString contents = protectEnc(marked.mid(templateTag.pos(1),
    24542765                                              templateTag.cap(1).length()));
    24552766        marked.replace(templateTag.pos(1), templateTag.cap(1).length(),
     
    24642775        marked.replace("@name>", "b>");
    24652776
    2466     marked.replace("<@extra>", "&nbsp;&nbsp;<tt>");
     2777    marked.replace("<@extra>", "<tt>");
    24672778    marked.replace("</@extra>", "</tt>");
    24682779
     
    24712782        marked.replace("</@type>", "");
    24722783    }
    2473     out() << highlightedCode(marked, marker, relative);
     2784    out() << highlightedCode(marked, marker, relative, false, node);
    24742785}
    24752786#endif
     
    25572868            out() << QString("<h3><a href=\"%1\">%2</a></h3>\n").arg(
    25582869                        linkForNode(groupNode, relative)).arg(
    2559                         protect(groupNode->fullTitle()));
     2870                        protectEnc(groupNode->fullTitle()));
    25602871
    25612872            if (fakeNodeMap[groupNode].count() == 0)
     
    25692880                    title.remove(0, 4);
    25702881                out() << "<li><a href=\"" << linkForNode(fakeNode, relative) << "\">"
    2571                       << protect(title) << "</a></li>\n";
     2882                      << protectEnc(title) << "</a></li>\n";
    25722883            }
    25732884            out() << "</ul>\n";
     
    25832894                title.remove(0, 4);
    25842895            out() << "<li><a href=\"" << linkForNode(fakeNode, relative) << "\">"
    2585                   << protect(title) << "</a></li>\n";
     2896                  << protectEnc(title) << "</a></li>\n";
    25862897        }
    25872898        out() << "</ul>\n";
     
    25892900}
    25902901
    2591 #ifdef QDOC_NAME_ALIGNMENT
    25922902void HtmlGenerator::generateSection(const NodeList& nl,
    25932903                                    const Node *relative,
     
    25952905                                    CodeMarker::SynopsisStyle style)
    25962906{
    2597     bool name_alignment = true;
     2907    bool alignNames = true;
    25982908    if (!nl.isEmpty()) {
    25992909        bool twoColumn = false;
    26002910        if (style == CodeMarker::SeparateList) {
    2601             name_alignment = false;
     2911            alignNames = false;
    26022912            twoColumn = (nl.count() >= 16);
    26032913        }
    26042914        else if (nl.first()->type() == Node::Property) {
    26052915            twoColumn = (nl.count() >= 5);
    2606             name_alignment = false;
    2607         }
    2608         if (name_alignment) {
    2609             out() << "<table class=\"alignedsummary\" border=\"0\" cellpadding=\"0\" "
    2610                   << "cellspacing=\"0\" width=\"100%\">\n";
     2916            alignNames = false;
     2917        }
     2918        if (alignNames) {
     2919            out() << "<table class=\"alignedsummary\">\n";
    26112920        }
    26122921        else {
    26132922            if (twoColumn)
    2614                 out() << "<p><table class=\"propsummary\" width=\"100%\" "
    2615                       << "border=\"0\" cellpadding=\"0\""
    2616                       << " cellspacing=\"0\">\n"
    2617                       << "<tr><td width=\"45%\" valign=\"top\">";
     2923                out() << "<table class=\"propsummary\">\n"
     2924                      << "<tr><td  class=\"topAlign\">";
    26182925            out() << "<ul>\n";
    26192926        }
     
    26272934            }
    26282935
    2629             if (name_alignment) {
    2630                 out() << "<tr><td class=\"memItemLeft\" "
    2631                       << "align=\"right\" valign=\"top\">";
     2936            if (alignNames) {
     2937                out() << "<tr><td class=\"memItemLeft rightAlign topAlign\"> ";
    26322938            }
    26332939            else {
    26342940                if (twoColumn && i == (int) (nl.count() + 1) / 2)
    2635                     out() << "</ul></td><td valign=\"top\"><ul>\n";
    2636                 out() << "<li><div class=\"fn\">";
    2637             }
    2638 
    2639             generateSynopsis(*m, relative, marker, style, name_alignment);
    2640             if (name_alignment)
     2941                    out() << "</ul></td><td  class=\"topAlign\"><ul>\n";
     2942                out() << "<li class=\"fn\">";
     2943            }
     2944
     2945            generateSynopsis(*m, relative, marker, style, alignNames);
     2946            if (alignNames)
    26412947                out() << "</td></tr>\n";
    26422948            else
    2643                 out() << "</div></li>\n";
     2949                out() << "</li>\n";
    26442950            i++;
    26452951            ++m;
    26462952        }
    2647         if (name_alignment)
     2953        if (alignNames)
    26482954            out() << "</table>\n";
    26492955        else {
    26502956            out() << "</ul>\n";
    26512957            if (twoColumn)
    2652                 out() << "</td></tr>\n</table></p>\n";
     2958                out() << "</td></tr>\n</table>\n";
    26532959        }
    26542960    }
     
    26602966                                        CodeMarker::SynopsisStyle style)
    26612967{
    2662     bool name_alignment = true;
     2968    bool alignNames = true;
    26632969    if (!section.members.isEmpty()) {
    26642970        bool twoColumn = false;
    26652971        if (style == CodeMarker::SeparateList) {
    2666             name_alignment = false;
     2972            alignNames = false;
    26672973            twoColumn = (section.members.count() >= 16);
    26682974        }
    26692975        else if (section.members.first()->type() == Node::Property) {
    26702976            twoColumn = (section.members.count() >= 5);
    2671             name_alignment = false;
    2672         }
    2673         if (name_alignment) {
    2674             out() << "<table class=\"alignedsummary\" border=\"0\" cellpadding=\"0\" "
    2675                   << "cellspacing=\"0\" width=\"100%\">\n";
     2977            alignNames = false;
     2978        }
     2979        if (alignNames) {
     2980            out() << "<table class=\"alignedsummary\">\n";
    26762981        }
    26772982        else {
    26782983            if (twoColumn)
    2679                 out() << "<p><table class=\"propsummary\" width=\"100%\" "
    2680                       << "border=\"0\" cellpadding=\"0\""
    2681                       << " cellspacing=\"0\">\n"
    2682                       << "<tr><td width=\"45%\" valign=\"top\">";
     2984                out() << "<table class=\"propsummary\">\n"
     2985                      << "<tr><td  class=\"topAlign\">";
    26832986            out() << "<ul>\n";
    26842987        }
     
    26922995            }
    26932996
    2694             if (name_alignment) {
    2695                 out() << "<tr><td class=\"memItemLeft\" "
    2696                       << "align=\"right\" valign=\"top\">";
     2997            if (alignNames) {
     2998                out() << "<tr><td class=\"memItemLeft topAlign rightAlign\"> ";
    26972999            }
    26983000            else {
    26993001                if (twoColumn && i == (int) (section.members.count() + 1) / 2)
    2700                     out() << "</ul></td><td valign=\"top\"><ul>\n";
    2701                 out() << "<li><div class=\"fn\">";
    2702             }
    2703 
    2704             generateSynopsis(*m, relative, marker, style, name_alignment);
    2705             if (name_alignment)
     3002                    out() << "</ul></td><td class=\"topAlign\"><ul>\n";
     3003                out() << "<li class=\"fn\">";
     3004            }
     3005
     3006            generateSynopsis(*m, relative, marker, style, alignNames);
     3007            if (alignNames)
    27063008                out() << "</td></tr>\n";
    27073009            else
    2708                 out() << "</div></li>\n";
     3010                out() << "</li>\n";
    27093011            i++;
    27103012            ++m;
    27113013        }
    2712         if (name_alignment)
     3014        if (alignNames)
    27133015            out() << "</table>\n";
    27143016        else {
    27153017            out() << "</ul>\n";
    27163018            if (twoColumn)
    2717                 out() << "</td></tr>\n</table></p>\n";
     3019                out() << "</td></tr>\n</table>\n";
    27183020        }
    27193021    }
     
    27213023    if (style == CodeMarker::Summary && !section.inherited.isEmpty()) {
    27223024        out() << "<ul>\n";
    2723         generateSectionInheritedList(section, relative, marker, name_alignment);
     3025        generateSectionInheritedList(section, relative, marker);
    27243026        out() << "</ul>\n";
    27253027    }
     
    27283030void HtmlGenerator::generateSectionInheritedList(const Section& section,
    27293031                                                 const Node *relative,
    2730                                                  CodeMarker *marker,
    2731                                                  bool nameAlignment)
     3032                                                 CodeMarker *marker)
    27323033{
    27333034    QList<QPair<ClassNode *, int> >::ConstIterator p = section.inherited.begin();
    27343035    while (p != section.inherited.end()) {
    2735         if (nameAlignment)
    2736             out() << "<li><div bar=\"2\" class=\"fn\"></div>";
    2737         else
    2738             out() << "<li><div class=\"fn\"></div>";
     3036        out() << "<li class=\"fn\">";
    27393037        out() << (*p).second << " ";
    27403038        if ((*p).second == 1) {
     
    27463044        out() << " inherited from <a href=\"" << fileName((*p).first)
    27473045              << "#" << HtmlGenerator::cleanRef(section.name.toLower()) << "\">"
    2748               << protect(marker->plainFullName((*p).first, relative))
     3046              << protectEnc(marker->plainFullName((*p).first, relative))
    27493047              << "</a></li>\n";
    27503048        ++p;
     
    27563054                                     CodeMarker *marker,
    27573055                                     CodeMarker::SynopsisStyle style,
    2758                                      bool nameAlignment)
     3056                                     bool alignNames)
    27593057{
    27603058    QString marked = marker->markedUpSynopsis(node, relative, style);
    27613059    QRegExp templateTag("(<[^@>]*>)");
    27623060    if (marked.indexOf(templateTag) != -1) {
    2763         QString contents = protect(marked.mid(templateTag.pos(1),
     3061        QString contents = protectEnc(marked.mid(templateTag.pos(1),
    27643062                                              templateTag.cap(1).length()));
    27653063        marked.replace(templateTag.pos(1), templateTag.cap(1).length(),
     
    27813079        marked.replace(extraRegExp, "");
    27823080    } else {
    2783         marked.replace("<@extra>", "&nbsp;&nbsp;<tt>");
     3081        marked.replace("<@extra>", "<tt>");
    27843082        marked.replace("</@extra>", "</tt>");
    27853083    }
     
    27893087        marked.replace("</@type>", "");
    27903088    }
    2791     out() << highlightedCode(marked, marker, relative, style, nameAlignment);
     3089    out() << highlightedCode(marked, marker, relative, alignNames);
    27923090}
    27933091
    27943092QString HtmlGenerator::highlightedCode(const QString& markedCode,
    2795                                        CodeMarker *marker,
    2796                                        const Node *relative,
    2797                                        CodeMarker::SynopsisStyle ,
    2798                                        bool nameAlignment)
     3093                                       CodeMarker* marker,
     3094                                       const Node* relative,
     3095                                       bool alignNames,
     3096                                       const Node* self)
    27993097{
    28003098    QString src = markedCode;
     
    28063104    const QChar charAt = '@';
    28073105
     3106    static const QString typeTag("type");
     3107    static const QString headerTag("headerfile");
     3108    static const QString funcTag("func");
     3109    static const QString linkTag("link");
     3110   
    28083111    // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*(</@link>)"
    2809     static const QString linkTag("link");
    28103112    bool done = false;
    2811     for (int i = 0, n = src.size(); i < n;) {
     3113    for (int i = 0, srcSize = src.size(); i < srcSize;) {
    28123114        if (src.at(i) == charLangle && src.at(i + 1).unicode() == '@') {
    2813             if (nameAlignment && !done) {// && (i != 0)) Why was this here?
    2814                 html += "</td><td class=\"memItemRight\" valign=\"bottom\">";
     3115            if (alignNames && !done) {// && (i != 0)) Why was this here?
     3116                html += "</td><td class=\"memItemRight bottomAlign\">";
    28153117                done = true;
    28163118            }
    28173119            i += 2;
    2818             if (parseArg(src, linkTag, &i, n, &arg, &par1)) {
     3120            if (parseArg(src, linkTag, &i, srcSize, &arg, &par1)) {
    28193121                html += "<b>";
    2820                 QString link = linkForNode(
    2821                     CodeMarker::nodeForString(par1.toString()), relative);
     3122                const Node* n = CodeMarker::nodeForString(par1.toString());
     3123                QString link = linkForNode(n, relative);
    28223124                addLink(link, arg, &html);
    28233125                html += "</b>";
     
    28393141        src = html;
    28403142        html = QString();
    2841         static const QString funcTag("func");
    2842         for (int i = 0, n = src.size(); i < n;) {
     3143        for (int i = 0, srcSize = src.size(); i < srcSize;) {
    28433144            if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
    28443145                i += 2;
    2845                 if (parseArg(src, funcTag, &i, n, &arg, &par1)) {
    2846                     QString link = linkForNode(
    2847                             marker->resolveTarget(par1.toString(),
    2848                                                   myTree,
    2849                                                   relative),
    2850                             relative);
     3146                if (parseArg(src, funcTag, &i, srcSize, &arg, &par1)) {
     3147                    const Node* n = marker->resolveTarget(par1.toString(),
     3148                                                          myTree,
     3149                                                          relative);
     3150                    QString link = linkForNode(n, relative);
    28513151                    addLink(link, arg, &html);
    28523152                    par1 = QStringRef();
     
    28663166    src = html;
    28673167    html = QString();
    2868     static const QString typeTags[] = { "type", "headerfile", "func" };
    2869     for (int i = 0, n = src.size(); i < n;) {
    2870         if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
     3168
     3169    for (int i=0, srcSize=src.size(); i<srcSize;) {
     3170        if (src.at(i) == charLangle && src.at(i+1) == charAt) {
    28713171            i += 2;
    28723172            bool handled = false;
    2873             for (int k = 0; k != 3; ++k) {
    2874                 if (parseArg(src, typeTags[k], &i, n, &arg, &par1)) {
    2875                     par1 = QStringRef();
    2876                     QString link = linkForNode(
    2877                             marker->resolveTarget(arg.toString(), myTree, relative),
    2878                             relative);
    2879                     addLink(link, arg, &html);
    2880                     handled = true;
    2881                     break;
     3173            if (parseArg(src, typeTag, &i, srcSize, &arg, &par1)) {
     3174                par1 = QStringRef();
     3175                const Node* n = marker->resolveTarget(arg.toString(), myTree, relative, self);
     3176                if (n && n->subType() == Node::QmlBasicType) {
     3177                    if (relative && relative->subType() == Node::QmlClass)
     3178                        addLink(linkForNode(n,relative), arg, &html);
     3179                    else
     3180                        html += arg.toString();
    28823181                }
    2883             }
     3182                else
     3183                    addLink(linkForNode(n,relative), arg, &html);
     3184                handled = true;
     3185            }
     3186            else if (parseArg(src, headerTag, &i, srcSize, &arg, &par1)) {
     3187                par1 = QStringRef();
     3188                const Node* n = marker->resolveTarget(arg.toString(), myTree, relative);
     3189                addLink(linkForNode(n,relative), arg, &html);
     3190                handled = true;
     3191            }
     3192            else if (parseArg(src, funcTag, &i, srcSize, &arg, &par1)) {
     3193                par1 = QStringRef();
     3194                const Node* n = marker->resolveTarget(arg.toString(), myTree, relative);
     3195                addLink(linkForNode(n,relative), arg, &html);
     3196                handled = true;
     3197            }
     3198
    28843199            if (!handled) {
    28853200                html += charLangle;
     
    29093224        "</@string>",      "</span>",
    29103225        "</@char>",        "</span>"
    2911         // "<@char>",      "<font color=blue>",
    2912         // "</@char>",     "</font>",
    2913         // "<@func>",      "<font color=green>",
    2914         // "</@func>",     "</font>",
    2915         // "<@id>",        "<i>",
    2916         // "</@id>",       "</i>",
    2917         // "<@keyword>",   "<b>",
    2918         // "</@keyword>",  "</b>",
    2919         // "<@number>",    "<font color=yellow>",
    2920         // "</@number>",   "</font>",
    2921         // "<@op>",        "<b>",
    2922         // "</@op>",       "</b>",
    2923         // "<@param>",     "<i>",
    2924         // "</@param>",    "</i>",
    2925         // "<@string>",    "<font color=green>",
    2926         // "</@string>",  "</font>",
    29273226    };
    29283227    for (int i = 0, n = src.size(); i < n;) {
     
    29623261}
    29633262
    2964 #else
    2965 void HtmlGenerator::generateSectionList(const Section& section,
    2966                                         const Node *relative,
    2967                                         CodeMarker *marker,
    2968                                         CodeMarker::SynopsisStyle style)
    2969 {
    2970     if (!section.members.isEmpty()) {
    2971         bool twoColumn = false;
    2972         if (style == CodeMarker::SeparateList) {
    2973             twoColumn = (section.members.count() >= 16);
    2974         }
    2975         else if (section.members.first()->type() == Node::Property) {
    2976             twoColumn = (section.members.count() >= 5);
    2977         }
    2978         if (twoColumn)
    2979             out() << "<p><table class=\"generic\" width=\"100%\" border=\"0\" "
    2980                   << "cellpadding=\"0\" cellspacing=\"0\">\n"
    2981                   << "<tr><td width=\"45%\" valign=\"top\">";
    2982         out() << "<ul>\n";
    2983 
    2984         int i = 0;
    2985         NodeList::ConstIterator m = section.members.begin();
    2986         while (m != section.members.end()) {
    2987             if ((*m)->access() == Node::Private) {
    2988                 ++m;
    2989                 continue;
    2990             }
    2991 
    2992             if (twoColumn && i == (int) (section.members.count() + 1) / 2)
    2993                 out() << "</ul></td><td valign=\"top\"><ul>\n";
    2994 
    2995             out() << "<li><div class=\"fn\"></div>";
    2996             if (style == CodeMarker::Accessors)
    2997                 out() << "<b>";
    2998             generateSynopsis(*m, relative, marker, style);
    2999             if (style == CodeMarker::Accessors)
    3000                 out() << "</b>";
    3001             out() << "</li>\n";
    3002             i++;
    3003             ++m;
    3004         }
    3005         out() << "</ul>\n";
    3006         if (twoColumn)
    3007             out() << "</td></tr>\n</table></p>\n";
    3008     }
    3009 
    3010     if (style == CodeMarker::Summary && !section.inherited.isEmpty()) {
    3011         out() << "<ul>\n";
    3012         generateSectionInheritedList(section, relative, marker);
    3013         out() << "</ul>\n";
    3014     }
    3015 }
    3016 
    3017 void HtmlGenerator::generateSectionInheritedList(const Section& section,
    3018                                                  const Node *relative,
    3019                                                  CodeMarker *marker)
    3020 {
    3021     QList<QPair<ClassNode *, int> >::ConstIterator p = section.inherited.begin();
    3022     while (p != section.inherited.end()) {
    3023         out() << "<li><div bar=\"2\" class=\"fn\"></div>";
    3024         out() << (*p).second << " ";
    3025         if ((*p).second == 1) {
    3026             out() << section.singularMember;
    3027         } else {
    3028             out() << section.pluralMember;
    3029         }
    3030         out() << " inherited from <a href=\"" << fileName((*p).first)
    3031               << "#" << HtmlGenerator::cleanRef(section.name.toLower()) << "\">"
    3032               << protect(marker->plainFullName((*p).first, relative))
    3033               << "</a></li>\n";
    3034         ++p;
    3035     }
    3036 }
    3037 
    3038 void HtmlGenerator::generateSynopsis(const Node *node,
    3039                                      const Node *relative,
    3040                                      CodeMarker *marker,
    3041                                      CodeMarker::SynopsisStyle style)
    3042 {
    3043     QString marked = marker->markedUpSynopsis(node, relative, style);
    3044     QRegExp templateTag("(<[^@>]*>)");
    3045     if (marked.indexOf(templateTag) != -1) {
    3046         QString contents = protect(marked.mid(templateTag.pos(1),
    3047                                               templateTag.cap(1).length()));
    3048         marked.replace(templateTag.pos(1), templateTag.cap(1).length(),
    3049                         contents);
    3050     }
    3051     marked.replace(QRegExp("<@param>([a-z]+)_([1-9n])</@param>"), "<i>\\1<sub>\\2</sub></i>");
    3052     marked.replace("<@param>", "<i>");
    3053     marked.replace("</@param>", "</i>");
    3054 
    3055     if (style == CodeMarker::Summary)
    3056         marked.replace("@name>", "b>");
    3057 
    3058     if (style == CodeMarker::SeparateList) {
    3059         QRegExp extraRegExp("<@extra>.*</@extra>");
    3060         extraRegExp.setMinimal(true);
    3061         marked.replace(extraRegExp, "");
    3062     } else {
    3063         marked.replace("<@extra>", "&nbsp;&nbsp;<tt>");
    3064         marked.replace("</@extra>", "</tt>");
    3065     }
    3066 
    3067     if (style != CodeMarker::Detailed) {
    3068         marked.replace("<@type>", "");
    3069         marked.replace("</@type>", "");
    3070     }
    3071     out() << highlightedCode(marked, marker, relative);
    3072 }
    3073 
    3074 QString HtmlGenerator::highlightedCode(const QString& markedCode,
    3075                                        CodeMarker *marker,
    3076                                        const Node *relative)
    3077 {
    3078     QString src = markedCode;
    3079     QString html;
    3080     QStringRef arg;
    3081     QStringRef par1;
    3082 
    3083     const QChar charLangle = '<';
    3084     const QChar charAt = '@';
    3085 
    3086     // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*(</@link>)"
    3087     static const QString linkTag("link");
    3088     for (int i = 0, n = src.size(); i < n;) {
    3089         if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
    3090             i += 2;
    3091             if (parseArg(src, linkTag, &i, n, &arg, &par1)) {
    3092                 const Node* node = CodeMarker::nodeForString(par1.toString());
    3093                 QString link = linkForNode(node, relative);
    3094                 addLink(link, arg, &html);
    3095             }
    3096             else {
    3097                 html += charLangle;
    3098                 html += charAt;
    3099             }
    3100         }
    3101         else {
    3102             html += src.at(i++);
    3103         }
    3104     }
    3105 
    3106     if (slow) {
    3107         // is this block ever used at all?
    3108         // replace all <@func> tags: "(<@func target=\"([^\"]*)\">)(.*)(</@func>)"
    3109         src = html;
    3110         html = QString();
    3111         static const QString funcTag("func");
    3112         for (int i = 0, n = src.size(); i < n;) {
    3113             if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
    3114                 i += 2;
    3115                 if (parseArg(src, funcTag, &i, n, &arg, &par1)) {
    3116                     QString link = linkForNode(
    3117                             marker->resolveTarget(par1.toString(),
    3118                                                   myTree,
    3119                                                   relative),
    3120                             relative);
    3121                     addLink(link, arg, &html);
    3122                     par1 = QStringRef();
    3123                 }
    3124                 else {
    3125                     html += charLangle;
    3126                     html += charAt;
    3127                 }
    3128             }
    3129             else {
    3130                 html += src.at(i++);
    3131             }
    3132         }
    3133     }
    3134 
    3135     // replace all "(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)(</@\\2>)" tags
    3136     src = html;
    3137     html = QString();
    3138     static const QString typeTags[] = { "type", "headerfile", "func" };
    3139     for (int i = 0, n = src.size(); i < n;) {
    3140         if (src.at(i) == charLangle && src.at(i + 1) == charAt) {
    3141             i += 2;
    3142             bool handled = false;
    3143             for (int k = 0; k != 3; ++k) {
    3144                 if (parseArg(src, typeTags[k], &i, n, &arg, &par1)) {
    3145                     par1 = QStringRef();
    3146                     QString link = linkForNode(
    3147                             marker->resolveTarget(arg.toString(), myTree, relative),
    3148                             relative);
    3149                     addLink(link, arg, &html);
    3150                     handled = true;
    3151                     break;
    3152                 }
    3153             }
    3154             if (!handled) {
    3155                 html += charLangle;
    3156                 html += charAt;
    3157             }
    3158         }
    3159         else {
    3160             html += src.at(i++);
    3161         }
    3162     }
    3163 
    3164     // replace all
    3165     // "<@comment>" -> "<span class=\"comment\">";
    3166     // "<@preprocessor>" -> "<span class=\"preprocessor\">";
    3167     // "<@string>" -> "<span class=\"string\">";
    3168     // "<@char>" -> "<span class=\"char\">";
    3169     // "</@(?:comment|preprocessor|string|char)>" -> "</span>"
    3170     src = html;
    3171     html = QString();
    3172     static const QString spanTags[] = {
    3173         "<@comment>",      "<span class=\"comment\">",
    3174         "<@preprocessor>", "<span class=\"preprocessor\">",
    3175         "<@string>",       "<span class=\"string\">",
    3176         "<@char>",         "<span class=\"char\">",
    3177         "</@comment>",     "</span>",
    3178         "</@preprocessor>","</span>",
    3179         "</@string>",      "</span>",
    3180         "</@char>",        "</span>"
    3181         // "<@char>",      "<font color=blue>",
    3182         // "</@char>",     "</font>",
    3183         // "<@func>",      "<font color=green>",
    3184         // "</@func>",     "</font>",
    3185         // "<@id>",        "<i>",
    3186         // "</@id>",       "</i>",
    3187         // "<@keyword>",   "<b>",
    3188         // "</@keyword>",  "</b>",
    3189         // "<@number>",    "<font color=yellow>",
    3190         // "</@number>",   "</font>",
    3191         // "<@op>",        "<b>",
    3192         // "</@op>",       "</b>",
    3193         // "<@param>",     "<i>",
    3194         // "</@param>",    "</i>",
    3195         // "<@string>",    "<font color=green>",
    3196         // "</@string>",  "</font>",
    3197     };
    3198     for (int i = 0, n = src.size(); i < n;) {
    3199         if (src.at(i) == charLangle) {
    3200             bool handled = false;
    3201             for (int k = 0; k != 8; ++k) {
    3202                 const QString & tag = spanTags[2 * k];
    3203                 if (tag == QStringRef(&src, i, tag.length())) {
    3204                     html += spanTags[2 * k + 1];
    3205                     i += tag.length();
    3206                     handled = true;
    3207                     break;
    3208                 }
    3209             }
    3210             if (!handled) {
    3211                 ++i;
    3212                 if (src.at(i) == charAt ||
    3213                     (src.at(i) == QLatin1Char('/') && src.at(i + 1) == charAt)) {
    3214                     // drop 'our' unknown tags (the ones still containing '@')
    3215                     while (i < n && src.at(i) != QLatin1Char('>'))
    3216                         ++i;
    3217                     ++i;
    3218                 }
    3219                 else {
    3220                     // retain all others
    3221                     html += charLangle;
    3222                 }
    3223             }
    3224         }
    3225         else {
    3226             html += src.at(i);
    3227             ++i;
    3228         }
    3229     }
    3230 
    3231     return html;
    3232 }
    3233 #endif
    3234 
    32353263void HtmlGenerator::generateLink(const Atom* atom,
    32363264                                 const Node* /* relative */,
     
    32423270        // hack for C++: move () outside of link
    32433271        int k = funcLeftParen.pos(1);
    3244         out() << protect(atom->string().left(k));
     3272        out() << protectEnc(atom->string().left(k));
    32453273        if (link.isEmpty()) {
    32463274            if (showBrokenLinks)
     
    32503278        }
    32513279        inLink = false;
    3252         out() << protect(atom->string().mid(k));
     3280        out() << protectEnc(atom->string().mid(k));
    32533281    } else if (marker->recognizeLanguage("Java")) {
    3254         // hack for Java: remove () and use <tt> when appropriate
     3282        // hack for Java: remove () and use <tt> when appropriate
    32553283        bool func = atom->string().endsWith("()");
    32563284        bool tt = (func || atom->string().contains(camelCase));
     
    32583286            out() << "<tt>";
    32593287        if (func) {
    3260             out() << protect(atom->string().left(atom->string().length() - 2));
     3288            out() << protectEnc(atom->string().left(atom->string().length() - 2));
    32613289        } else {
    3262             out() << protect(atom->string());
     3290            out() << protectEnc(atom->string());
    32633291        }
    32643292        out() << "</tt>";
    32653293    } else {
    3266         out() << protect(atom->string());
     3294        out() << protectEnc(atom->string());
    32673295    }
    32683296}
     
    33383366}
    33393367
    3340 QString HtmlGenerator::protect(const QString& string)
     3368QString HtmlGenerator::protectEnc(const QString &string)
     3369{
     3370    return protect(string, outputEncoding);
     3371}
     3372
     3373QString HtmlGenerator::protect(const QString &string, const QString &outputEncoding)
    33413374{
    33423375#define APPEND(x) \
     
    33613394        } else if (ch == QLatin1Char('"')) {
    33623395            APPEND("&quot;");
    3363         } else if (ch.unicode() > 0x007F
     3396        } else if ((outputEncoding == "ISO-8859-1" && ch.unicode() > 0x007F)
    33643397                   || (ch == QLatin1Char('*') && i + 1 < n && string.at(i) == QLatin1Char('/'))
    33653398                   || (ch == QLatin1Char('.') && i > 2 && string.at(i - 2) == QLatin1Char('.'))) {
     
    33813414}
    33823415
    3383 QString HtmlGenerator::fileBase(const Node *node)
     3416QString HtmlGenerator::fileBase(const Node *node) const
    33843417{
    33853418    QString result;
     
    34913524        break;
    34923525    case Node::Target:
    3493         return protect(node->name());
     3526        return protectEnc(node->name());
    34943527    }
    34953528    return registerRef(ref);
     
    35103543    if (node->access() == Node::Private)
    35113544        return QString();
    3512 
     3545 
    35133546    fn = fileName(node);
    3514 /*    if (!node->url().isEmpty())
    3515         return fn;*/
     3547#if 0
     3548    if (!node->url().isEmpty())
     3549        return fn;
     3550#endif   
     3551
    35163552#if 0
    35173553    // ### reintroduce this test, without breaking .dcf files
     
    35653601    }
    35663602    out() << "\">";
    3567     out() << protect(fullName(apparentNode, relative, marker));
     3603    out() << protectEnc(fullName(apparentNode, relative, marker));
    35683604    out() << "</a>";
    35693605}
     
    35753611    const EnumNode *enume;
    35763612
     3613#ifdef GENERATE_MAC_REFS   
    35773614    generateMacRef(node, marker);
     3615#endif   
     3616    generateExtractionMark(node, MemberMark);
    35783617    if (node->type() == Node::Enum
    35793618            && (enume = static_cast<const EnumNode *>(node))->flagsType()) {
     3619#ifdef GENERATE_MAC_REFS   
    35803620        generateMacRef(enume->flagsType(), marker);
     3621#endif       
    35813622        out() << "<h3 class=\"flags\">";
    35823623        out() << "<a name=\"" + refForNode(node) + "\"></a>";
    35833624        generateSynopsis(enume, relative, marker, CodeMarker::Detailed);
    3584         out() << "<br />";
     3625        out() << "<br/>";
    35853626        generateSynopsis(enume->flagsType(),
    35863627                         relative,
     
    35933634        out() << "<a name=\"" + refForNode(node) + "\"></a>";
    35943635        generateSynopsis(node, relative, marker, CodeMarker::Detailed);
    3595         out() << "</h3>\n";
     3636        out() << "</h3>" << divNavTop << "\n";
    35963637    }
    35973638
     
    36263667        const EnumNode *enume = static_cast<const EnumNode *>(node);
    36273668        if (enume->flagsType()) {
    3628             out() << "<p>The " << protect(enume->flagsType()->name())
     3669            out() << "<p>The " << protectEnc(enume->flagsType()->name())
    36293670                  << " type is a typedef for "
    36303671                  << "<a href=\"qflags.html\">QFlags</a>&lt;"
    3631                   << protect(enume->name())
     3672                  << protectEnc(enume->name())
    36323673                  << "&gt;. It stores an OR combination of "
    3633                   << protect(enume->name())
     3674                  << protectEnc(enume->name())
    36343675                  << " values.</p>\n";
    36353676        }
    36363677    }
    36373678    generateAlsoList(node, marker);
     3679    generateExtractionMark(node, EndMark);
    36383680}
    36393681
     
    36773719                    serviceClasses.insert(serviceName, *c);
    36783720            }
     3721            else if ((*c)->type() == Node::Fake &&
     3722                     (*c)->subType() == Node::QmlClass &&
     3723                     !(*c)->doc().isEmpty()) {
     3724                QString qmlClassName = (*c)->name();
     3725                // Remove the "QML:" prefix if present.
     3726                if (qmlClassName.startsWith(QLatin1String("QML:")))
     3727                    qmlClasses.insert(qmlClassName.mid(4),*c);
     3728                else
     3729                    qmlClasses.insert(qmlClassName,*c);
     3730            }
    36793731            else if ((*c)->isInnerNode()) {
    36803732                findAllClasses(static_cast<InnerNode *>(*c));
     
    37013753            if (ncmap == newClassMaps.end())
    37023754                ncmap = newClassMaps.insert(sinceVersion,NodeMap());
     3755            NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceVersion);
     3756            if (nqcmap == newQmlClassMaps.end())
     3757                nqcmap = newQmlClassMaps.insert(sinceVersion,NodeMap());
    37033758 
    37043759            if ((*child)->type() == Node::Function) {
     
    37203775                    ncmap.value().insert(className,(*child));
    37213776                }
     3777                else if ((*child)->subType() == Node::QmlClass) {
     3778                    QString className = (*child)->name();
     3779                    if ((*child)->parent() &&
     3780                        (*child)->parent()->type() == Node::Namespace &&
     3781                        !(*child)->parent()->name().isEmpty())
     3782                        className = (*child)->parent()->name()+"::"+className;
     3783                    nsmap.value().insert(className,(*child));
     3784                    nqcmap.value().insert(className,(*child));
     3785                }
    37223786            }
    37233787            else {
     
    37363800    }
    37373801}
    3738 
    3739 #if 0
    3740     const QRegExp versionSeparator("[\\-\\.]");
    3741     const int minorIndex = version.indexOf(versionSeparator);
    3742     const int patchIndex = version.indexOf(versionSeparator, minorIndex+1);
    3743     version = version.left(patchIndex);
    3744 #endif
    37453802
    37463803void HtmlGenerator::findAllFunctions(const InnerNode *node)
     
    38073864}
    38083865
    3809 #ifdef ZZZ_QDOC_QML
    3810 /*!
    3811   This function finds all the qml element nodes and
    3812   stores them in a map for later use.
    3813  */
    3814 void HtmlGenerator::findAllQmlClasses(const InnerNode *node)
    3815 {
    3816     NodeList::const_iterator c = node->childNodes().constBegin();
    3817     while (c != node->childNodes().constEnd()) {
    3818         if ((*c)->type() == Node::Fake) {
    3819             const FakeNode* fakeNode = static_cast<const FakeNode *>(*c);
    3820             if (fakeNode->subType() == Node::QmlClass) {
    3821                 const QmlClassNode* qmlNode =
    3822                     static_cast<const QmlClassNode*>(fakeNode);
    3823                 const Node* n = qmlNode->classNode();
    3824             }
    3825             qmlClasses.insert(fakeNode->name(),*c);
    3826         }
    3827         ++c;
    3828     }
    3829 }
    3830 #endif
    3831 
    38323866int HtmlGenerator::hOffset(const Node *node)
    38333867{
     
    38373871        return 2;
    38383872    case Node::Fake:
    3839         if (node->doc().briefText().isEmpty())
    3840             return 1;
    3841         else
    3842             return 2;
     3873        return 1;
    38433874    case Node::Enum:
    38443875    case Node::Typedef:
     
    39403971        else {
    39413972            *node = marker->resolveTarget(first, myTree, relative);
    3942             if (!*node)
     3973            if (!*node) {
    39433974                *node = myTree->findFakeNodeByTitle(first);
    3944             if (!*node)
     3975            }
     3976            if (!*node) {
    39453977                *node = myTree->findUnambiguousTarget(first, targetAtom);
     3978            }
    39463979        }
    39473980
     
    40364069    case Node::Obsolete:
    40374070        if (node->isInnerNode())
    4038             Generator::generateStatus(node, marker);
     4071            Generator::generateStatus(node, marker);
    40394072        break;
    40404073    case Node::Compat:
     
    40784111}
    40794112
     4113#ifdef GENERATE_MAC_REFS   
     4114/*
     4115  No longer valid.
     4116 */
    40804117void HtmlGenerator::generateMacRef(const Node *node, CodeMarker *marker)
    40814118{
     
    40874124        out() << "<a name=\"" << "//apple_ref/" << macRef << "\"></a>\n";
    40884125}
     4126#endif
    40894127
    40904128void HtmlGenerator::beginLink(const QString &link,
     
    41384176}
    41394177
    4140 QT_END_NAMESPACE
    4141 
    41424178#ifdef QDOC_QML
    41434179
    41444180/*!
    4145   Generates the summary for for the \a section. Only used for
     4181  Generates the summary for the \a section. Only used for
    41464182  sections of QML element documentation.
    41474183
     
    41534189{
    41544190    if (!section.members.isEmpty()) {
     4191        out() << "<ul>\n";
    41554192        NodeList::ConstIterator m;
    4156         int count = section.members.size();
    4157         bool twoColumn = false;
    4158         if (section.members.first()->type() == Node::QmlProperty) {
    4159             twoColumn = (count >= 5);
    4160         }
    4161         if (twoColumn)
    4162             out() << "<p><table width=\"100%\" border=\"0\" cellpadding=\"0\""
    4163                      " cellspacing=\"0\">\n"
    4164                   << "<tr><td width=\"45%\" valign=\"top\">";
    4165         out() << "<ul>\n";
    4166 
    4167         int row = 0;
    41684193        m = section.members.begin();
    41694194        while (m != section.members.end()) {
    4170             if (twoColumn && row == (int) (count + 1) / 2)
    4171                 out() << "</ul></td><td valign=\"top\"><ul>\n";
    4172             out() << "<li><div class=\"fn\"></div>";
     4195            out() << "<li class=\"fn\">";
    41734196            generateQmlItem(*m,relative,marker,true);
    41744197            out() << "</li>\n";
    4175             row++;
    41764198            ++m;
    41774199        }
    41784200        out() << "</ul>\n";
    4179         if (twoColumn)
    4180             out() << "</td></tr>\n</table></p>\n";
    41814201    }
    41824202}
     
    41914211{
    41924212    const QmlPropertyNode* qpn = 0;
     4213#ifdef GENERATE_MAC_REFS   
    41934214    generateMacRef(node, marker);
     4215#endif   
     4216    generateExtractionMark(node, MemberMark);
    41944217    out() << "<div class=\"qmlitem\">";
    41954218    if (node->subType() == Node::QmlPropertyGroup) {
     
    41974220        NodeList::ConstIterator p = qpgn->childNodes().begin();
    41984221        out() << "<div class=\"qmlproto\">";
    4199         out() << "<table width=\"100%\" class=\"qmlname\">";
     4222        out() << "<table class=\"qmlname\">";
    42004223
    42014224        while (p != qpgn->childNodes().end()) {
    42024225            if ((*p)->type() == Node::QmlProperty) {
    42034226                qpn = static_cast<const QmlPropertyNode*>(*p);
    4204                 out() << "<tr><td>";
     4227                if (++numTableRows % 2 == 1)
     4228                    out() << "<tr class=\"odd\">";
     4229                else
     4230                    out() << "<tr class=\"even\">";
     4231
     4232                out() << "<td class=\"tblQmlPropNode\"><p>";
     4233
    42054234                out() << "<a name=\"" + refForNode(qpn) + "\"></a>";
    4206                 if (!qpn->isWritable())
     4235
     4236                if (!qpn->isWritable(myTree)) {
    42074237                    out() << "<span class=\"qmlreadonly\">read-only</span>";
     4238                }
     4239                if (qpgn->isDefault())
     4240                    out() << "<span class=\"qmldefault\">default</span>";
    42084241                generateQmlItem(qpn, relative, marker, false);
    4209                 out() << "</td></tr>";
    4210                 if (qpgn->isDefault()) {
    4211                     out() << "</table>"
    4212                           << "</div></div>"
    4213                           << "<div class=\"qmlitem\">"
    4214                           << "<div class=\"qmlproto\">"
    4215                           << "<table class=\"qmlname\">"
    4216                           << "<tr><td><font color=\"green\">"
    4217                           << "default</font></td></tr>";
    4218                 }
     4242                out() << "</p></td></tr>";
    42194243            }
    42204244            ++p;
     
    42274251        out() << "<div class=\"qmlproto\">";
    42284252        out() << "<table class=\"qmlname\">";
    4229         out() << "<tr><td>";
     4253        //out() << "<tr>";
     4254        if (++numTableRows % 2 == 1)
     4255            out() << "<tr class=\"odd\">";
     4256        else
     4257            out() << "<tr class=\"even\">";
     4258        out() << "<td class=\"tblQmlFuncNode\"><p>";
    42304259        out() << "<a name=\"" + refForNode(qsn) + "\"></a>";
    42314260        generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false);
    42324261        //generateQmlItem(qsn,relative,marker,false);
    4233         out() << "</td></tr>";
     4262        out() << "</p></td></tr>";
    42344263        out() << "</table>";
    42354264        out() << "</div>";
     
    42394268        out() << "<div class=\"qmlproto\">";
    42404269        out() << "<table class=\"qmlname\">";
    4241         out() << "<tr><td>";
     4270        //out() << "<tr>";
     4271        if (++numTableRows % 2 == 1)
     4272            out() << "<tr class=\"odd\">";
     4273        else
     4274            out() << "<tr class=\"even\">";
     4275        out() << "<td class=\"tblQmlFuncNode\"><p>";
    42424276        out() << "<a name=\"" + refForNode(qmn) + "\"></a>";
    42434277        generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false);
    4244         out() << "</td></tr>";
     4278        out() << "</p></td></tr>";
    42454279        out() << "</table>";
    42464280        out() << "</div>";
     
    42544288    out() << "</div>";
    42554289    out() << "</div>";
     4290    generateExtractionMark(node, EndMark);
    42564291}
    42574292
     
    42714306            if (n && n->subType() == Node::QmlClass) {
    42724307                const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n);
    4273                 out() << "<p style=\"text-align: center\">";
    42744308                Text text;
    4275                 text << "[Inherits ";
     4309                text << Atom::ParaLeft << "Inherits ";
    42764310                text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
    42774311                text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
    42784312                text << Atom(Atom::String, linkPair.second);
    42794313                text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
    4280                 text << "]";
     4314                text << Atom::ParaRight;
    42814315                generateText(text, cn, marker);
    4282                 out() << "</p>";
    4283             }
     4316            }
     4317        }
     4318    }
     4319}
     4320
     4321/*!
     4322  Output the "Inherit by" list for the QML element,
     4323  if it is inherited by any other elements.
     4324 */
     4325void HtmlGenerator::generateQmlInheritedBy(const QmlClassNode* cn,
     4326                                           CodeMarker* marker)
     4327{
     4328    if (cn) {
     4329        NodeList subs;
     4330        QmlClassNode::subclasses(cn->name(),subs);
     4331        if (!subs.isEmpty()) {
     4332            Text text;
     4333            text << Atom::ParaLeft << "Inherited by ";
     4334            appendSortedQmlNames(text,cn,subs,marker);
     4335            text << Atom::ParaRight;
     4336            generateText(text, cn, marker);
    42844337        }
    42854338    }
     
    42984351    const ClassNode* cn = qcn->classNode();
    42994352    if (cn && (cn->status() != Node::Internal)) {
    4300         out() << "<p style=\"text-align: center\">";
    43014353        Text text;
    4302         text << "[";
     4354        text << Atom::ParaLeft;
    43034355        text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn));
    43044356        text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
    4305         text << Atom(Atom::String, qcn->name());
     4357        QString name = qcn->name();
     4358        if (name.startsWith(QLatin1String("QML:")))
     4359            name = name.mid(4); // remove the "QML:" prefix
     4360        text << Atom(Atom::String, name);
    43064361        text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
    43074362        text << " instantiates the C++ class ";
     
    43104365        text << Atom(Atom::String, cn->name());
    43114366        text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
    4312         text << "]";
     4367        text << Atom::ParaRight;
    43134368        generateText(text, qcn, marker);
    4314         out() << "</p>";
    43154369    }
    43164370}
     
    43294383        const Node* n = myTree->root()->findNode(cn->qmlElement(),Node::Fake);
    43304384        if (n && n->subType() == Node::QmlClass) {
    4331             out() << "<p style=\"text-align: center\">";
    43324385            Text text;
    4333             text << "[";
     4386            text << Atom::ParaLeft;
    43344387            text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
    43354388            text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK);
     
    43414394            text << Atom(Atom::String, n->name());
    43424395            text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK);
    4343             text << "]";
     4396            text << Atom::ParaRight;
    43444397            generateText(text, cn, marker);
    4345             out() << "</p>";
    4346         }
     4398        }
     4399    }
     4400}
     4401
     4402/*!
     4403  Generate the <page> element for the given \a node using the \a writer.
     4404  Return true if a <page> element was written; otherwise return false.
     4405 */
     4406bool HtmlGenerator::generatePageElement(QXmlStreamWriter& writer,
     4407                                        const Node* node,
     4408                                        CodeMarker* marker) const
     4409{
     4410    if (node->pageType() == Node::NoPageType)
     4411        return false;
     4412    if (node->name().isEmpty())
     4413        return true;
     4414    if (node->access() == Node::Private)
     4415        return false;
     4416
     4417    QString guid = QUuid::createUuid().toString();
     4418    QString url = PageGenerator::fileName(node);
     4419    QString title;
     4420    QString rawTitle;
     4421    QString fullTitle;
     4422    QStringList pageWords;
     4423    QXmlStreamAttributes attributes;
     4424
     4425    writer.writeStartElement("page");
     4426
     4427    if (node->isInnerNode()) {
     4428        const InnerNode* inner = static_cast<const InnerNode*>(node);
     4429        if (!inner->pageKeywords().isEmpty())
     4430            pageWords << inner->pageKeywords();
     4431
     4432        switch (node->type()) {
     4433        case Node::Fake:
     4434            {
     4435                const FakeNode* fake = static_cast<const FakeNode*>(node);
     4436                title = fake->fullTitle();
     4437                pageWords << title;
     4438                break;
     4439            }
     4440        case Node::Class:
     4441            {
     4442                title = node->name() + " Class Reference";
     4443                pageWords << node->name() << "class" << "reference";
     4444                break;
     4445            }
     4446        case Node::Namespace:
     4447            {
     4448                rawTitle = marker->plainName(inner);
     4449                fullTitle = marker->plainFullName(inner);
     4450                title = rawTitle + " Namespace Reference";
     4451                pageWords << rawTitle << "namespace" << "reference";
     4452                break;
     4453            }
     4454        default:
     4455            title = node->name();
     4456            pageWords << title;
     4457            break;
     4458        }
     4459    }
     4460    else {
     4461        switch (node->type()) {
     4462        case Node::Enum:
     4463            {
     4464                title = node->name() + " Enum Reference";
     4465                pageWords << node->name() << "enum" << "type";
     4466                url += "#" + node->name() + "-enum";
     4467                break;
     4468            }
     4469        case Node::Function:
     4470            {
     4471                title = node->name() + " Function Reference";
     4472                pageWords << node->name() << "function";
     4473                url += "#" + node->name();
     4474                break;
     4475            }
     4476        case Node::Property:
     4477            {
     4478                title = node->name() + " Property Reference";
     4479                pageWords << node->name() << "property";
     4480                url += "#" + node->name() + "-prop";
     4481                break;
     4482            }
     4483        case Node::Typedef:
     4484            {
     4485                title = node->name() + " Type Reference";
     4486                pageWords << node->name() << "typedef" << "type";
     4487                url += "#" + node->name();
     4488                break;
     4489            }
     4490        default:
     4491            title = node->name();
     4492            pageWords << title;
     4493            break;
     4494        }
     4495
     4496        Node* parent = node->parent();
     4497        if (parent && ((parent->type() == Node::Class) ||
     4498                       (parent->type() == Node::Namespace))) {
     4499            pageWords << parent->name();
     4500        }
     4501    }
     4502
     4503    writer.writeAttribute("id",guid);
     4504    writer.writeStartElement("pageWords");
     4505    writer.writeCharacters(pageWords.join(" "));
     4506
     4507    writer.writeEndElement();
     4508    writer.writeStartElement("pageTitle");
     4509    writer.writeCharacters(title);
     4510    writer.writeEndElement();
     4511    writer.writeStartElement("pageUrl");
     4512    writer.writeCharacters(url);
     4513    writer.writeEndElement();
     4514    writer.writeStartElement("pageType");
     4515    switch (node->pageType()) {
     4516    case Node::ApiPage:
     4517        writer.writeCharacters("APIPage");
     4518        break;
     4519    case Node::ArticlePage:
     4520        writer.writeCharacters("Article");
     4521        break;
     4522    case Node::ExamplePage:
     4523        writer.writeCharacters("Example");
     4524        break;
     4525    default:
     4526        break;
     4527    }
     4528    writer.writeEndElement();
     4529    writer.writeEndElement();
     4530
     4531    if (node->type() == Node::Fake && node->doc().hasTableOfContents()) {
     4532        QList<Atom*> toc = node->doc().tableOfContents();
     4533        if (!toc.isEmpty()) {
     4534            for (int i = 0; i < toc.size(); ++i) {
     4535                Text headingText = Text::sectionHeading(toc.at(i));
     4536                QString s = headingText.toString();
     4537                writer.writeStartElement("page");
     4538                guid = QUuid::createUuid().toString();
     4539                QString internalUrl = url + "#" + Doc::canonicalTitle(s);
     4540                writer.writeAttribute("id",guid);
     4541                writer.writeStartElement("pageWords");
     4542                writer.writeCharacters(pageWords.join(" "));
     4543                writer.writeCharacters(" ");
     4544                writer.writeCharacters(s);
     4545                writer.writeEndElement();
     4546                writer.writeStartElement("pageTitle");
     4547                writer.writeCharacters(s);
     4548                writer.writeEndElement();
     4549                writer.writeStartElement("pageUrl");
     4550                writer.writeCharacters(internalUrl);
     4551                writer.writeEndElement();
     4552                writer.writeStartElement("pageType");
     4553                writer.writeCharacters("Article");
     4554                writer.writeEndElement();
     4555                writer.writeEndElement();
     4556            }
     4557        }
     4558    }
     4559    return true;
     4560}
     4561
     4562/*!
     4563  Traverse the tree recursively and generate the <keyword>
     4564  elements.
     4565 */
     4566void HtmlGenerator::generatePageElements(QXmlStreamWriter& writer, const Node* node, CodeMarker* marker) const
     4567{
     4568    if (generatePageElement(writer, node, marker)) {
     4569
     4570        if (node->isInnerNode()) {
     4571            const InnerNode *inner = static_cast<const InnerNode *>(node);
     4572
     4573            // Recurse to write an element for this child node and all its children.
     4574            foreach (const Node *child, inner->childNodes())
     4575                generatePageElements(writer, child, marker);
     4576        }
     4577    }
     4578}
     4579
     4580/*!
     4581  Outputs the file containing the index used for searching the html docs.
     4582 */
     4583void HtmlGenerator::generatePageIndex(const QString& fileName, CodeMarker* marker) const
     4584{
     4585    QFile file(fileName);
     4586    if (!file.open(QFile::WriteOnly | QFile::Text))
     4587        return ;
     4588
     4589    QXmlStreamWriter writer(&file);
     4590    writer.setAutoFormatting(true);
     4591    writer.writeStartDocument();
     4592    writer.writeStartElement("qtPageIndex");
     4593
     4594    generatePageElements(writer, myTree->root(), marker);
     4595
     4596    writer.writeEndElement(); // qtPageIndex
     4597    writer.writeEndDocument();
     4598    file.close();
     4599}
     4600
     4601void HtmlGenerator::generateExtractionMark(const Node *node, ExtractionMarkType markType)
     4602{
     4603    if (markType != EndMark) {
     4604        out() << "<!-- $$$" + node->name();
     4605        if (markType == MemberMark) {
     4606            if (node->type() == Node::Function) {
     4607                const FunctionNode *func = static_cast<const FunctionNode *>(node);
     4608                if (!func->associatedProperty()) {
     4609                    if (func->overloadNumber() == 1)
     4610                        out() << "[overload1]";
     4611                    out() << "$$$" + func->name() + func->rawParameters().remove(' ');
     4612                }
     4613            } else if (node->type() == Node::Property) {
     4614                out() << "-prop";
     4615                const PropertyNode *prop = static_cast<const PropertyNode *>(node);
     4616                const NodeList &list = prop->functions();
     4617                foreach (const Node *propFuncNode, list) {
     4618                    if (propFuncNode->type() == Node::Function) {
     4619                        const FunctionNode *func = static_cast<const FunctionNode *>(propFuncNode);
     4620                        out() << "$$$" + func->name() + func->rawParameters().remove(' ');
     4621                    }
     4622                }
     4623            } else if (node->type() == Node::Enum) {
     4624                const EnumNode *enumNode = static_cast<const EnumNode *>(node);
     4625                foreach (const EnumItem &item, enumNode->items())
     4626                    out() << "$$$" + item.name();
     4627            }
     4628        } else if (markType == BriefMark) {
     4629            out() << "-brief";
     4630        } else if (markType == DetailedDescriptionMark) {
     4631            out() << "-description";
     4632        }
     4633        out() << " -->\n";
     4634    } else {
     4635        out() << "<!-- @@@" + node->name() + " -->\n";
    43474636    }
    43484637}
    43494638
    43504639#endif
     4640
     4641 QT_END_NAMESPACE
  • trunk/tools/qdoc3/htmlgenerator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4747#define HTMLGENERATOR_H
    4848
    49 #define QDOC_NAME_ALIGNMENT
    50 
    5149#include <qmap.h>
    5250#include <qregexp.h>
     51#include <QXmlStreamWriter>
    5352
    5453#include "codemarker.h"
     
    9089        Property,
    9190        Variable,
     91        QmlClass,
    9292        QmlProperty,
    9393        QmlSignal,
     
    9696    };
    9797
     98    enum Application {
     99        Online,
     100        Creator};
     101
    98102 public:
    99103    HtmlGenerator();
     
    105109    virtual void generateTree(const Tree *tree, CodeMarker *marker);
    106110
    107     static QString protect(const QString& string);
     111    QString protectEnc(const QString &string);
     112    static QString protect(const QString &string, const QString &encoding = "ISO-8859-1");
    108113    static QString cleanRef(const QString& ref);
    109114    static QString sinceTitle(int i) { return sinceTitles[i]; }
     
    116121    virtual void generateClassLikeNode(const InnerNode *inner, CodeMarker *marker);
    117122    virtual void generateFakeNode(const FakeNode *fake, CodeMarker *marker);
    118     virtual QString fileExtension(const Node *node);
     123    virtual QString fileExtension(const Node *node) const;
    119124    virtual QString refForNode(const Node *node);
    120125    virtual QString linkForNode(const Node *node, const Node *relative);
     
    123128 private:
    124129    enum SubTitleSize { SmallSubTitle, LargeSubTitle };
     130    enum ExtractionMarkType {
     131        BriefMark,
     132        DetailedDescriptionMark,
     133        MemberMark,
     134        EndMark
     135    };
    125136
    126137    const QPair<QString,QString> anchorForNode(const Node *node);
     
    129140                                  CodeMarker *marker,
    130141                                  const Atom *atom = 0);
    131     void generateHeader(const QString& title, const Node *node = 0,
    132                         CodeMarker *marker = 0, bool mainPage = true);
     142    void generateBreadCrumbs(const QString& title,
     143                             const Node *node,
     144                             CodeMarker *marker);
     145    void generateHeader(const QString& title,
     146                        const Node *node = 0,
     147                        CodeMarker *marker = 0);
    133148    void generateTitle(const QString& title,
    134149                       const Text &subTitle,
     
    151166                                 int numColumns,
    152167                                 const Node *relative = 0);
    153     QString generateListOfAllMemberFile(const InnerNode *inner, CodeMarker *marker);
     168    void generateTableOfContents(const Node *node,
     169                                 CodeMarker *marker,
     170                                 QList<Section>* sections = 0);
     171    QString generateListOfAllMemberFile(const InnerNode *inner,
     172                                        CodeMarker *marker);
     173    QString generateAllQmlMembersFile(const QmlClassNode* qml_cn,
     174                                      CodeMarker* marker);
    154175    QString generateLowStatusMemberFile(const InnerNode *inner,
    155176                                        CodeMarker *marker,
     
    164185                             CodeMarker *marker,
    165186                             const NodeMap &classMap,
     187                             bool includeAlphabet,
    166188                             QString commonPrefix = QString());
    167189    void generateFunctionIndex(const Node *relative, CodeMarker *marker);
     
    184206                                   CodeMarker *marker);
    185207    void generateQmlInherits(const QmlClassNode* cn, CodeMarker* marker);
     208    void generateQmlInheritedBy(const QmlClassNode* cn, CodeMarker* marker);
    186209    void generateQmlInstantiates(const QmlClassNode* qcn, CodeMarker* marker);
    187210    void generateInstantiatedBy(const ClassNode* cn, CodeMarker* marker);
    188211#endif
    189 #ifdef QDOC_NAME_ALIGNMENT
     212
    190213    void generateSection(const NodeList& nl,
    191214                         const Node *relative,
     
    196219                          CodeMarker *marker,
    197220                          CodeMarker::SynopsisStyle style,
    198                           bool nameAlignment = false);
    199     void generateSectionInheritedList(const Section& section,
    200                                       const Node *relative,
    201                                       CodeMarker *marker,
    202                                       bool nameAlignment = false);
    203     QString highlightedCode(const QString& markedCode,
    204                             CodeMarker *marker,
    205                             const Node *relative,
    206                             CodeMarker::SynopsisStyle style = CodeMarker::Accessors,
    207                             bool nameAlignment = false);
    208 #else
    209     void generateSynopsis(const Node *node,
    210                           const Node *relative,
    211                           CodeMarker *marker,
    212                           CodeMarker::SynopsisStyle style);
     221                          bool alignNames = false);
    213222    void generateSectionInheritedList(const Section& section,
    214223                                      const Node *relative,
    215224                                      CodeMarker *marker);
    216225    QString highlightedCode(const QString& markedCode,
    217                             CodeMarker *marker,
    218                             const Node *relative);
    219 #endif
     226                            CodeMarker* marker,
     227                            const Node* relative,
     228                            bool alignNames = false,
     229                            const Node* self = 0);
     230
    220231    void generateFullName(const Node *apparentNode,
    221232                          const Node *relative,
     
    231242   
    232243    QString registerRef(const QString& ref);
    233     QString fileBase(const Node *node);
     244    virtual QString fileBase(const Node *node) const;
    234245#if 0
    235246    QString fileBase(const Node *node, const SectionIterator& section);
     
    240251    void findAllLegaleseTexts(const InnerNode *node);
    241252    void findAllNamespaces(const InnerNode *node);
    242 #ifdef ZZZ_QDOC_QML   
    243     void findAllQmlClasses(const InnerNode *node);
    244 #endif
    245253    void findAllSince(const InnerNode *node);
    246254    static int hOffset(const Node *node);
     
    256264                               const QString &url,
    257265                               const QString &title);
     266#ifdef GENERATE_MAC_REFS   
    258267    void generateMacRef(const Node *node, CodeMarker *marker);
     268#endif
    259269    void beginLink(const QString &link,
    260270                   const Node *node,
     
    262272                   CodeMarker *marker);
    263273    void endLink();
     274    bool generatePageElement(QXmlStreamWriter& writer,
     275                             const Node* node,
     276                             CodeMarker* marker) const;
     277    void generatePageElements(QXmlStreamWriter& writer,
     278                              const Node* node,
     279                              CodeMarker* marker) const;
     280    void generatePageIndex(const QString& fileName,
     281                           CodeMarker* marker) const;
     282    void generateExtractionMark(const Node *node, ExtractionMarkType markType);
    264283
    265284#if 0
     
    283302    int numTableRows;
    284303    bool threeColumnEnumValueTable;
     304    Application application;
    285305    QString link;
    286306    QStringList sectionNumber;
     
    288308    QString style;
    289309    QString postHeader;
     310    QString postPostHeader;
     311    QString creatorPostHeader;
     312    QString creatorPostPostHeader;
    290313    QString footer;
    291314    QString address;
     
    308331    NodeMap namespaceIndex;
    309332    NodeMap serviceClasses;
    310 #ifdef QDOC_QML   
    311333    NodeMap qmlClasses;
    312 #endif
    313334    QMap<QString, NodeMap > funcIndex;
    314335    QMap<Text, const Node *> legaleseTexts;
     
    316337    static QString sinceTitles[];
    317338    NewClassMaps newClassMaps;
     339    NewClassMaps newQmlClassMaps;
     340    static int id;
     341 public:
     342    static bool debugging_on;
     343    static QString divNavTop;
    318344};
    319345
    320346#define HTMLGENERATOR_ADDRESS           "address"
    321347#define HTMLGENERATOR_FOOTER            "footer"
    322 #define HTMLGENERATOR_GENERATEMACREFS    "generatemacrefs" // ### document me
     348#define HTMLGENERATOR_GENERATEMACREFS   "generatemacrefs" // ### document me
    323349#define HTMLGENERATOR_POSTHEADER        "postheader"
     350#define HTMLGENERATOR_POSTPOSTHEADER    "postpostheader"
     351#define HTMLGENERATOR_CREATORPOSTHEADER        "postheader"
     352#define HTMLGENERATOR_CREATORPOSTPOSTHEADER    "postpostheader"
    324353#define HTMLGENERATOR_STYLE             "style"
    325354#define HTMLGENERATOR_STYLESHEETS       "stylesheets"
  • trunk/tools/qdoc3/jambiapiparser.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4343    jambiapiparser.cpp
    4444*/
    45 
    46 #include <QtXml>
    4745
    4846#include "cppcodeparser.h"
  • trunk/tools/qdoc3/jambiapiparser.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/javacodemarker.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    156156}
    157157
    158 const Node *JavaCodeMarker::resolveTarget(const QString &target, const Tree *tree,
    159                                           const Node *relative)
     158const Node *JavaCodeMarker::resolveTarget(const QString &target,
     159                                          const Tree *tree,
     160                                          const Node *relative,
     161                                          const Node* /* self */)
    160162{
    161163    if (target.endsWith("()")) {
  • trunk/tools/qdoc3/javacodemarker.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    7373    QString functionBeginRegExp( const QString& funcName );
    7474    QString functionEndRegExp( const QString& funcName );
    75     const Node *resolveTarget( const QString& target, const Tree *tree, const Node *relative );
     75    const Node* resolveTarget( const QString& target,
     76                               const Tree* tree,
     77                               const Node* relative,
     78                               const Node* self = 0 );
    7679};
    7780
  • trunk/tools/qdoc3/javadocgenerator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    146146}
    147147
    148 QString JavadocGenerator::fileExtension(const Node *node)
     148QString JavadocGenerator::fileExtension(const Node *node) const
    149149{
    150150    if (node->type() == Node::Fake) {
  • trunk/tools/qdoc3/javadocgenerator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    6262
    6363protected:
    64     QString fileExtension(const Node *node);
     64    QString fileExtension(const Node *node) const;
    6565    void startText( const Node *relative, CodeMarker *marker );
    6666    void endText( const Node *relative, CodeMarker *marker );
  • trunk/tools/qdoc3/linguistgenerator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    8383}
    8484
    85 QString LinguistGenerator::fileExtension(const Node * /* node */)
     85QString LinguistGenerator::fileExtension(const Node * /* node */) const
    8686{
    8787    return "ts";
     
    9090void LinguistGenerator::generateClassLikeNode(const InnerNode *inner, CodeMarker *marker)
    9191{
    92     out().setCodec("utf-8");
     92    out().setCodec("UTF-8");
    9393
    9494    QDomDocument document("TS");
     
    101101
    102102    QDomProcessingInstruction process = document.createProcessingInstruction(
    103         "xml", QString("version=\"1.0\" encoding=\"%1\"").arg("utf-8"));
     103        "xml", QString("version=\"1.0\" encoding=\"%1\"").arg("UTF-8"));
    104104    document.appendChild(process);
    105105    document.appendChild(documentElement);
  • trunk/tools/qdoc3/linguistgenerator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    7171                                       CodeMarker *marker);
    7272    virtual void generateFakeNode( const FakeNode *fake, CodeMarker *marker );
    73     virtual QString fileExtension(const Node *node);
     73    virtual QString fileExtension(const Node *node) const;
    7474
    7575    QList<QDomElement> generateIndexSections(QDomDocument &document,
  • trunk/tools/qdoc3/location.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    266266{
    267267    emitMessage(Error, message, details);
     268    information(message);
     269    information(details);
    268270    information("Aborting");
    269271    exit(EXIT_FAILURE);
  • trunk/tools/qdoc3/location.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/loutgenerator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/loutgenerator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/main.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4545
    4646#include <qglobal.h>
    47 #include <QtCore>
    4847#include <stdlib.h>
    4948#include "apigenerator.h"
     
    7069#include "sgmlgenerator.h"
    7170#include "webxmlgenerator.h"
     71#include "ditaxmlgenerator.h"
    7272#include "tokenizer.h"
    7373#include "tree.h"
     74#include <qdebug.h>
     75
     76#include "qtranslator.h"
     77#ifndef QT_BOOTSTRAPPED
     78#  include "qcoreapplication.h"
     79#endif
    7480
    7581QT_BEGIN_NAMESPACE
     
    100106static QStringList defines;
    101107static QHash<QString, Tree *> trees;
     108static QString appArg; // application
    102109
    103110/*!
     
    142149static void printVersion()
    143150{
    144     QString s = QString(tr("qdoc version ")) + QString(QT_VERSION_STR);
     151    QString s = tr("qdoc version %1").arg(QT_VERSION_STR);
    145152    Location::information(s);
    146153}
     
    152159static void processQdocconfFile(const QString &fileName)
    153160{
     161#ifndef QT_NO_TRANSLATION
    154162    QList<QTranslator *> translators;
     163#endif
    155164
    156165    /*
     
    183192    Location::initialize(config);
    184193    config.load(fileName);
     194
     195    /*
     196      Set the application to which qdoc will create the output.
     197      The two applications are:
     198
     199      creator: additional formatting for viewing in
     200      the Creator application.
     201
     202      online: full-featured online version with search and
     203      links to Qt topics
     204    */
     205    if (appArg.isEmpty()) {
     206        qDebug() << "Warning: Application flag not specified on"
     207                 << "command line. Options are -creator (default)"
     208                 << "and -online.";
     209        appArg = "creator";
     210    }
     211    config.setStringList(CONFIG_APPLICATION, QStringList(appArg));
    185212
    186213    /*
     
    208235    Generator::initialize(config);
    209236
     237#ifndef QT_NO_TRANSLATION
    210238    /*
    211239      Load the language translators, if the configuration specifies any.
     
    222250        ++fn;
    223251    }
     252#endif
    224253
    225254    //QSet<QString> outputLanguages = config.getStringSet(CONFIG_OUTPUTLANGUAGES);
     
    338367     */
    339368    QString tagFile = config.getString(CONFIG_TAGFILE);
    340     if (!tagFile.isEmpty())
     369    if (!tagFile.isEmpty()) {
    341370        tree->generateTagFile(tagFile);
     371    }
    342372
    343373    tree->setVersion("");
     
    351381    QDir::setCurrent(prevCurrentDir);
    352382
    353     foreach (QTranslator *translator, translators)
    354         delete translator;
     383#ifndef QT_NO_TRANSLATION
     384    qDeleteAll(translators);
     385#endif
     386#ifdef DEBUG_SHUTDOWN_CRASH   
     387    qDebug() << "main(): Delete tree";
     388#endif   
    355389    delete tree;
     390#ifdef DEBUG_SHUTDOWN_CRASH   
     391    qDebug() << "main(): Tree deleted";
     392#endif
    356393}
    357394
     
    362399    QT_USE_NAMESPACE
    363400
     401#ifndef QT_BOOTSTRAPPED
    364402    QCoreApplication app(argc, argv);
     403#endif
    365404    QString cf = "qsauncompress \1 \2";
    366405    PolyArchiveExtractor qsaExtractor(QStringList() << "qsa",cf);
     
    409448    SgmlGenerator smglGenerator;
    410449    WebXMLGenerator webxmlGenerator;
     450    DitaXmlGenerator ditaxmlGenerator;
    411451
    412452    QStringList qdocFiles;
     
    442482            obsoleteLinks = true;
    443483        }
     484        else if (opt == "-creator")
     485                appArg = "creator";
     486        else if (opt == "-online")
     487                appArg = "online";
    444488        else {
    445489            qdocFiles.append(opt);
     
    447491    }
    448492
    449     if (qdocFiles.isEmpty()) {
     493        if (qdocFiles.isEmpty()) {
    450494        printHelp();
    451495        return EXIT_FAILURE;
     
    455499      Main loop.
    456500     */
    457     foreach (QString qf, qdocFiles)
     501    foreach (QString qf, qdocFiles) {
     502        //qDebug() << "PROCESSING:" << qf;
    458503        processQdocconfFile(qf);
     504    }
    459505
    460506    qDeleteAll(trees);
  • trunk/tools/qdoc3/mangenerator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    188188}
    189189
    190 QString ManGenerator::fileExtension(const Node * /* node */)
     190QString ManGenerator::fileExtension(const Node * /* node */) const
    191191{
    192192    return "3qt";
  • trunk/tools/qdoc3/mangenerator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    6464    virtual void generateClassLikeNode(const InnerNode *node, CodeMarker *marker);
    6565    virtual void generateFakeNode( const FakeNode *fake, CodeMarker *marker );
    66     virtual QString fileExtension(const Node *node);
     66    virtual QString fileExtension(const Node *node) const;
    6767
    6868private:
  • trunk/tools/qdoc3/node.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4444*/
    4545
    46 #include <QtCore>
    4746#include "node.h"
     47#include "tree.h"
     48#include "codemarker.h"
     49#include <qdebug.h>
    4850
    4951QT_BEGIN_NAMESPACE
     
    8688
    8789/*!
     90  Construct a node with the given \a type and having the
     91  given \a parent and \a name. The new node is added to the
     92  parent's child list.
    8893 */
    8994Node::Node(Type type, InnerNode *parent, const QString& name)
    9095    : typ(type),
    9196      acc(Public),
     97      saf(UnspecifiedSafeness),
     98      pageTyp(NoPageType),
    9299      sta(Commendable),
    93       saf(UnspecifiedSafeness),
    94100      par(parent),
    95101      rel(0),
     
    98104    if (par)
    99105        par->addChild(this);
    100 }
    101 
    102 /*!
     106    //uuid = QUuid::createUuid();
     107}
     108
     109/*!
     110  Returns the node's URL.
    103111 */
    104112QString Node::url() const
     
    108116
    109117/*!
     118  Sets the node's URL to \a url
    110119 */
    111120void Node::setUrl(const QString &url)
     
    114123}
    115124
    116 /*!
     125void Node::setPageType(const QString& t)
     126{
     127    if ((t == "API") || (t == "api"))
     128        pageTyp = ApiPage;
     129    else if (t == "article")
     130        pageTyp = ArticlePage;
     131    else if (t == "example")
     132        pageTyp = ExamplePage;
     133}
     134
     135/*!
     136  Sets the pointer to the node that this node relates to.
    117137 */
    118138void Node::setRelates(InnerNode *pseudoParent)
     
    138158
    139159/*!
     160  Returns a string representing the access specifier.
     161 */
     162QString Node::accessString() const
     163{
     164    switch (acc) {
     165    case Protected:
     166        return "protected";
     167    case Private:
     168        return "private";
     169    case Public:
     170    default:
     171        break;
     172    }
     173    return "public";
     174}
     175
     176/*!
     177  Extract a class name from the type \a string and return it.
     178 */
     179QString Node::extractClassName(const QString &string) const
     180{
     181    QString result;
     182    for (int i=0; i<=string.size(); ++i) {
     183        QChar ch;
     184        if (i != string.size())
     185            ch = string.at(i);
     186
     187        QChar lower = ch.toLower();
     188        if ((lower >= QLatin1Char('a') && lower <= QLatin1Char('z')) ||
     189            ch.digitValue() >= 0 ||
     190            ch == QLatin1Char('_') ||
     191            ch == QLatin1Char(':')) {
     192            result += ch;
     193        }
     194        else if (!result.isEmpty()) {
     195            if (result != QLatin1String("const"))
     196                return result;
     197            result.clear();
     198        }
     199    }
     200    return result;
     201}
     202
     203/*!
     204  Returns a string representing the access specifier.
     205 */
     206QString RelatedClass::accessString() const
     207{
     208    switch (access) {
     209    case Node::Protected:
     210        return "protected";
     211    case Node::Private:
     212        return "private";
     213    case Node::Public:
     214    default:
     215        break;
     216    }
     217    return "public";
     218}
     219
     220/*!
    140221 */
    141222Node::Status Node::inheritedStatus() const
     
    148229
    149230/*!
     231  Returns the thread safeness value for whatever this node
     232  represents. But if this node has a parent and the thread
     233  safeness value of the parent is the same as the thread
     234  safeness value of this node, what is returned is the
     235  value \c{UnspecifiedSafeness}. Why?
    150236 */
    151237Node::ThreadSafeness Node::threadSafeness() const
     
    157243
    158244/*!
     245  If this node has a parent, the parent's thread safeness
     246  value is returned. Otherwise, this node's thread safeness
     247  value is returned. Why?
    159248 */
    160249Node::ThreadSafeness Node::inheritedThreadSafeness() const
     
    166255
    167256/*!
     257  Returns the sanitized file name without the path.
     258  If the the file is an html file, the html suffix
     259  is removed. Why?
    168260 */
    169261QString Node::fileBase() const
     
    179271
    180272/*!
     273  Returns this node's Universally Unique IDentifier.
     274  If its UUID has not yet been created, it is created
     275  first.
     276 */
     277QUuid Node::guid() const
     278{
     279    if (uuid.isNull())
     280        uuid = QUuid::createUuid();
     281    return uuid;
     282}
     283
     284/*!
     285  Composes a string to be used as an href attribute in DITA
     286  XML. It is composed of the file name and the UUID separated
     287  by a '#'. If this node is a class node, the file name is
     288  taken from this node; if this node is a function node, the
     289  file name is taken from the parent node of this node.
     290 */
     291QString Node::ditaXmlHref()
     292{
     293    QString href;
     294    if ((type() == Function) ||
     295        (type() == Property) ||
     296        (type() == Variable)) {
     297        href = parent()->fileBase();
     298    }
     299    else {
     300        href = fileBase();
     301    }
     302    if (!href.endsWith(".xml"))
     303        href += ".xml";
     304    return href + "#" + guid();
     305}
     306
     307/*!
    181308  \class InnerNode
    182309 */
    183310
    184311/*!
     312  The inner node destructor deletes the children and removes
     313  this node from its related nodes.
    185314 */
    186315InnerNode::~InnerNode()
     
    191320
    192321/*!
     322  Find the node in this node's children that has the
     323  given \a name. If this node is a QML class node, be
     324  sure to also look in the children of its property
     325  group nodes. Return the matching node or 0.
    193326 */
    194327Node *InnerNode::findNode(const QString& name)
    195328{
    196329    Node *node = childMap.value(name);
    197     if (node)
     330    if (node && node->subType() != QmlPropertyGroup)
    198331        return node;
     332    if ((type() == Fake) && (subType() == QmlClass)) {
     333        for (int i=0; i<children.size(); ++i) {
     334            Node* n = children.at(i);
     335            if (n->subType() == QmlPropertyGroup) {
     336                node = static_cast<InnerNode*>(n)->findNode(name);
     337                if (node)
     338                    return node;
     339            }
     340        }
     341    }
    199342    return primaryFunctionMap.value(name);
    200343}
    201344
    202345/*!
     346  Same as the other findNode(), but if the node with the
     347  specified \a name is not of the specified \a type, return
     348  0.
    203349 */
    204350Node *InnerNode::findNode(const QString& name, Type type)
     
    309455
    310456/*!
     457  Mark all child nodes that have no documentation as having
     458  private access and internal status. qdoc will then ignore
     459  them for documentation purposes.
    311460 */
    312461void InnerNode::makeUndocumentedChildrenInternal()
     
    382531/*!
    383532 */
    384 void InnerNode::removeFromRelated() 
     533void InnerNode::removeFromRelated()
    385534{
    386535    while (!related.isEmpty()) {
     
    399548
    400549/*!
    401   Returns true.
     550  Returns true because this is an inner node.
    402551 */
    403552bool InnerNode::isInnerNode() const
     
    423572
    424573/*!
    425   Find the function node in this node that has the given \a name. 
     574  Find the function node in this node that has the given \a name.
    426575 */
    427576const FunctionNode *InnerNode::findFunctionNode(const QString& name) const
     
    453602
    454603/*!
     604  Returnds the sequence number of the function node \a func
     605  in the list of overloaded functions for a class, such that
     606  all the functions have the same name as the \a func.
    455607 */
    456608int InnerNode::overloadNumber(const FunctionNode *func) const
     
    466618
    467619/*!
     620  Returns the number of member functions of a class such that
     621  the functions are all named \a funcName.
    468622 */
    469623int InnerNode::numOverloads(const QString& funcName) const
     
    478632
    479633/*!
     634  Returns a node list containing all the member functions of
     635  some class such that the functions overload the name \a funcName.
    480636 */
    481637NodeList InnerNode::overloads(const QString &funcName) const
     
    491647
    492648/*!
     649  Construct an inner node (i.e., not a leaf node) of the
     650  given \a type and having the given \a parent and \a name.
    493651 */
    494652InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name)
    495653    : Node(type, parent, name)
    496654{
    497 }
    498 
    499 /*!
     655    switch (type) {
     656    case Class:
     657    case Namespace:
     658        setPageType(ApiPage);
     659        break;
     660    default:
     661        break;
     662    }
     663}
     664
     665/*!
     666  Appends an \a include file to the list of include files.
    500667 */
    501668void InnerNode::addInclude(const QString& include)
     
    505672
    506673/*!
     674  Sets the list of include files to \a includes.
    507675 */
    508676void InnerNode::setIncludes(const QStringList& includes)
     
    548716
    549717/*!
     718  Adds the \a child to this node's child list.
    550719 */
    551720void InnerNode::addChild(Node *child)
     
    565734        if (child->type() == Enum)
    566735            enumChildren.append(child);
    567         childMap.insert(child->name(), child);
     736        childMap.insert(child->name(), child);
    568737    }
    569738}
     
    579748                primaryFunctionMap.find(child->name());
    580749        NodeList& secs = secondaryFunctionMap[child->name()];
    581         if (*prim == child) {
     750        if (prim != primaryFunctionMap.end() && *prim == child) {
    582751            if (secs.isEmpty()) {
    583752                primaryFunctionMap.remove(child->name());
     
    591760        }
    592761        QMap<QString, Node *>::Iterator ent = childMap.find( child->name() );
    593         if ( *ent == child )
     762        if (ent != childMap.end() && *ent == child)
    594763            childMap.erase( ent );
    595764    }
    596765    else {
    597766        QMap<QString, Node *>::Iterator ent = childMap.find(child->name());
    598         if (*ent == child)
     767        if (ent != childMap.end() && *ent == child)
    599768            childMap.erase(ent);
    600769    }
     
    677846
    678847/*!
     848  Constructs a leaf node named \a name of the specified
     849  \a type. The new leaf node becomes a child of \a parent.
    679850 */
    680851LeafNode::LeafNode(Type type, InnerNode *parent, const QString& name)
    681852    : Node(type, parent, name)
    682853{
     854    switch (type) {
     855    case Enum:
     856    case Function:
     857    case Typedef:
     858    case Variable:
     859    case QmlProperty:
     860    case QmlSignal:
     861    case QmlMethod:
     862        setPageType(ApiPage);
     863        break;
     864    default:
     865        break;
     866    }
    683867}
    684868
     
    688872
    689873/*!
     874  Constructs a namespace node.
    690875 */
    691876NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name)
    692877    : InnerNode(Namespace, parent, name)
    693878{
     879    setPageType(ApiPage);
    694880}
    695881
    696882/*!
    697883  \class ClassNode
    698  */
    699 
    700 /*!
     884  \brief This class represents a C++ class.
     885 */
     886
     887/*!
     888  Constructs a class node. A class node will generate an API page.
    701889 */
    702890ClassNode::ClassNode(InnerNode *parent, const QString& name)
     
    704892{
    705893    hidden = false;
     894    abstract = false;
     895    setPageType(ApiPage);
    706896}
    707897
     
    712902                             const QString &dataTypeWithTemplateArgs)
    713903{
    714     bas.append(RelatedClass(access, node, dataTypeWithTemplateArgs));
    715     node->der.append(RelatedClass(access, this));
     904    bases.append(RelatedClass(access, node, dataTypeWithTemplateArgs));
     905    node->derived.append(RelatedClass(access, this));
    716906}
    717907
     
    721911{
    722912    int i;
    723 
    724913    i = 0;
    725     while (i < bas.size()) {
    726         ClassNode *baseClass = bas.at(i).node;
    727         if (baseClass->access() == Node::Private) {
    728             bas.removeAt(i);
    729 
    730             const QList<RelatedClass> &basesBases = baseClass->baseClasses();
    731             for (int j = basesBases.size() - 1; j >= 0; --j)
    732                 bas.insert(i, basesBases.at(j));
     914    while (i < bases.size()) {
     915        ClassNode* bc = bases.at(i).node;
     916        if (bc->access() == Node::Private) {
     917            RelatedClass rc = bases.at(i);
     918            bases.removeAt(i);
     919            ignoredBases.append(rc);
     920            const QList<RelatedClass> &bb = bc->baseClasses();
     921            for (int j = bb.size() - 1; j >= 0; --j)
     922                bases.insert(i, bb.at(j));
    733923        }
    734924        else {
     
    738928
    739929    i = 0;
    740     while (i < der.size()) {
    741         ClassNode *derivedClass = der.at(i).node;
    742         if (derivedClass->access() == Node::Private) {
    743             der.removeAt(i);
    744 
    745             const QList<RelatedClass> &dersDers =
    746                 derivedClass->derivedClasses();
    747             for (int j = dersDers.size() - 1; j >= 0; --j)
    748                 der.insert(i, dersDers.at(j));
     930    while (i < derived.size()) {
     931        ClassNode* dc = derived.at(i).node;
     932        if (dc->access() == Node::Private) {
     933            derived.removeAt(i);
     934            const QList<RelatedClass> &dd = dc->derivedClasses();
     935            for (int j = dd.size() - 1; j >= 0; --j)
     936                derived.insert(i, dd.at(j));
    749937        }
    750938        else {
     
    755943
    756944/*!
     945  Search the child list to find the property node with the
     946  specified \a name.
     947 */
     948const PropertyNode* ClassNode::findPropertyNode(const QString& name) const
     949{
     950    const Node* n = findNode(name,Node::Property);
     951    return (n ? static_cast<const PropertyNode*>(n) : 0);
     952}
     953
     954/*!
    757955  \class FakeNode
    758956 */
     
    760958/*!
    761959  The type of a FakeNode is Fake, and it has a \a subtype,
    762   which specifies the type of FakeNode.
     960  which specifies the type of FakeNode. The page type for
     961  the page index is set here.
    763962 */
    764963FakeNode::FakeNode(InnerNode *parent, const QString& name, SubType subtype)
    765964    : InnerNode(Fake, parent, name), sub(subtype)
    766965{
     966    switch (subtype) {
     967    case Module:
     968    case Page:
     969    case Group:
     970        setPageType(ArticlePage);
     971        break;
     972    case QmlClass:
     973    case QmlBasicType:
     974        setPageType(ApiPage);
     975        break;
     976    case Example:
     977        setPageType(ExamplePage);
     978        break;
     979    default:
     980        break;
     981    }
     982}
     983
     984/*!
     985  Returns the fake node's title. This is used for the page title.
     986*/
     987QString FakeNode::title() const
     988{
     989    return tle;
    767990}
    768991
     
    8171040
    8181041/*!
     1042  The constructor for the node representing an enum type
     1043  has a \a parent class and an enum type \a name.
    8191044 */
    8201045EnumNode::EnumNode(InnerNode *parent, const QString& name)
     
    8241049
    8251050/*!
     1051  Add \a item to the enum type's item list.
    8261052 */
    8271053void EnumNode::addItem(const EnumItem& item)
     
    8321058
    8331059/*!
     1060  Returns the access level of the enumeration item named \a name.
     1061  Apparently it is private if it has been omitted by qdoc's
     1062  omitvalue command. Otherwise it is public.
    8341063 */
    8351064Node::Access EnumNode::itemAccess(const QString &name) const
    8361065{
    837     if (doc().omitEnumItemNames().contains(name)) {
     1066    if (doc().omitEnumItemNames().contains(name))
    8381067        return Private;
    839     }
    840     else {
    841         return Public;
    842     }
     1068    return Public;
    8431069}
    8441070
     
    9051131/*!
    9061132  Assigning Parameter \a p to this Parameter copies the
    907   strings across. 
     1133  strings across.
    9081134 */
    9091135Parameter& Parameter::operator=(const Parameter& p)
     
    9751201
    9761202/*!
     1203  Sets the \a virtualness of this function. If the \a virtualness
     1204  is PureVirtual, and if the parent() is a ClassNode, set the parent's
     1205  \e abstract flag to true.
     1206 */
     1207void FunctionNode::setVirtualness(Virtualness virtualness)
     1208{
     1209    vir = virtualness;
     1210    if ((virtualness == PureVirtual) && parent() &&
     1211        (parent()->type() == Node::Class))
     1212        parent()->setAbstract(true);
     1213}
     1214
     1215/*!
    9771216 */
    9781217void FunctionNode::setOverload(bool overlode)
     
    10641303    }
    10651304    return names;
     1305}
     1306
     1307/*!
     1308  Returns a raw list of parameters. If \a names is true, the
     1309  names are included. If \a values is true, the default values
     1310  are included, if any are present.
     1311 */
     1312QString FunctionNode::rawParameters(bool names, bool values) const
     1313{
     1314    QString raw;
     1315    foreach (const Parameter &parameter, parameters()) {
     1316        raw += parameter.leftType() + parameter.rightType();
     1317        if (names)
     1318            raw += parameter.name();
     1319        if (values)
     1320            raw += parameter.defaultValue();
     1321    }
     1322    return raw;
    10661323}
    10671324
     
    11101367void FunctionNode::debug() const
    11111368{
    1112     qDebug() << "QML METHOD" << name() << "rt" << rt << "pp" << pp;
     1369    qDebug("QML METHOD %s rt %s pp %s",
     1370            qPrintable(name()), qPrintable(rt), qPrintable(pp.join(" ")));
    11131371}
    11141372
    11151373/*!
    11161374  \class PropertyNode
    1117  */
    1118 
    1119 /*!
     1375
     1376  This class describes one instance of using the Q_PROPERTY macro.
     1377 */
     1378
     1379/*!
     1380  The constructor sets the \a parent and the \a name, but
     1381  everything else is set to default values.
    11201382 */
    11211383PropertyNode::PropertyNode(InnerNode *parent, const QString& name)
     
    11231385      sto(Trool_Default),
    11241386      des(Trool_Default),
     1387      scr(Trool_Default),
     1388      wri(Trool_Default),
     1389      usr(Trool_Default),
     1390      cst(false),
     1391      fnl(false),
    11251392      overrides(0)
    11261393{
    1127 }
    1128 
    1129 /*!
    1130  */
    1131 void PropertyNode::setOverriddenFrom(const PropertyNode *baseProperty)
     1394    // nothing.
     1395}
     1396
     1397/*!
     1398  Sets this property's \e {overridden from} property to
     1399  \a baseProperty, which indicates that this property
     1400  overrides \a baseProperty. To begin with, all the values
     1401  in this property are set to the corresponding values in
     1402  \a baseProperty.
     1403
     1404  We probably should ensure that the constant and final
     1405  attributes are not being overridden improperly.
     1406 */
     1407void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty)
    11321408{
    11331409    for (int i = 0; i < NumFunctionRoles; ++i) {
     
    11391415    if (des == Trool_Default)
    11401416        des = baseProperty->des;
     1417    if (scr == Trool_Default)
     1418        scr = baseProperty->scr;
     1419    if (wri == Trool_Default)
     1420        wri = baseProperty->wri;
     1421    if (usr == Trool_Default)
     1422        usr = baseProperty->usr;
    11411423    overrides = baseProperty;
    11421424}
     
    11641446}
    11651447
    1166 /*!
     1448/*! Converts the \a boolean value to an enum representation
     1449  of the boolean type, which includes an enum  value for the
     1450  \e {default value} of the item, i.e. true, false, or default.
    11671451 */
    11681452PropertyNode::Trool PropertyNode::toTrool(bool boolean)
     
    11721456
    11731457/*!
     1458  Converts the enum \a troolean back to a boolean value.
     1459  If \a troolean is neither the true enum value nor the
     1460  false enum value, the boolean value returned is
     1461  \a defaultValue.
     1462
     1463  Note that runtimeDesignabilityFunction() should be called
     1464  first. If that function returns the name of a function, it
     1465  means the function must be called at runtime to determine
     1466  whether the property is Designable.
    11741467 */
    11751468bool PropertyNode::fromTrool(Trool troolean, bool defaultValue)
     
    12061499#ifdef QDOC_QML
    12071500bool QmlClassNode::qmlOnly = false;
    1208 
    1209 /*!
    1210   Constructor for the Qml class node.
     1501QMultiMap<QString,Node*> QmlClassNode::inheritedBy;
     1502
     1503/*!
     1504  Constructs a Qml class node (i.e. a Fake node with the
     1505  subtype QmlClass. The new node has the given \a parent
     1506  and \a name and is associated with the C++ class node
     1507  specified by \a cn which may be null if the the Qml
     1508  class node is not associated with a C++ class node.
    12111509 */
    12121510QmlClassNode::QmlClassNode(InnerNode *parent,
     
    12151513    : FakeNode(parent, name, QmlClass), cnode(cn)
    12161514{
    1217     setTitle((qmlOnly ? "" : "QML ") + name + " Element Reference");
     1515    if (name.startsWith(QLatin1String("QML:")))
     1516        setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name.mid(4) + QLatin1String(" Element"));
     1517    else
     1518        setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name + QLatin1String(" Element"));
     1519}
     1520
     1521/*!
     1522  I made this so I could print a debug message here.
     1523 */
     1524QmlClassNode::~QmlClassNode()
     1525{
     1526#ifdef DEBUG_MULTIPLE_QDOCCONF_FILES
     1527    qDebug() << "Deleting QmlClassNode:" << name();
     1528#endif
     1529}
     1530
     1531/*!
     1532  Clear the multimap so that subsequent runs don't try to use
     1533  nodes from a previous run.
     1534 */
     1535void QmlClassNode::clear()
     1536{
     1537    inheritedBy.clear();
    12181538}
    12191539
     
    12261546QString QmlClassNode::fileBase() const
    12271547{
    1228 #if 0   
     1548#if 0
    12291549    if (Node::fileBase() == "item")
    12301550        qDebug() << "FILEBASE: qmlitem" << name();
     
    12351555
    12361556/*!
     1557  Record the fact that QML class \a base is inherited by
     1558  QML class \a sub.
     1559 */
     1560void QmlClassNode::addInheritedBy(const QString& base, Node* sub)
     1561{
     1562    inheritedBy.insert(base,sub);
     1563#ifdef DEBUG_MULTIPLE_QDOCCONF_FILES
     1564    qDebug() << "QmlClassNode::addInheritedBy(): insert" << base << sub->name() << inheritedBy.size();
     1565#endif
     1566}
     1567
     1568/*!
     1569  Loads the list \a subs with the nodes of all the subclasses of \a base.
     1570 */
     1571void QmlClassNode::subclasses(const QString& base, NodeList& subs)
     1572{
     1573    subs.clear();
     1574    if (inheritedBy.count(base) > 0) {
     1575        subs = inheritedBy.values(base);
     1576#ifdef DEBUG_MULTIPLE_QDOCCONF_FILES
     1577        qDebug() << "QmlClassNode::subclasses():" <<  inheritedBy.count(base) << base
     1578                 << "subs:" << subs.size() << "total size:" << inheritedBy.size();
     1579#endif
     1580    }
     1581}
     1582
     1583/*!
     1584  Constructs a Qml basic type node (i.e. a Fake node with
     1585  the subtype QmlBasicType. The new node has the given
     1586  \a parent and \a name.
     1587 */
     1588QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent,
     1589                                   const QString& name)
     1590    : FakeNode(parent, name, QmlBasicType)
     1591{
     1592    setTitle(name);
     1593}
     1594
     1595/*!
    12371596  Constructor for the Qml property group node. \a parent is
    1238   always a QmlClassNode. 
     1597  always a QmlClassNode.
    12391598 */
    12401599QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent,
     
    12611620      att(attached)
    12621621{
    1263     // nothing.
     1622    setPageType(ApiPage);
    12641623}
    12651624
     
    12861645    }
    12871646}
     1647
     1648static QString valueType(const QString& n)
     1649{
     1650    if (n == "QPoint")
     1651        return "QDeclarativePointValueType";
     1652    if (n == "QPointF")
     1653        return "QDeclarativePointFValueType";
     1654    if (n == "QSize")
     1655        return "QDeclarativeSizeValueType";
     1656    if (n == "QSizeF")
     1657        return "QDeclarativeSizeFValueType";
     1658    if (n == "QRect")
     1659        return "QDeclarativeRectValueType";
     1660    if (n == "QRectF")
     1661        return "QDeclarativeRectFValueType";
     1662    if (n == "QVector2D")
     1663        return "QDeclarativeVector2DValueType";
     1664    if (n == "QVector3D")
     1665        return "QDeclarativeVector3DValueType";
     1666    if (n == "QVector4D")
     1667        return "QDeclarativeVector4DValueType";
     1668    if (n == "QQuaternion")
     1669        return "QDeclarativeQuaternionValueType";
     1670    if (n == "QMatrix4x4")
     1671        return "QDeclarativeMatrix4x4ValueType";
     1672    if (n == "QEasingCurve")
     1673        return "QDeclarativeEasingValueType";
     1674    if (n == "QFont")
     1675        return "QDeclarativeFontValueType";
     1676    return QString();
     1677}
     1678
     1679/*!
     1680  Returns true if a QML property or attached property is
     1681  read-only. The algorithm for figuring this out is long
     1682  amd tedious and almost certainly will break. It currently
     1683  doesn't work for qmlproperty bool PropertyChanges::explicit,
     1684  because the tokenized gets confused on "explicit" .
     1685 */
     1686bool QmlPropertyNode::isWritable(const Tree* tree) const
     1687{
     1688    Node* n = parent();
     1689    while (n && n->subType() != Node::QmlClass)
     1690        n = n->parent();
     1691    if (n) {
     1692        const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n);
     1693        const ClassNode* cn = qcn->classNode();
     1694        if (cn) {
     1695            QStringList dotSplit = name().split(QChar('.'));
     1696            const PropertyNode* pn = cn->findPropertyNode(dotSplit[0]);
     1697            if (pn) {
     1698                if (dotSplit.size() > 1) {
     1699                    QStringList path(extractClassName(pn->qualifiedDataType()));
     1700                    const Node* nn = tree->findNode(path,Class);
     1701                    if (nn) {
     1702                        const ClassNode* cn = static_cast<const ClassNode*>(nn);
     1703                        pn = cn->findPropertyNode(dotSplit[1]);
     1704                        if (pn) {
     1705                            return pn->isWritable();
     1706                        }
     1707                        else {
     1708                            const QList<RelatedClass>& bases = cn->baseClasses();
     1709                            if (!bases.isEmpty()) {
     1710                                for (int i=0; i<bases.size(); ++i) {
     1711                                    const ClassNode* cn = bases[i].node;
     1712                                    pn = cn->findPropertyNode(dotSplit[1]);
     1713                                    if (pn) {
     1714                                        return pn->isWritable();
     1715                                    }
     1716                                }
     1717                            }
     1718                            const QList<RelatedClass>& ignoredBases = cn->ignoredBaseClasses();
     1719                            if (!ignoredBases.isEmpty()) {
     1720                                for (int i=0; i<ignoredBases.size(); ++i) {
     1721                                    const ClassNode* cn = ignoredBases[i].node;
     1722                                    pn = cn->findPropertyNode(dotSplit[1]);
     1723                                    if (pn) {
     1724                                        return pn->isWritable();
     1725                                    }
     1726                                }
     1727                            }
     1728                            QString vt = valueType(cn->name());
     1729                            if (!vt.isEmpty()) {
     1730                                QStringList path(vt);
     1731                                const Node* vtn = tree->findNode(path,Class);
     1732                                if (vtn) {
     1733                                    const ClassNode* cn = static_cast<const ClassNode*>(vtn);
     1734                                    pn = cn->findPropertyNode(dotSplit[1]);
     1735                                    if (pn) {
     1736                                        return pn->isWritable();
     1737                                    }
     1738                                }
     1739                            }
     1740                        }
     1741                    }
     1742                }
     1743                else {
     1744                    return pn->isWritable();
     1745                }
     1746            }
     1747            else {
     1748                const QList<RelatedClass>& bases = cn->baseClasses();
     1749                if (!bases.isEmpty()) {
     1750                    for (int i=0; i<bases.size(); ++i) {
     1751                        const ClassNode* cn = bases[i].node;
     1752                        pn = cn->findPropertyNode(dotSplit[0]);
     1753                        if (pn) {
     1754                            return pn->isWritable();
     1755                        }
     1756                    }
     1757                }
     1758                const QList<RelatedClass>& ignoredBases = cn->ignoredBaseClasses();
     1759                if (!ignoredBases.isEmpty()) {
     1760                    for (int i=0; i<ignoredBases.size(); ++i) {
     1761                        const ClassNode* cn = ignoredBases[i].node;
     1762                        pn = cn->findPropertyNode(dotSplit[0]);
     1763                        if (pn) {
     1764                            return pn->isWritable();
     1765                        }
     1766                    }
     1767                }
     1768                if (isAttached()) {
     1769                    QString classNameAttached = cn->name() + "Attached";
     1770                    QStringList path(classNameAttached);
     1771                    const Node* nn = tree->findNode(path,Class);
     1772                    const ClassNode* acn = static_cast<const ClassNode*>(nn);
     1773                    pn = acn->findPropertyNode(dotSplit[0]);
     1774                    if (pn) {
     1775                        return pn->isWritable();
     1776                    }
     1777                }
     1778            }
     1779        }
     1780    }
     1781    location().warning(tr("Can't determine read-only status of QML property %1; writable assumed.").arg(name()));
     1782    return true;
     1783}
     1784
    12881785#endif
    12891786
  • trunk/tools/qdoc3/node.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5656#include "location.h"
    5757#include "text.h"
     58#include <QUuid>
    5859
    5960QT_BEGIN_NAMESPACE
     
    9798        ExternalPage,
    9899        QmlClass,
    99         QmlPropertyGroup
     100        QmlPropertyGroup,
     101        QmlBasicType
    100102#else
    101103        ExternalPage
     
    137139    };
    138140
     141    enum PageType {
     142        NoPageType,
     143        ApiPage,
     144        ArticlePage,
     145        ExamplePage
     146    };
     147
    139148    virtual ~Node();
    140149
     
    145154    void setThreadSafeness(ThreadSafeness safeness) { saf = safeness; }
    146155    void setSince(const QString &since) { sinc = since; }
    147     void setRelates(InnerNode *pseudoParent);
     156    void setRelates(InnerNode* pseudoParent);
    148157    void setModuleName(const QString &module) { mod = module; }
    149158    void setLink(LinkType linkType, const QString &link, const QString &desc);
    150159    void setUrl(const QString &url);
    151160    void setTemplateStuff(const QString &templateStuff) { tpl = templateStuff; }
     161    void setPageType(PageType t) { pageTyp = t; }
     162    void setPageType(const QString& t);
    152163
    153164    virtual bool isInnerNode() const = 0;
    154165    virtual bool isReimp() const { return false; }
    155166    virtual bool isFunction() const { return false; }
     167    virtual bool isQmlNode() const { return false; }
    156168    Type type() const { return typ; }
    157169    virtual SubType subType() const { return NoSubType; }
    158     InnerNode *parent() const { return par; }
    159     InnerNode *relates() const { return rel; }
     170    InnerNode* parent() const { return par; }
     171    InnerNode* relates() const { return rel; }
    160172    const QString& name() const { return nam; }
    161173    QMap<LinkType, QPair<QString,QString> > links() const { return linkMap; }
     
    165177
    166178    Access access() const { return acc; }
     179    QString accessString() const;
    167180    const Location& location() const { return loc; }
    168181    const Doc& doc() const { return d; }
     
    173186    QString since() const { return sinc; }
    174187    QString templateStuff() const { return tpl; }
     188    PageType pageType() const { return pageTyp; }
     189    virtual void addPageKeywords(const QString& ) { }
    175190
    176191    void clearRelated() { rel = 0; }
    177192
    178193    virtual QString fileBase() const;
     194    QUuid guid() const;
     195    QString ditaXmlHref();
     196    QString extractClassName(const QString &string) const;
    179197
    180198 protected:
    181     Node(Type type, InnerNode *parent, const QString& name);
     199    Node(Type type, InnerNode* parent, const QString& name);
    182200
    183201 private:
     
    186204    Type typ;
    187205    Access acc;
     206    ThreadSafeness saf;
     207    PageType pageTyp;
    188208    Status sta;
    189     ThreadSafeness saf;
    190209#else
    191210    Type typ : 4;
    192211    Access acc : 2;
     212    ThreadSafeness saf : 2;
     213    PageType pageTyp : 4;
    193214    Status sta : 3;
    194     ThreadSafeness saf : 2;
    195215#endif
    196     InnerNode *par;
    197     InnerNode *rel;
     216    InnerNode* par;
     217    InnerNode* rel;
    198218    QString nam;
    199219    Location loc;
     
    204224    QString sinc;
    205225    QString tpl;
     226    mutable QUuid uuid;
    206227};
    207228
     
    209230class EnumNode;
    210231
    211 typedef QList<Node *> NodeList;
     232typedef QList<Node*> NodeList;
    212233
    213234class InnerNode : public Node
     
    216237    virtual ~InnerNode();
    217238
    218     Node *findNode(const QString& name);
    219     Node *findNode(const QString& name, Type type);
    220     FunctionNode *findFunctionNode(const QString& name);
    221     FunctionNode *findFunctionNode(const FunctionNode *clone);
     239    Node* findNode(const QString& name);
     240    Node* findNode(const QString& name, Type type);
     241    FunctionNode* findFunctionNode(const QString& name);
     242    FunctionNode* findFunctionNode(const FunctionNode* clone);
    222243    void addInclude(const QString &include);
    223244    void setIncludes(const QStringList &includes);
    224     void setOverload(const FunctionNode *func, bool overlode);
     245    void setOverload(const FunctionNode* func, bool overlode);
    225246    void normalizeOverloads();
    226247    void makeUndocumentedChildrenInternal();
     
    229250
    230251    virtual bool isInnerNode() const;
    231     const Node *findNode(const QString& name) const;
    232     const Node *findNode(const QString& name, Type type) const;
    233     const FunctionNode *findFunctionNode(const QString& name) const;
    234     const FunctionNode *findFunctionNode(const FunctionNode *clone) const;
    235     const EnumNode *findEnumNodeForValue(const QString &enumValue) const;
     252    const Node* findNode(const QString& name) const;
     253    const Node* findNode(const QString& name, Type type) const;
     254    const FunctionNode* findFunctionNode(const QString& name) const;
     255    const FunctionNode* findFunctionNode(const FunctionNode* clone) const;
     256    const EnumNode* findEnumNodeForValue(const QString &enumValue) const;
    236257    const NodeList & childNodes() const { return children; }
    237258    const NodeList & relatedNodes() const { return related; }
    238259    int count() const { return children.size(); }
    239     int overloadNumber(const FunctionNode *func) const;
     260    int overloadNumber(const FunctionNode* func) const;
    240261    int numOverloads(const QString& funcName) const;
    241262    NodeList overloads(const QString &funcName) const;
     
    244265    QStringList primaryKeys();
    245266    QStringList secondaryKeys();
     267    const QStringList& pageKeywords() const { return pageKeywds; }
     268    virtual void addPageKeywords(const QString& t) { pageKeywds << t; }
     269    virtual bool isAbstract() const { return false; }
     270    virtual void setAbstract(bool ) { }
    246271
    247272 protected:
    248     InnerNode(Type type, InnerNode *parent, const QString& name);
     273    InnerNode(Type type, InnerNode* parent, const QString& name);
    249274
    250275 private:
    251276    friend class Node;
    252277
    253     static bool isSameSignature(const FunctionNode *f1, const FunctionNode *f2);
    254     void addChild(Node *child);
    255     void removeChild(Node *child);
    256     void removeRelated(Node *pseudoChild);
    257 
     278    static bool isSameSignature(const FunctionNode* f1, const FunctionNode* f2);
     279    void addChild(Node* child);
     280    void removeChild(Node* child);
     281    void removeRelated(Node* pseudoChild);
     282
     283    QStringList pageKeywds;
    258284    QStringList inc;
    259285    NodeList children;
    260286    NodeList enumChildren;
    261287    NodeList related;
    262     QMap<QString, Node *> childMap;
    263     QMap<QString, Node *> primaryFunctionMap;
     288    QMap<QString, Node*> childMap;
     289    QMap<QString, Node*> primaryFunctionMap;
    264290    QMap<QString, NodeList> secondaryFunctionMap;
    265291};
     
    280306{
    281307 public:
    282     NamespaceNode(InnerNode *parent, const QString& name);
     308    NamespaceNode(InnerNode* parent, const QString& name);
    283309    virtual ~NamespaceNode() { }
    284310};
     
    295321        node(node0),
    296322        dataTypeWithTemplateArgs(dataTypeWithTemplateArgs0) { }
     323    QString accessString() const;
    297324
    298325    Node::Access        access;
     
    301328};
    302329
     330class PropertyNode;
     331
    303332class ClassNode : public InnerNode
    304333{
    305334 public:
    306     ClassNode(InnerNode *parent, const QString& name);
     335    ClassNode(InnerNode* parent, const QString& name);
    307336    virtual ~ClassNode() { }
    308337
    309338    void addBaseClass(Access access,
    310                       ClassNode *node,
     339                      ClassNode* node,
    311340                      const QString &dataTypeWithTemplateArgs = "");
    312341    void fixBaseClasses();
    313342
    314     const QList<RelatedClass> &baseClasses() const { return bas; }
    315     const QList<RelatedClass> &derivedClasses() const { return der; }
     343    const QList<RelatedClass> &baseClasses() const { return bases; }
     344    const QList<RelatedClass> &derivedClasses() const { return derived; }
     345    const QList<RelatedClass> &ignoredBaseClasses() const { return ignoredBases; }
    316346
    317347    bool hideFromMainList() const { return hidden; }
     
    322352    QString qmlElement() const { return qmlelement; }
    323353    void setQmlElement(const QString& value) { qmlelement = value; }
    324 
    325  private:
    326     QList<RelatedClass> bas;
    327     QList<RelatedClass> der;
     354    virtual bool isAbstract() const { return abstract; }
     355    virtual void setAbstract(bool b) { abstract = b; }
     356    const PropertyNode* findPropertyNode(const QString& name) const;
     357
     358 private:
     359    QList<RelatedClass> bases;
     360    QList<RelatedClass> derived;
     361    QList<RelatedClass> ignoredBases;
    328362    bool hidden;
     363    bool abstract;
    329364    QString sname;
    330365    QString qmlelement;
     
    335370 public:
    336371
    337     FakeNode(InnerNode *parent, const QString& name, SubType subType);
     372    FakeNode(InnerNode* parent, const QString& name, SubType subType);
    338373    virtual ~FakeNode() { }
    339374
    340375    void setTitle(const QString &title) { tle = title; }
    341376    void setSubTitle(const QString &subTitle) { stle = subTitle; }
    342     void addGroupMember(Node *node) { gr.append(node); }
     377    void addGroupMember(Node* node) { gr.append(node); }
    343378
    344379    SubType subType() const { return sub; }
    345     QString title() const { return tle; }
    346     QString fullTitle() const;
    347     QString subTitle() const;
     380    virtual QString title() const;
     381    virtual QString fullTitle() const;
     382    virtual QString subTitle() const;
    348383    const NodeList &groupMembers() const { return gr; }
    349384    virtual QString nameForLists() const { return title(); }
     
    360395{
    361396 public:
    362     QmlClassNode(InnerNode *parent,
     397    QmlClassNode(InnerNode* parent,
    363398                 const QString& name,
    364399                 const ClassNode* cn);
    365     virtual ~QmlClassNode() { }
     400    virtual ~QmlClassNode();
     401    virtual bool isQmlNode() const { return true; }
    366402
    367403    const ClassNode* classNode() const { return cnode; }
    368404    virtual QString fileBase() const;
    369 
     405    static void addInheritedBy(const QString& base, Node* sub);
     406    static void subclasses(const QString& base, NodeList& subs);
     407    static void clear();
     408
     409 public:
    370410    static bool qmlOnly;
    371 
    372  private:
    373     const ClassNode* cnode;
     411    static QMultiMap<QString,Node*> inheritedBy;
     412
     413 private:
     414    const ClassNode*    cnode;
     415};
     416
     417class QmlBasicTypeNode : public FakeNode
     418{
     419 public:
     420    QmlBasicTypeNode(InnerNode* parent,
     421                     const QString& name);
     422    virtual ~QmlBasicTypeNode() { }
     423    virtual bool isQmlNode() const { return true; }
    374424};
    375425
     
    381431                     bool attached);
    382432    virtual ~QmlPropGroupNode() { }
     433    virtual bool isQmlNode() const { return true; }
    383434
    384435    const QString& element() const { return parent()->name(); }
     
    391442    bool    att;
    392443};
     444
     445class Tree;
    393446
    394447class QmlPropertyNode : public LeafNode
     
    410463    bool isStored() const { return fromTrool(sto,true); }
    411464    bool isDesignable() const { return fromTrool(des,false); }
    412     bool isWritable() const { return fromTrool(wri,true); }
     465    bool isWritable(const Tree* tree) const;
    413466    bool isAttached() const { return att; }
     467    virtual bool isQmlNode() const { return true; }
    414468
    415469    const QString& element() const { return static_cast<QmlPropGroupNode*>(parent())->element(); }
     
    453507{
    454508 public:
    455     EnumNode(InnerNode *parent, const QString& name);
     509    EnumNode(InnerNode* parent, const QString& name);
    456510    virtual ~EnumNode() { }
    457511
    458512    void addItem(const EnumItem& item);
    459     void setFlagsType(TypedefNode *typedeff);
     513    void setFlagsType(TypedefNode* typedeff);
    460514    bool hasItem(const QString &name) const { return names.contains(name); }
    461515
    462516    const QList<EnumItem>& items() const { return itms; }
    463517    Access itemAccess(const QString& name) const;
    464     const TypedefNode *flagsType() const { return ft; }
     518    const TypedefNode* flagsType() const { return ft; }
    465519    QString itemValue(const QString &name) const;
    466520
     
    468522    QList<EnumItem> itms;
    469523    QSet<QString> names;
    470     const TypedefNode *ft;
     524    const TypedefNode* ft;
    471525};
    472526
     
    474528{
    475529 public:
    476     TypedefNode(InnerNode *parent, const QString& name);
     530    TypedefNode(InnerNode* parent, const QString& name);
    477531    virtual ~TypedefNode() { }
    478532
    479     const EnumNode *associatedEnum() const { return ae; }
    480 
    481  private:
    482     void setAssociatedEnum(const EnumNode *enume);
     533    const EnumNode* associatedEnum() const { return ae; }
     534
     535 private:
     536    void setAssociatedEnum(const EnumNode* enume);
    483537
    484538    friend class EnumNode;
    485539
    486     const EnumNode *ae;
    487 };
    488 
    489 inline void EnumNode::setFlagsType(TypedefNode *typedeff)
     540    const EnumNode* ae;
     541};
     542
     543inline void EnumNode::setFlagsType(TypedefNode* typedeff)
    490544{
    491545    ft = typedeff;
     
    539593    enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual };
    540594
    541     FunctionNode(InnerNode *parent, const QString &name);
    542     FunctionNode(Type type, InnerNode *parent, const QString &name, bool attached);
     595    FunctionNode(InnerNode* parent, const QString &name);
     596    FunctionNode(Type type, InnerNode* parent, const QString &name, bool attached);
    543597    virtual ~FunctionNode() { }
    544598
     
    546600    void setParentPath(const QStringList& parentPath) { pp = parentPath; }
    547601    void setMetaness(Metaness metaness) { met = metaness; }
    548     void setVirtualness(Virtualness virtualness) { vir = virtualness; }
     602    void setVirtualness(Virtualness virtualness);
    549603    void setConst(bool conste) { con = conste; }
    550604    void setStatic(bool statique) { sta = statique; }
     
    553607    void addParameter(const Parameter& parameter);
    554608    inline void setParameters(const QList<Parameter>& parameters);
    555     void borrowParameterNames(const FunctionNode *source);
    556     void setReimplementedFrom(FunctionNode *from);
     609    void borrowParameterNames(const FunctionNode* source);
     610    void setReimplementedFrom(FunctionNode* from);
    557611
    558612    const QString& returnType() const { return rt; }
     
    571625    const QList<Parameter>& parameters() const { return params; }
    572626    QStringList parameterNames() const;
    573     const FunctionNode *reimplementedFrom() const { return rf; }
    574     const QList<FunctionNode *> &reimplementedBy() const { return rb; }
    575     const PropertyNode *associatedProperty() const { return ap; }
     627    QString rawParameters(bool names = false, bool values = false) const;
     628    const FunctionNode* reimplementedFrom() const { return rf; }
     629    const QList<FunctionNode*> &reimplementedBy() const { return rb; }
     630    const PropertyNode* associatedProperty() const { return ap; }
    576631    const QStringList& parentPath() const { return pp; }
    577632
     
    580635    const QString& element() const { return parent()->name(); }
    581636    bool isAttached() const { return att; }
     637    virtual bool isQmlNode() const {
     638        return ((type() == QmlSignal) || (type() == QmlMethod));
     639    }
    582640
    583641    void debug() const;
    584642
    585643 private:
    586     void setAssociatedProperty(PropertyNode *property);
     644    void setAssociatedProperty(PropertyNode* property);
    587645
    588646    friend class InnerNode;
     
    604662    bool att: 1;
    605663    QList<Parameter> params;
    606     const FunctionNode *rf;
    607     const PropertyNode *ap;
    608     QList<FunctionNode *> rb;
     664    const FunctionNode* rf;
     665    const PropertyNode* ap;
     666    QList<FunctionNode*> rb;
    609667};
    610668
     
    615673    enum { NumFunctionRoles = Notifier + 1 };
    616674
    617     PropertyNode(InnerNode *parent, const QString& name);
     675    PropertyNode(InnerNode* parent, const QString& name);
    618676    virtual ~PropertyNode() { }
    619677
    620678    void setDataType(const QString& dataType) { dt = dataType; }
    621     void addFunction(FunctionNode *function, FunctionRole role);
    622     void addSignal(FunctionNode *function, FunctionRole role);
     679    void addFunction(FunctionNode* function, FunctionRole role);
     680    void addSignal(FunctionNode* function, FunctionRole role);
    623681    void setStored(bool stored) { sto = toTrool(stored); }
    624682    void setDesignable(bool designable) { des = toTrool(designable); }
     683    void setScriptable(bool scriptable) { scr = toTrool(scriptable); }
    625684    void setWritable(bool writable) { wri = toTrool(writable); }
    626     void setOverriddenFrom(const PropertyNode *baseProperty);
     685    void setUser(bool user) { usr = toTrool(user); }
     686    void setOverriddenFrom(const PropertyNode* baseProperty);
     687    void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc = rdf; }
     688    void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc = scrf; }
     689    void setConstant() { cst = true; }
     690    void setFinal() { fnl = true; }
    627691
    628692    const QString &dataType() const { return dt; }
     
    636700    bool isStored() const { return fromTrool(sto, storedDefault()); }
    637701    bool isDesignable() const { return fromTrool(des, designableDefault()); }
     702    bool isScriptable() const { return fromTrool(scr, scriptableDefault()); }
     703    const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc; }
     704    const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc; }
    638705    bool isWritable() const { return fromTrool(wri, writableDefault()); }
    639     const PropertyNode *overriddenFrom() const { return overrides; }
     706    bool isUser() const { return fromTrool(usr, userDefault()); }
     707    bool isConstant() const { return cst; }
     708    bool isFinal() const { return fnl; }
     709    const PropertyNode* overriddenFrom() const { return overrides; }
     710
     711    bool storedDefault() const { return true; }
     712    bool userDefault() const { return false; }
     713    bool designableDefault() const { return !setters().isEmpty(); }
     714    bool scriptableDefault() const { return true; }
     715    bool writableDefault() const { return !setters().isEmpty(); }
    640716
    641717 private:
     
    645721    static bool fromTrool(Trool troolean, bool defaultValue);
    646722
    647     bool storedDefault() const { return true; }
    648     bool designableDefault() const { return !setters().isEmpty(); }
    649     bool writableDefault() const { return !setters().isEmpty(); }
    650 
    651723    QString dt;
     724    QString runtimeDesFunc;
     725    QString runtimeScrFunc;
    652726    NodeList funcs[NumFunctionRoles];
    653727    Trool sto;
    654728    Trool des;
     729    Trool scr;
    655730    Trool wri;
    656     const PropertyNode *overrides;
     731    Trool usr;
     732    bool cst;
     733    bool fnl;
     734    const PropertyNode* overrides;
    657735};
    658736
     
    662740}
    663741
    664 inline void PropertyNode::addFunction(FunctionNode *function, FunctionRole role)
     742inline void PropertyNode::addFunction(FunctionNode* function, FunctionRole role)
    665743{
    666744    funcs[(int)role].append(function);
     
    668746}
    669747
    670 inline void PropertyNode::addSignal(FunctionNode *function, FunctionRole role)
     748inline void PropertyNode::addSignal(FunctionNode* function, FunctionRole role)
    671749{
    672750    funcs[(int)role].append(function);
     
    684762{
    685763 public:
    686     VariableNode(InnerNode *parent, const QString &name);
     764    VariableNode(InnerNode* parent, const QString &name);
    687765    virtual ~VariableNode() { }
    688766
     
    702780};
    703781
    704 inline VariableNode::VariableNode(InnerNode *parent, const QString &name)
     782inline VariableNode::VariableNode(InnerNode* parent, const QString &name)
    705783    : LeafNode(Variable, parent, name), sta(false)
    706784{
     785    // nothing.
    707786}
    708787
     
    710789{
    711790 public:
    712     TargetNode(InnerNode *parent, const QString& name);
     791    TargetNode(InnerNode* parent, const QString& name);
    713792    virtual ~TargetNode() { }
    714793
  • trunk/tools/qdoc3/openedlist.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/openedlist.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/pagegenerator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4444*/
    4545
    46 #include <QtCore>
    4746#include <qfile.h>
    4847#include <qfileinfo.h>
    49 
     48#include <qdebug.h>
    5049#include "pagegenerator.h"
    5150#include "tree.h"
     
    7069}
    7170
     71static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*(</@link>)");
     72static QRegExp funcTag("(<@func target=\"([^\"]*)\">)(.*)(</@func>)");
     73static QRegExp typeTag("(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)(</@\\2>)");
     74static QRegExp spanTag("</@(?:comment|preprocessor|string|char)>");
     75static QRegExp unknownTag("</?@[^>]*>");
     76
     77bool PageGenerator::parseArg(const QString& src,
     78                             const QString& tag,
     79                             int* pos,
     80                             int n,
     81                             QStringRef* contents,
     82                             QStringRef* par1,
     83                             bool debug)
     84{
     85#define SKIP_CHAR(c) \
     86    if (debug) \
     87        qDebug() << "looking for " << c << " at " << QString(src.data() + i, n - i); \
     88    if (i >= n || src[i] != c) { \
     89        if (debug) \
     90            qDebug() << " char '" << c << "' not found"; \
     91        return false; \
     92    } \
     93    ++i;
     94
     95
     96#define SKIP_SPACE \
     97    while (i < n && src[i] == ' ') \
     98        ++i;
     99
     100    int i = *pos;
     101    int j = i;
     102
     103    // assume "<@" has been parsed outside
     104    //SKIP_CHAR('<');
     105    //SKIP_CHAR('@');
     106
     107    if (tag != QStringRef(&src, i, tag.length())) {
     108        if (0 && debug)
     109            qDebug() << "tag " << tag << " not found at " << i;
     110        return false;
     111    }
     112
     113    if (debug)
     114        qDebug() << "haystack:" << src << "needle:" << tag << "i:" <<i;
     115
     116    // skip tag
     117    i += tag.length();
     118
     119    // parse stuff like:  linkTag("(<@link node=\"([^\"]+)\">).*(</@link>)");
     120    if (par1) {
     121        SKIP_SPACE;
     122        // read parameter name
     123        j = i;
     124        while (i < n && src[i].isLetter())
     125            ++i;
     126        if (src[i] == '=') {
     127            if (debug)
     128                qDebug() << "read parameter" << QString(src.data() + j, i - j);
     129            SKIP_CHAR('=');
     130            SKIP_CHAR('"');
     131            // skip parameter name
     132            j = i;
     133            while (i < n && src[i] != '"')
     134                ++i;
     135            *par1 = QStringRef(&src, j, i - j);
     136            SKIP_CHAR('"');
     137            SKIP_SPACE;
     138        } else {
     139            if (debug)
     140                qDebug() << "no optional parameter found";
     141        }
     142    }
     143    SKIP_SPACE;
     144    SKIP_CHAR('>');
     145
     146    // find contents up to closing "</@tag>
     147    j = i;
     148    for (; true; ++i) {
     149        if (i + 4 + tag.length() > n)
     150            return false;
     151        if (src[i] != '<')
     152            continue;
     153        if (src[i + 1] != '/')
     154            continue;
     155        if (src[i + 2] != '@')
     156            continue;
     157        if (tag != QStringRef(&src, i + 3, tag.length()))
     158            continue;
     159        if (src[i + 3 + tag.length()] != '>')
     160            continue;
     161        break;
     162    }
     163
     164    *contents = QStringRef(&src, j, i - j);
     165
     166    i += tag.length() + 4;
     167
     168    *pos = i;
     169    if (debug)
     170        qDebug() << " tag " << tag << " found: pos now: " << i;
     171    return true;
     172#undef SKIP_CHAR
     173}
     174
    72175/*!
    73176  This function is recursive.
     
    78181}
    79182
    80 QString PageGenerator::fileBase(const Node *node)
     183QString PageGenerator::fileBase(const Node *node) const
    81184{
    82185    if (node->relates())
     
    105208          files.
    106209         */
    107         if (p->subType() == Node::QmlClass) {
    108             base.prepend("qml-");
     210        if ((p->subType() == Node::QmlClass) ||
     211            (p->subType() == Node::QmlBasicType)) {
     212            if (!base.startsWith(QLatin1String("QML:")))
     213                base.prepend("qml-");
    109214        }
    110215#endif       
     
    153258}
    154259
    155 QString PageGenerator::fileName(const Node *node)
     260QString PageGenerator::fileName(const Node *node) const
    156261{
    157262    if (!node->url().isEmpty())
     
    177282                        .arg(outFile->fileName()));
    178283    QTextStream *out = new QTextStream(outFile);
    179     out->setCodec("ISO-8859-1");
     284    out->setCodec(outputCodec);
    180285    outStreamStack.push(out);
    181286}
     
    196301  Recursive writing of html files from the root \a node.
    197302 */
    198 void PageGenerator::generateInnerNode(const InnerNode *node,
    199                                       CodeMarker *marker)
     303void
     304PageGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker)
    200305{
    201306    if (!node->url().isNull())
     
    206311        if (fakeNode->subType() == Node::ExternalPage)
    207312            return;
    208 #ifdef QDOC_QML           
     313        if (fakeNode->subType() == Node::Image)
     314            return;
    209315        if (fakeNode->subType() == Node::QmlPropertyGroup)
    210316            return;
    211 #endif           
     317        if (fakeNode->subType() == Node::Page) {
     318            if (node->count() > 0)
     319                qDebug("PAGE %s HAS CHILDREN", qPrintable(fakeNode->title()));
     320        }
    212321    }
    213322
  • trunk/tools/qdoc3/pagegenerator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    5555QT_BEGIN_NAMESPACE
    5656
     57class QTextCodec;
     58
    5759class ClassNode;
    5860class InnerNode;
     
    6870
    6971 protected:
    70     virtual QString fileBase(const Node *node);
    71     virtual QString fileExtension(const Node *node) = 0;
    72     QString fileName(const Node *node);
     72    virtual QString fileBase(const Node *node) const;
     73    virtual QString fileExtension(const Node *node) const = 0;
     74    QString fileName(const Node *node) const;
    7375    QString outFileName();
    7476    void beginSubPage(const Location& location, const QString& fileName);
     
    7779    QTextStream& out();
    7880
     81    QString naturalLanguage;
     82    QString outputEncoding;
     83    QTextCodec* outputCodec;
     84    bool parseArg(const QString& src,
     85                  const QString& tag,
     86                  int* pos,
     87                  int n,
     88                  QStringRef* contents,
     89                  QStringRef* par1 = 0,
     90                  bool debug = false);
     91
    7992 private:
    80     QStack<QTextStream *> outStreamStack;
     93    QStack<QTextStream*> outStreamStack;
    8194};
    8295
  • trunk/tools/qdoc3/plaincodemarker.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    130130}
    131131
    132 const Node *PlainCodeMarker::resolveTarget( const QString& /* target */,
    133                                             const Tree * /* tree */,
    134                                             const Node * /* relative */ )
    135 {
    136     return 0;
    137 }
    138 
    139132QT_END_NAMESPACE
  • trunk/tools/qdoc3/plaincodemarker.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    7272    QString functionEndRegExp( const QString& funcName );
    7373    QList<Section> sections(const InnerNode *innerNode, SynopsisStyle style, Status status);
    74     const Node *resolveTarget(const QString &target, const Tree *tree, const Node *relative);
    7574};
    7675
  • trunk/tools/qdoc3/polyarchiveextractor.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/polyarchiveextractor.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/polyuncompressor.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/polyuncompressor.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/qdoc3.pro

    r561 r846  
    55#DEFINES += QT_USE_FAST_CONCATENATION
    66
    7 QT = core xml
    8 CONFIG += console
    9 CONFIG -= debug_and_release_target
     7qdoc_bootstrapped {
     8    include(../../src/tools/bootstrap/bootstrap.pri)
     9    SOURCES += ../../src/corelib/plugin/quuid.cpp
     10    DEFINES -= QT_NO_CAST_FROM_ASCII
     11    DEFINES += QT_NO_TRANSLATION
     12} else {
     13    QT = core xml
     14    CONFIG += console
     15    CONFIG -= debug_and_release_target
     16}
     17
    1018!isEmpty(QT_BUILD_TREE):DESTDIR = $$QT_BUILD_TREE/bin
    1119#CONFIG += debug
     
    1523#    CONFIG += debug
    1624}
    17 mac:CONFIG -= app_bundle
     25
     26CONFIG -= app_bundle
    1827HEADERS += apigenerator.h \
    1928           archiveextractor.h \
     
    3039           cpptoqsconverter.h \
    3140           dcfsection.h \
     41           ditaxmlgenerator.h \
    3242           doc.h \
    3343           editdistance.h \
     
    7484           cpptoqsconverter.cpp \
    7585           dcfsection.cpp \
     86           ditaxmlgenerator.cpp \
    7687           doc.cpp \
    7788           editdistance.cpp \
     
    106117           yyindent.cpp
    107118
     119### Documentation for qdoc3 ###
     120
     121qtPrepareTool(QDOC, qdoc3)
     122
     123html-docs.commands = cd \"$$PWD/doc\" && $$QDOC qdoc-manual.qdocconf
     124
     125QMAKE_EXTRA_TARGETS += html-docs
     126
    108127target.path = $$[QT_INSTALL_BINS]
    109128INSTALLS += target
  • trunk/tools/qdoc3/qsakernelparser.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    7171                                       Tree * /* tree */ )
    7272{
    73     FILE *in = fopen( QFile::encodeName(filePath), "r" );
    74     if ( in == 0 ) {
     73    QFile in(filePath);
     74    if (!in.open(QIODevice::ReadOnly)) {
    7575        location.error( tr("Cannot open QSA kernel file '%1'").arg(filePath) );
    7676        return;
     
    172172        }
    173173    }
    174     fclose( in );
     174    in.close();
    175175}
    176176
  • trunk/tools/qdoc3/qsakernelparser.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/qscodemarker.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    280280
    281281    if ( style == Summary ) {
    282         FastSection enums(classe, "Enums", "enum", "enums");
    283         FastSection functions(classe, "Functions", "function", "functions");
    284         FastSection readOnlyProperties(classe, "Read-Only Properties", "property", "properties");
    285         FastSection signalz(classe, "Signals", "signal", "signals");
    286         FastSection writableProperties(classe, "Writable Properties", "property", "properties");
     282        FastSection enums(classe, "Enums", "", "enum", "enums");
     283        FastSection functions(classe, "Functions", "", "function", "functions");
     284        FastSection readOnlyProperties(classe, "", "Read-Only Properties", "property", "properties");
     285        FastSection signalz(classe, "Signals", "", "signal", "signals");
     286        FastSection writableProperties(classe, "", "Writable Properties", "property", "properties");
    287287
    288288        QStack<const ClassNode *> stack;
     
    329329        append( sections, signalz );
    330330    } else if ( style == Detailed ) {
    331         FastSection enums( classe, "Enum Documentation" );
    332         FastSection functionsAndSignals( classe, "Function and Signal Documentation" );
    333         FastSection properties( classe, "Property Documentation" );
     331        FastSection enums( classe, "Enum Documentation", "", "member", "members");
     332        FastSection functionsAndSignals( classe, "Function and Signal Documentation", "", "member", "members");
     333        FastSection properties( classe, "Property Documentation", "", "member", "members");
    334334
    335335        NodeList::ConstIterator c = classe->childNodes().begin();
     
    350350        append( sections, functionsAndSignals );
    351351    } else { // ( style == SeparateList )
    352         FastSection all( classe );
     352        FastSection all(classe, "", "", "member", "members");
    353353
    354354        QStack<const ClassNode *> stack;
     
    376376}
    377377
    378 const Node *QsCodeMarker::resolveTarget( const QString& /* target */,
    379                                          const Tree * /* tree */,
    380                                          const Node * /* relative */ )
    381 {
    382     return 0;
    383 }
    384 
    385378QT_END_NAMESPACE
  • trunk/tools/qdoc3/qscodemarker.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    7373    QString functionBeginRegExp( const QString& funcName );
    7474    QString functionEndRegExp( const QString& funcName );
    75     const Node *resolveTarget( const QString& target, const Tree *tree, const Node *relative );
    7675};
    7776
  • trunk/tools/qdoc3/qscodeparser.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    152152    qsTre = tree;
    153153
    154     FILE *in = fopen(QFile::encodeName(filePath), "r");
    155     if (in == 0) {
     154    QFile in(filePath);
     155    if (!in.open(QIODevice::ReadOnly)) {
    156156        location.error(tr("Cannot open Qt Script class list '%1'")
    157157                        .arg(filePath));
     
    176176        tok = fileTokenizer.getToken();
    177177    }
    178     fclose(in);
     178    in.close();
    179179}
    180180
  • trunk/tools/qdoc3/qscodeparser.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/quoter.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/quoter.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/separator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/separator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/sgmlgenerator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/sgmlgenerator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/test/assistant.qdocconf

    r769 r846  
    77project                 = Qt Assistant
    88description             = Qt Assistant Manual
    9 url                     = http://qt.nokia.com/doc/4.6
     9url                     = http://doc.qt.nokia.com/4.7/
    1010
    1111indexes                 = $QT_BUILD_TREE/doc-build/html-qt/qt.index
     
    1414
    1515qhp.Assistant.file                = assistant.qhp
    16 qhp.Assistant.namespace           = com.trolltech.assistant.460
     16qhp.Assistant.namespace           = com.trolltech.assistant.472
    1717qhp.Assistant.virtualFolder       = qdoc
    1818qhp.Assistant.indexTitle          = Qt Assistant Manual
    19 qhp.Assistant.extraFiles          = classic.css images/qt-logo.png images/trolltech-logo.png
    20 qhp.Assistant.filterAttributes    = qt 4.6.3 tools assistant
     19qhp.Assistant.extraFiles          = images/bg_l.png \
     20                                    images/bg_l_blank.png \
     21                                    images/bg_ll_blank.png \
     22                                    images/bg_ul_blank.png \
     23                                    images/header_bg.png \
     24                                    images/bg_r.png \
     25                                    images/box_bg.png \
     26                                    images/breadcrumb.png \
     27                                    images/bullet_gt.png \
     28                                    images/bullet_dn.png \
     29                                    images/bullet_sq.png \
     30                                    images/bullet_up.png \
     31                                    images/arrow_down.png \
     32                                    images/feedbackground.png \
     33                                    images/horBar.png \
     34                                    images/page.png \
     35                                    images/page_bg.png \
     36                                    images/sprites-combined.png \
     37                                    images/spinner.gif \
     38                                    images/stylesheet-coffee-plastique.png \
     39                                    images/taskmenuextension-example.png \
     40                                    images/coloreditorfactoryimage.png \
     41                                    images/dynamiclayouts-example.png \
     42                                    scripts/functions.js \
     43                                    scripts/jquery.js \
     44                                    scripts/narrow.js \
     45                                    scripts/superfish.js \
     46                                    style/narrow.css \
     47                                    style/superfish.css \
     48                                    style/style_ie6.css \
     49                                    style/style_ie7.css \
     50                                    style/style_ie8.css \
     51                                    style/style.css
     52
     53qhp.Assistant.filterAttributes    = qt 4.7.2 tools assistant
    2154qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual
    2255qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant
     
    4174                          $QT_SOURCE_TREE/doc/src
    4275
    43 imagedirs               = $QT_SOURCE_TREE/doc/src/images
     76imagedirs               = $QT_SOURCE_TREE/doc/src/images \
     77                          $QT_SOURCE_TREE/doc/src/template/images
    4478outputdir               = $QT_BUILD_TREE/doc-build/html-assistant
    4579base                    = file:$QT_BUILD_TREE/doc-build/html-assistant
  • trunk/tools/qdoc3/test/designer.qdocconf

    r769 r846  
    77project                 = Qt Designer
    88description             = Qt Designer Manual
    9 url                     = http://qt.nokia.com/doc/4.6
     9url                     = http://doc.qt.nokia.com/4.7/
    1010
    1111indexes                 = $QT_BUILD_TREE/doc-build/html-qt/qt.index
     
    1414
    1515qhp.Designer.file                = designer.qhp
    16 qhp.Designer.namespace           = com.trolltech.designer.460
     16qhp.Designer.namespace           = com.trolltech.designer.472
    1717qhp.Designer.virtualFolder       = qdoc
    1818qhp.Designer.indexTitle          = Qt Designer Manual
    19 qhp.Designer.extraFiles          = classic.css images/qt-logo.png images/trolltech-logo.png
    20 qhp.Designer.filterAttributes    = qt 4.6.3 tools designer
     19qhp.Designer.extraFiles          = images/bg_l.png \
     20                                    images/bg_l_blank.png \
     21                                                                        images/bg_ll_blank.png \
     22                                                                        images/bg_ul_blank.png \
     23                                                                        images/header_bg.png \
     24                                    images/bg_r.png \
     25                                                                        images/box_bg.png \
     26                                                                        images/breadcrumb.png \
     27                                                                        images/bullet_gt.png \
     28                                    images/bullet_dn.png \
     29                                                                        images/bullet_sq.png \
     30                                    images/bullet_up.png \
     31                                                                        images/arrow_down.png \
     32                                    images/feedbackground.png \
     33                                    images/horBar.png \
     34                                                                        images/page.png \
     35                                                                        images/page_bg.png \
     36                                                                        images/sprites-combined.png \
     37                                                                        images/spinner.gif \
     38                                    images/stylesheet-coffee-plastique.png \
     39                                    images/taskmenuextension-example.png \
     40                                   images/coloreditorfactoryimage.png \
     41                                   images/dynamiclayouts-example.png \
     42                                                                        scripts/functions.js \
     43                                                                        scripts/jquery.js \
     44                                                                        scripts/narrow.js \
     45                                                                        scripts/superfish.js \
     46                                                                        style/narrow.css \
     47                                                                        style/superfish.css \
     48                                                                        style/style_ie6.css \
     49                                                                        style/style_ie7.css \
     50                                                                        style/style_ie8.css \
     51                                    style/style.css
     52
     53qhp.Designer.filterAttributes    = qt 4.7.2 tools designer
    2154qhp.Designer.customFilters.Designer.name = Qt Designer Manual
    2255qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer
     
    4780                          $QT_SOURCE_TREE/doc/src
    4881
    49 imagedirs               = $QT_SOURCE_TREE/doc/src/images
     82imagedirs               = $QT_SOURCE_TREE/doc/src/images \
     83                          $QT_SOURCE_TREE/doc/src/template/images
    5084outputdir               = $QT_BUILD_TREE/doc-build/html-designer
    5185base                    = file:$QT_BUILD_TREE/doc-build/html-designer
  • trunk/tools/qdoc3/test/jambi.qdocconf

    r651 r846  
    1717                          $QTDIR/examples \
    1818                          $JAMBI/doc/src/images \
    19                           ../doc/src/images
     19                          ../doc/src/images \
     20                          $QTDIR/doc/src/template/images
    2021
    2122extraimages.javadoc     = qt-logo \
  • trunk/tools/qdoc3/test/linguist.qdocconf

    r769 r846  
    77project                 = Qt Linguist
    88description             = Qt Linguist Manual
    9 url                     = http://qt.nokia.com/doc/4.6
     9url                     =  http://doc.qt.nokia.com/4.7/
    1010
    1111indexes                 = $QT_BUILD_TREE/doc-build/html-qt/qt.index
     
    1414
    1515qhp.Linguist.file                = linguist.qhp
    16 qhp.Linguist.namespace           = com.trolltech.linguist.460
     16qhp.Linguist.namespace           = com.trolltech.linguist.472
    1717qhp.Linguist.virtualFolder       = qdoc
    1818qhp.Linguist.indexTitle          = Qt Linguist Manual
    19 qhp.Linguist.extraFiles          = classic.css images/qt-logo.png images/trolltech-logo.png
    20 qhp.Linguist.filterAttributes    = qt 4.6.3 tools linguist
     19qhp.Linguist.extraFiles          = images/bg_l.png \
     20                                    images/bg_l_blank.png \
     21                                                                        images/bg_ll_blank.png \
     22                                                                        images/bg_ul_blank.png \
     23                                                                        images/header_bg.png \
     24                                    images/bg_r.png \
     25                                                                        images/box_bg.png \
     26                                                                        images/breadcrumb.png \
     27                                                                        images/bullet_gt.png \
     28                                    images/bullet_dn.png \
     29                                                                        images/bullet_sq.png \
     30                                    images/bullet_up.png \
     31                                                                        images/arrow_down.png \
     32                                    images/feedbackground.png \
     33                                    images/horBar.png \
     34                                                                        images/page.png \
     35                                                                        images/page_bg.png \
     36                                                                        images/sprites-combined.png \
     37                                                                        images/spinner.gif \
     38                                    images/stylesheet-coffee-plastique.png \
     39                                    images/taskmenuextension-example.png \
     40                                   images/coloreditorfactoryimage.png \
     41                                   images/dynamiclayouts-example.png \
     42                                                                        scripts/functions.js \
     43                                                                        scripts/jquery.js \
     44                                                                        scripts/narrow.js \
     45                                                                        scripts/superfish.js \
     46                                                                        style/narrow.css \
     47                                                                        style/superfish.css \
     48                                                                        style/style_ie6.css \
     49                                                                        style/style_ie7.css \
     50                                                                        style/style_ie8.css \
     51                                    style/style.css
     52
     53qhp.Linguist.filterAttributes    = qt 4.7.2 tools linguist
    2154qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual
    2255qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist
     
    4376                          $QT_SOURCE_TREE/doc/src
    4477
    45 imagedirs               = $QT_SOURCE_TREE/doc/src/images
     78imagedirs               = $QT_SOURCE_TREE/doc/src/images \
     79                          $QT_SOURCE_TREE/doc/src/template/images
    4680outputdir               = $QT_BUILD_TREE/doc-build/html-linguist
    4781base                    = file:$QT_BUILD_TREE/doc-build/html-linguist
  • trunk/tools/qdoc3/test/macros.qdocconf

    r651 r846  
    1919macro.QD                = "\\e{Qt Designer}"
    2020macro.QL                = "\\e{Qt Linguist}"
     21macro.QQV               = "\\e{Qt QML Viewer}"
    2122macro.param             = "\\e"
    2223macro.raisedaster.HTML  = "<sup>*</sup>"
  • trunk/tools/qdoc3/test/qmake.qdocconf

    r769 r846  
    77project                 = QMake
    88description             = QMake Manual
    9 url                     = http://qt.nokia.com/doc/4.6
     9url                     = http://qt.nokia.com/doc/4.7
    1010
    1111indexes                 = $QT_BUILD_TREE/doc-build/html-qt/qt.index
     
    1414
    1515qhp.qmake.file                = qmake.qhp
    16 qhp.qmake.namespace           = com.trolltech.qmake.460
     16qhp.qmake.namespace           = com.trolltech.qmake.472
    1717qhp.qmake.virtualFolder       = qdoc
    1818qhp.qmake.indexTitle          = QMake Manual
    19 qhp.qmake.extraFiles          = classic.css images/qt-logo.png images/trolltech-logo.png
    20 qhp.qmake.filterAttributes    = qt 4.6.3 tools qmake
     19qhp.qmake.extraFiles          = images/bg_l.png \
     20                             images/bg_l_blank.png \
     21                                                         images/bg_ll_blank.png \
     22                                                         images/bg_ul_blank.png \
     23                                                         images/header_bg.png \
     24                             images/bg_r.png \
     25                             images/box_bg.png \
     26                             images/breadcrumb.png \
     27                             images/bullet_gt.png \
     28                             images/bullet_dn.png \
     29                             images/bullet_sq.png \
     30                             images/bullet_up.png \
     31                             images/arrow_down.png \
     32                             images/feedbackground.png \
     33                             images/horBar.png \
     34                             images/page.png \
     35                             images/page_bg.png \
     36                             images/sprites-combined.png \
     37                             images/spinner.gif \
     38                             images/stylesheet-coffee-plastique.png \
     39                             images/taskmenuextension-example.png \
     40                             images/coloreditorfactoryimage.png \
     41                             images/dynamiclayouts-example.png \
     42                             scripts/functions.js \
     43                             scripts/jquery.js \
     44                             scripts/narrow.js \
     45                             scripts/superfish.js \
     46                             style/narrow.css \
     47                             style/superfish.css \
     48                             style/style_ie6.css \
     49                             style/style_ie7.css \
     50                             style/style_ie8.css \
     51                             style/style.css
     52
     53qhp.qmake.filterAttributes    = qt 4.7.2 tools qmake
    2154qhp.qmake.customFilters.qmake.name = qmake Manual
    2255qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake
     
    3669                          $QT_SOURCE_TREE/doc/src
    3770
    38 imagedirs               = $QT_SOURCE_TREE/doc/src/images
     71imagedirs               = $QT_SOURCE_TREE/doc/src/images \
     72                          $QT_SOURCE_TREE/doc/src/template/images
    3973outputdir               = $QT_BUILD_TREE/doc-build/html-qmake
    4074base                    = file:$QT_BUILD_TREE/doc-build/html-qmake
  • trunk/tools/qdoc3/test/qt-api-only.qdocconf

    r561 r846  
    2626                    $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc
    2727
     28# Remove the QML documentation from the Qt-only documentation.
     29
     30excludedirs += $QT_SOURCE_TREE/src/imports
     31
    2832outputdir         = $QT_BUILD_TREE/doc-build/html-qt
    2933tagfile           = $QT_BUILD_TREE/doc-build/html-qt/qt.tags
  • trunk/tools/qdoc3/test/qt-build-docs.qdocconf

    r769 r846  
    77project                 = Qt
    88description             = Qt Reference Documentation
    9 url                     = http://qt.nokia.com/doc/4.6
     9url                     = http://qt.nokia.com/doc/4.7
    1010
    11 edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg \
    12                           QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \
    13                           QtDesigner QtAssistant QAxContainer Phonon \
    14                           QAxServer QtUiTools QtTest QtDBus
    15 edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest
    16 edition.DesktopLight.groups       = -graphicsview-api
     11sourceencoding          = UTF-8
     12outputencoding          = UTF-8
     13naturallanguage         = en_US
    1714
    1815qhp.projects            = Qt
    1916
    2017qhp.Qt.file                = qt.qhp
    21 qhp.Qt.namespace           = com.trolltech.qt.460
     18qhp.Qt.namespace           = com.trolltech.qt.472
    2219qhp.Qt.virtualFolder       = qdoc
    2320qhp.Qt.indexTitle          = Qt Reference Documentation
     
    2623# Files not referenced in any qdoc file (last four are needed by qtdemo)
    2724# See also extraimages.HTML
    28 qhp.Qt.extraFiles          = classic.css \
    29                              images/qt-logo.png \
     25qhp.Qt.extraFiles          = index.html \
     26                             images/bg_l.png \
     27                             images/bg_l_blank.png \
     28                             images/bg_ll_blank.png \
     29                             images/bg_ul_blank.png \
     30                             images/header_bg.png \
     31                             images/bg_r.png \
     32                             images/box_bg.png \
     33                             images/breadcrumb.png \
     34                             images/bullet_gt.png \
     35                             images/bullet_dn.png \
     36                             images/bullet_sq.png \
     37                             images/bullet_up.png \
     38                             images/arrow_down.png \
     39                             images/feedbackground.png \
     40                             images/horBar.png \
     41                             images/page.png \
     42                             images/page_bg.png \
     43                             images/sprites-combined.png \
     44                             images/spinner.gif \
     45                             images/stylesheet-coffee-plastique.png \
    3046                             images/taskmenuextension-example.png \
    3147                             images/coloreditorfactoryimage.png \
    3248                             images/dynamiclayouts-example.png \
    33                              images/stylesheet-coffee-plastique.png
     49                             scripts/functions.js \
     50                             scripts/jquery.js \
     51                             scripts/narrow.js \
     52                             scripts/superfish.js \
     53                             style/narrow.css \
     54                             style/superfish.css \
     55                             style/style_ie6.css \
     56                             style/style_ie7.css \
     57                             style/style_ie8.css \
     58                             style/style.css
    3459
    35 qhp.Qt.filterAttributes    = qt 4.6.3 qtrefdoc
    36 qhp.Qt.customFilters.Qt.name = Qt 4.6.3
    37 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.3
    38 qhp.Qt.subprojects         = classes overviews examples
     60
     61
     62qhp.Qt.filterAttributes    = qt 4.7.2 qtrefdoc
     63qhp.Qt.customFilters.Qt.name = Qt 4.7.2
     64qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2
     65qhp.Qt.subprojects         = classes qmlelements overviews examples
    3966qhp.Qt.subprojects.classes.title = Classes
    40 qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
     67qhp.Qt.subprojects.classes.indexTitle = All Classes
    4168qhp.Qt.subprojects.classes.selectors = class fake:headerfile
    4269qhp.Qt.subprojects.classes.sortPages = true
     70qhp.Qt.subprojects.qmlelements.title = QML Elements
     71qhp.Qt.subprojects.qmlelements.indexTitle = QML Elements
     72qhp.Qt.subprojects.qmlelements.selectors = fake:qmlclass
     73qhp.Qt.subprojects.qmlelements.sortPages = true
    4374qhp.Qt.subprojects.overviews.title = Overviews
    4475qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs
     
    77108                          $QT_SOURCE_TREE/src/3rdparty/harfbuzz \
    78109                          $QT_SOURCE_TREE/src/3rdparty/kdebase \
     110                          $QT_SOURCE_TREE/src/3rdparty/libconninet \
    79111                          $QT_SOURCE_TREE/src/3rdparty/libjpeg \
    80112                          $QT_SOURCE_TREE/src/3rdparty/libmng \
     
    90122                          $QT_SOURCE_TREE/src/3rdparty/wintab \
    91123                          $QT_SOURCE_TREE/src/3rdparty/zlib \
    92                           $QT_SOURCE_TREE/doc/src/snippets \
    93124                          $QT_SOURCE_TREE/src/3rdparty/phonon/gstreamer \
    94125                          $QT_SOURCE_TREE/src/3rdparty/phonon/ds9 \
    95126                          $QT_SOURCE_TREE/src/3rdparty/phonon/qt7 \
    96                           $QT_SOURCE_TREE/src/3rdparty/phonon/waveout
     127                          $QT_SOURCE_TREE/src/3rdparty/phonon/mmf \
     128                          $QT_SOURCE_TREE/src/3rdparty/phonon/waveout \
     129                          $QT_SOURCE_TREE/doc/src/snippets \
     130                          $QT_SOURCE_TREE/doc/src/ja_JP \
     131                          $QT_SOURCE_TREE/doc/src/zh_CN
    97132
    98133sources.fileextensions  = "*.cpp *.qdoc *.mm"
    99 examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp"
     134examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml"
    100135examples.imageextensions = "*.png"
    101136
     
    107142                          $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs
    108143imagedirs               = $QT_SOURCE_TREE/doc/src/images \
    109                           $QT_SOURCE_TREE/examples
     144                          $QT_SOURCE_TREE/examples \
     145                          $QT_SOURCE_TREE/doc/src/declarative/pics \
     146                          $QT_SOURCE_TREE/doc/src/template/images
    110147outputdir               = $QT_BUILD_TREE/doc/html
    111148tagfile                 = $QT_BUILD_TREE/doc/html/qt.tags
  • trunk/tools/qdoc3/test/qt-cpp-ignore.qdocconf

    r561 r846  
    6565                          Q_XMLPATTERNS_EXPORT \
    6666                          QDBUS_EXPORT \
     67                          Q_DBUS_EXPORT \
    6768                          QT_BEGIN_NAMESPACE \
    6869                          QT_BEGIN_INCLUDE_NAMESPACE \
     
    7172                          PHONON_EXPORT \
    7273                          Q_DECLARATIVE_EXPORT \
    73                           Q_GADGET \
    74                           QWEBKIT_EXPORT
     74                                      Q_GADGET \
     75                                  QWEBKIT_EXPORT \
     76                          Q_INVOKABLE
    7577Cpp.ignoredirectives    = Q_DECLARE_HANDLE \
    7678                          Q_DECLARE_INTERFACE \
     
    9193                          K_DECLARE_PRIVATE \
    9294                          PHONON_OBJECT \
    93                           PHONON_HEIR
     95                          PHONON_HEIR \
     96                          Q_PRIVATE_PROPERTY \
     97                          Q_DECLARE_PRIVATE_D \
     98                          Q_CLASSINFO
  • trunk/tools/qdoc3/test/qt-defines.qdocconf

    r2 r846  
    44                          QT_COMPAT \
    55                          QT_KEYPAD_NAVIGATION \
     6                          QT_NO_EGL \
    67                          QT3_SUPPORT \
    78                          Q_WS_.* \
     
    2021extraimages.HTML        = qt-logo \
    2122                          trolltech-logo \
     23                          bg_l.png \
     24                          bg_l_blank.png \
     25                          bg_ll_blank.png \
     26                          bg_ul_blank.png \
     27                          header_bg.png \
     28                          bg_r.png \
     29                          box_bg.png \
     30                          breadcrumb.png \
     31                          bullet_gt.png \
     32                          bullet_dn.png \
     33                          bullet_sq.png \
     34                          bullet_up.png \
     35                          arrow_down.png \
     36                          feedbackground.png \
     37                          horBar.png \
     38                          page.png \
     39                          page_bg.png \
     40                          sprites-combined.png \
     41                          spinner.gif \
     42                          stylesheet-coffee-plastique.png \
    2243                          taskmenuextension-example.png \
    2344                          coloreditorfactoryimage.png \
    24                           dynamiclayouts-example.png \
    25                           stylesheet-coffee-plastique.png
    26                              
     45                          dynamiclayouts-example.png
     46
     47# This stuff is used by the new doc format.
     48scriptdirs              = $QT_SOURCE_TREE/doc/src/template/scripts
     49styledirs               = $QT_SOURCE_TREE/doc/src/template/style
     50
     51scripts.HTML            = functions.js \
     52                             narrow.js \
     53                             superfish.js \
     54                          jquery.js
     55
     56styles.HTML             = style.css \
     57                             narrow.css \
     58                             superfish.css \
     59                             superfish_skin.css \
     60                          style_ie6.css \
     61                          style_ie7.css \
     62                          style_ie8.css
  • trunk/tools/qdoc3/test/qt-html-templates.qdocconf

    r651 r846  
    1 HTML.stylesheets        = classic.css
    2 HTML.postheader         = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n" \
    3                           "<tr>\n" \
    4                           "<td align=\"left\" valign=\"top\" width=\"32\">" \
    5                           "<a href=\"http://qt.nokia.com/\"><img src=\"images/qt-logo.png\" align=\"left\" border=\"0\" /></a>" \
    6                           "</td>\n" \
    7                           "<td width=\"1\">&nbsp;&nbsp;</td>" \
    8                           "<td class=\"postheader\" valign=\"center\">" \
    9                           "<a href=\"index.html\">" \
    10                           "<font color=\"#004faf\">Home</font></a>&nbsp;&middot;" \
    11                           " <a href=\"classes.html\">" \
    12                           "<font color=\"#004faf\">All&nbsp;Classes</font></a>&nbsp;&middot;" \
    13                           " <a href=\"functions.html\">" \
    14                           "<font color=\"#004faf\">All&nbsp;Functions</font></a>&nbsp;&middot;" \
    15                           " <a href=\"overviews.html\">" \
    16                           "<font color=\"#004faf\">Overviews</font></a>" \
    17                           "</td>" \
    18                           "</tr></table>"
     1HTML.stylesheets        =  style/style.css \
     2                                                                        style/OfflineStyle.css \
     3                                                                        style/style_ie7.css \
     4                                                                        style/style_ie8.css \
     5                                                                        style/style_ie6.css
    196
    20 HTML.footer             = "<p /><address><hr /><div align=\"center\">\n" \
    21                           "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
    22                           "<td width=\"40%\" align=\"left\">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
    23                           "<td width=\"20%\" align=\"center\"><a href=\"trademarks.html\">Trademarks</a></td>\n" \
    24                           "<td width=\"40%\" align=\"right\"><div align=\"right\">Qt \\version</div></td>\n" \
    25                           "</tr></table></div></address>"
     7HTML.postheader         = " <div class=\"header\" id=\"qtdocheader\">\n" \
     8                          "    <div class=\"content\"> \n" \
     9                          "    <div id=\"nav-logo\">\n" \
     10                          "      <a href=\"index.html\">Home</a></div>\n" \
     11                          "    <a href=\"index.html\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \
     12                          "    <div id=\"narrowsearch\"></div>\n" \
     13                          "    <div id=\"nav-topright\">\n" \
     14                          "      <ul>\n" \
     15                          "        <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \
     16                          "        <li class=\"nav-topright-dev\"><a href=\"http://developer.qt.nokia.com/\">DEV</a></li>\n" \
     17                          "        <li class=\"nav-topright-labs\"><a href=\"http://labs.qt.nokia.com/blogs/\">LABS</a></li>\n" \
     18                          "        <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://doc.qt.nokia.com/\">\n" \
     19                          "          DOC</a></li>\n" \
     20                          "        <li class=\"nav-topright-blog\"><a href=\"http://blog.qt.nokia.com/\">BLOG</a></li>\n" \
     21                          "      </ul>\n" \
     22                          "    </div>\n" \
     23                          "    <div id=\"shortCut\">\n" \
     24                          "      <ul>\n" \
     25                          "        <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">Qt 4.7</a></span></li>\n" \
     26                          "        <li class=\"shortCut-topleft-active\"><a href=\"http://doc.qt.nokia.com\">ALL VERSIONS" \
     27                          "        </a></li>\n" \
     28                          "      </ul>\n" \
     29                          "     </div>\n" \
     30                        " <ul class=\"sf-menu\" id=\"narrowmenu\"> \n" \
     31                        "                       <li><a href=\"#\">API Lookup</a> \n" \
     32                        "                               <ul> \n" \
     33                        "                                       <li><a href=\"classes.html\">Class index</a></li> \n" \
     34                        "           <li><a href=\"functions.html\">Function index</a></li> \n" \
     35                        "           <li><a href=\"modules.html\">Modules</a></li> \n" \
     36                        "           <li><a href=\"namespaces.html\">Namespaces</a></li> \n" \
     37                        "           <li><a href=\"qtglobal.html\">Global Declarations</a></li> \n" \
     38                        "           <li><a href=\"qdeclarativeelements.html\">QML elements</a></li> \n" \
     39                        "                   </ul> \n" \
     40                        "                       </li> \n" \
     41                        "                       <li><a href=\"#\">Qt Topics</a> \n" \
     42                        "                               <ul> \n" \
     43                        "                                          <li><a href=\"qt-basic-concepts.html\">Programming with Qt</a></li>  \n" \
     44                        "                                          <li><a href=\"qtquick.html\">Device UIs &amp; Qt Quick</a></li>  \n" \
     45                        "                                          <li><a href=\"qt-gui-concepts.html\">UI Design with Qt</a></li>  \n" \
     46                        "                                          <li><a href=\"developing-with-qt.html\">Cross-platform and Platform-specific</a></li>  \n" \
     47                        "                                          <li><a href=\"platform-specific.html\">Platform-specific info</a></li>  \n" \
     48                        "                                          <li><a href=\"technology-apis.html\">Qt and Key Technologies</a></li>  \n" \
     49                        "                                          <li><a href=\"best-practices.html\">How-To's and Best Practices</a></li>  \n" \
     50                        "                    </ul> \n" \
     51                        "                               </li> \n" \
     52                        "                               <li><a href=\"#\">Examples</a> \n" \
     53                        "                                       <ul> \n" \
     54                        "                             <li><a href=\"all-examples.html\">Examples</a></li> \n" \
     55                        "                             <li><a href=\"tutorials.html\">Tutorials</a></li> \n" \
     56                        "                             <li><a href=\"demos.html\">Demos</a></li> \n" \
     57                        "                             <li><a href=\"qdeclarativeexamples.html\">QML Examples</a></li> \n" \
     58                        "                      </ul> \n" \
     59                        "                                       </li> \n" \
     60                        "                               </ul> \n" \
     61                          "    </div>\n" \
     62                          "  </div>\n" \
     63                          "  <div class=\"wrapper\">\n" \
     64                          "    <div class=\"hd\">\n" \
     65                          "      <span></span>\n" \
     66                          "    </div>\n" \
     67                          "    <div class=\"bd group\">\n" \
     68                          "      <div class=\"sidebar\">\n" \
     69                          "        <div class=\"searchlabel\">\n" \
     70                          "          Search index:</div>\n" \
     71                          "        <div class=\"search\" id=\"sidebarsearch\">\n" \
     72                          "          <form id=\"qtdocsearch\" action=\"\" onsubmit=\"return false;\">\n" \
     73                          "            <fieldset>\n" \
     74                          "              <input type=\"text\" name=\"searchstring\" id=\"pageType\" value=\"\" />\n" \
     75                        " <div id=\"resultdialog\"> \n" \
     76                        " <a href=\"#\" id=\"resultclose\">Close</a> \n" \
     77                        "<!-- <p id=\"resultlinks\" class=\"all\"><a href=\"#\" id=\"showallresults\">All</a> | <a href=\"#\" id=\"showapiresults\">API</a> | <a href=\"#\" id=\"showarticleresults\">Articles</a> | <a href=\"#\" id=\"showexampleresults\">Examples</a></p> \n" \
     78                        " <p id=\"searchcount\" class=\"all\"><span id=\"resultcount\"></span><span id=\"apicount\"></span><span id=\"articlecount\"></span><span id=\"examplecount\"></span>&nbsp;results:</p> --> \n" \
     79                        " <ul id=\"resultlist\" class=\"all\"> \n" \
     80                        " </ul> \n" \
     81                        " </div> \n" \
     82                          "            </fieldset>\n" \
     83                          "          </form>\n" \
     84                          "        </div>\n" \
     85                          "        <div class=\"box first bottombar\" id=\"lookup\">\n" \
     86                          "          <h2 title=\"API Lookup\"><span></span>\n" \
     87                          "            API Lookup</h2>\n" \
     88                          "          <div  id=\"list001\" class=\"list\">\n" \
     89                          "          <ul id=\"ul001\" >\n" \
     90                          "              <li class=\"defaultLink\"><a href=\"classes.html\">Class index</a></li>\n" \
     91                          "              <li class=\"defaultLink\"><a href=\"functions.html\">Function index</a></li>\n" \
     92                          "              <li class=\"defaultLink\"><a href=\"modules.html\">Modules</a></li>\n" \
     93                          "              <li class=\"defaultLink\"><a href=\"namespaces.html\">Namespaces</a></li>\n" \
     94                          "              <li class=\"defaultLink\"><a href=\"qtglobal.html\">Global Declarations</a></li>\n" \
     95                          "              <li class=\"defaultLink\"><a href=\"qdeclarativeelements.html\">QML elements</a></li>\n" \
     96                          "            </ul> \n" \
     97                          "          </div>\n" \
     98                          "        </div>\n" \
     99                          "        <div class=\"box bottombar\" id=\"topics\">\n" \
     100                          "          <h2 title=\"Qt Topics\"><span></span>\n" \
     101                          "            Qt Topics</h2>\n" \
     102                          "          <div id=\"list002\" class=\"list\">\n" \
     103                          "            <ul id=\"ul002\" >\n" \
     104                          "                        <li class=\"defaultLink\"><a href=\"qt-basic-concepts.html\">Programming with Qt</a></li> \n" \
     105                          "                        <li class=\"defaultLink\"><a href=\"qtquick.html\">Device UIs &amp; Qt Quick</a></li> \n" \
     106                          "                        <li class=\"defaultLink\"><a href=\"qt-gui-concepts.html\">UI Design with Qt</a></li> \n" \
     107                          "                        <li class=\"defaultLink\"><a href=\"developing-with-qt.html\">Cross-platform and Platform-specific</a></li> \n" \
     108                          "                        <li class=\"defaultLink\"><a href=\"platform-specific.html\">Platform-specific info</a></li> \n" \
     109                          "                        <li class=\"defaultLink\"><a href=\"technology-apis.html\">Qt and Key Technologies</a></li> \n" \
     110                          "                        <li class=\"defaultLink\"><a href=\"best-practices.html\">How-To's and Best Practices</a></li> \n" \
     111                          "            </ul>  \n" \
     112                          "          </div>\n" \
     113                          "        </div>\n" \
     114                          "        <div class=\"box\" id=\"examples\">\n" \
     115                          "          <h2 title=\"Examples\"><span></span>\n" \
     116                          "            Examples</h2>\n" \
     117                          "          <div id=\"list003\" class=\"list\">\n" \
     118                          "        <ul id=\"ul003\">\n" \
     119                          "              <li class=\"defaultLink\"><a href=\"all-examples.html\">Examples</a></li>\n" \
     120                          "              <li class=\"defaultLink\"><a href=\"tutorials.html\">Tutorials</a></li>\n" \
     121                          "              <li class=\"defaultLink\"><a href=\"demos.html\">Demos</a></li>\n" \
     122                          "              <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html\">QML Examples</a></li>\n" \
     123                          "            </ul> \n" \
     124                          "          </div>\n" \
     125                          "        </div>\n" \
     126                          "      </div>\n" \
     127                          "      <div class=\"wrap\">\n" \
     128                          "        <div class=\"toolbar\">\n" \
     129                          "          <div class=\"breadcrumb toolblock\">\n" \
     130                          "            <ul>\n" \
     131                          "              <li class=\"first\"><a href=\"index.html\">Home</a></li>\n" \
     132                          "              <!--  Bread crumbs goes here -->\n"
     133
     134HTML.postpostheader     = "            </ul>\n" \
     135                          "          </div>\n" \
     136                          "          <div class=\"toolbuttons toolblock\">\n" \
     137                          "            <ul>\n" \
     138                          "              <li id=\"smallA\" class=\"t_button\">A</li>\n" \
     139                          "              <li id=\"medA\" class=\"t_button active\">A</li>\n" \
     140                          "              <li id=\"bigA\" class=\"t_button\">A</li>\n" \
     141                          "              <li id=\"print\" class=\"t_button\"><a href=\"javascript:this.print();\">\n" \
     142                          "                <span>Print</span></a></li>\n" \
     143                          "            </ul>\n" \
     144                          "        </div>\n" \
     145                          "        </div>\n" \
     146                          "        <div class=\"content mainContent\">\n"
     147
     148HTML.footer             = "" \
     149                          "        <div class=\"feedback t_button\">\n" \
     150                          "          [+] Documentation Feedback</div>\n" \
     151                          "      </div>\n" \
     152                          "    </div>\n" \
     153                          "    </div> \n" \
     154                          "    <div class=\"ft\">\n" \
     155                          "      <span></span>\n" \
     156                          "    </div>\n" \
     157                          "  </div> \n" \
     158                          "  <div class=\"footer\">\n" \
     159                          "    <p>\n" \
     160                          "      <acronym title=\"Copyright\">&copy;</acronym> 2008-2010 Nokia Corporation and/or its\n" \
     161                          "      subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation \n" \
     162                          "      in Finland and/or other countries worldwide.</p>\n" \
     163                          "    <p>\n" \
     164                          "      All other trademarks are property of their respective owners. <a title=\"Privacy Policy\"\n" \
     165                          "        href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy</a></p>\n" \
     166              "    <br />\n" \
     167              "    <p>\n" \
     168              "      Licensees holding valid Qt Commercial licenses may use this document in accordance with the" \
     169              "      Qt Commercial License Agreement provided with the Software or, alternatively, in accordance" \
     170              "      with the terms contained in a written agreement between you and Nokia.</p>\n" \
     171              "    <p>\n" \
     172              "      Alternatively, this document may be used under the terms of the <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU\n" \
     173              "      Free Documentation License version 1.3</a>\n" \
     174              "      as published by the Free Software Foundation.</p>\n" \
     175                          "  </div>\n" \
     176                          "  <div id=\"feedbackBox\">\n" \
     177                          "      <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \
     178                          "    <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \
     179                          "      <p id=\"noteHead\">Thank you for giving your feedback.</p> <p class=\"note\">Make sure it is related to this specific page. For more general bugs and \n" \
     180                          "      requests, please use the <a href=\"http://bugreports.qt.nokia.com/secure/Dashboard.jspa\">Qt Bug Tracker</a>.</p>\n" \
     181                          "      <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\"></textarea></p>\n" \
     182                          "      <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \
     183                          "    </form>\n" \
     184                          "  </div>\n" \
     185                          "  <div id=\"blurpage\">\n" \
     186                          "  </div>\n"
  • trunk/tools/qdoc3/test/qt-webxml.qdocconf

    r2 r846  
    33quotinginformation      = true
    44imagedirs               = $QTDIR/doc/src/images \
    5                           $QTDIR/examples
     5                          $QTDIR/examples \
     6                          $QTDIR/doc/src/template/images
    67
    78outputdir               = $QTDIR/doc/webxml
  • trunk/tools/qdoc3/test/qt.qdocconf

    r769 r846  
    77project                 = Qt
    88versionsym              =
    9 version                 = 4.6.3
     9version                 = 4.7.2
    1010description             = Qt Reference Documentation
    11 url                     = http://qt.nokia.com/doc/4.6
     11url                     = http://qt.nokia.com/doc/4.7
    1212
    13 edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg \
    14                           QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \
    15                           QtDesigner QtAssistant QAxContainer Phonon \
    16                           QAxServer QtUiTools QtTest QtDBus
    17 edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest
    18 edition.DesktopLight.groups       = -graphicsview-api
     13sourceencoding          = UTF-8
     14outputencoding          = UTF-8
     15naturallanguage         = en_US
    1916
    2017qhp.projects            = Qt
    2118
    2219qhp.Qt.file                = qt.qhp
    23 qhp.Qt.namespace           = com.trolltech.qt.460
     20qhp.Qt.namespace           = com.trolltech.qt.472
    2421qhp.Qt.virtualFolder       = qdoc
    2522qhp.Qt.indexTitle          = Qt Reference Documentation
     
    2825# Files not referenced in any qdoc file (last four are needed by qtdemo)
    2926# See also extraimages.HTML
    30 qhp.Qt.extraFiles          = classic.css \
    31                              images/qt-logo.png \
    32                              images/taskmenuextension-example.png \
    33                              images/coloreditorfactoryimage.png \
    34                              images/dynamiclayouts-example.png \
    35                              images/stylesheet-coffee-plastique.png
     27qhp.Qt.extraFiles          = index.html \
     28                 images/bg_l.png \
     29                 images/bg_l_blank.png \
     30                 images/bg_ll_blank.png \
     31                 images/bg_ul_blank.png \
     32                 images/header_bg.png \
     33                 images/bg_r.png \
     34                 images/box_bg.png \
     35                 images/breadcrumb.png \
     36                 images/bullet_gt.png \
     37                 images/bullet_dn.png \
     38                 images/bullet_sq.png \
     39                 images/bullet_up.png \
     40                 images/arrow_down.png \
     41                 images/feedbackground.png \
     42                 images/horBar.png \
     43                 images/page.png \
     44                 images/page_bg.png \
     45                 images/sprites-combined.png \
     46                 images/spinner.gif \
     47                 images/stylesheet-coffee-plastique.png \
     48                 images/taskmenuextension-example.png \
     49                 images/coloreditorfactoryimage.png \
     50                 images/dynamiclayouts-example.png \
     51                 scripts/functions.js \
     52                 scripts/jquery.js \
     53                 scripts/narrow.js \
     54                 scripts/superfish.js \
     55                 style/narrow.css \
     56                 style/superfish.css \
     57                 style/style_ie6.css \
     58                 style/style_ie7.css \
     59                 style/style_ie8.css \
     60                 style/style.css
    3661
    37 qhp.Qt.filterAttributes    = qt 4.6.3 qtrefdoc
    38 qhp.Qt.customFilters.Qt.name = Qt 4.6.3
    39 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.3
    40 qhp.Qt.subprojects         = classes overviews examples
     62qhp.Qt.filterAttributes    = qt 4.7.2 qtrefdoc
     63qhp.Qt.customFilters.Qt.name = Qt 4.7.2
     64qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2
     65qhp.Qt.subprojects         = classes qmlelements overviews examples
    4166qhp.Qt.subprojects.classes.title = Classes
    4267qhp.Qt.subprojects.classes.indexTitle = Qt's Classes
    4368qhp.Qt.subprojects.classes.selectors = class fake:headerfile
    4469qhp.Qt.subprojects.classes.sortPages = true
     70qhp.Qt.subprojects.qmlelements.title = QML Elements
     71qhp.Qt.subprojects.qmlelements.indexTitle = QML Elements
     72qhp.Qt.subprojects.qmlelements.selectors = fake:qmlclass
     73qhp.Qt.subprojects.qmlelements.sortPages = true
    4574qhp.Qt.subprojects.overviews.title = Overviews
    4675qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs
     
    79108                          $QTDIR/src/3rdparty/harfbuzz \
    80109                          $QTDIR/src/3rdparty/kdebase \
     110                          $QTDIR/src/3rdparty/libconninet \
    81111                          $QTDIR/src/3rdparty/libjpeg \
    82112                          $QTDIR/src/3rdparty/libmng \
     
    92122                          $QTDIR/src/3rdparty/wintab \
    93123                          $QTDIR/src/3rdparty/zlib \
    94                           $QTDIR/doc/src/snippets \
    95124                          $QTDIR/src/3rdparty/phonon/gstreamer \
    96125                          $QTDIR/src/3rdparty/phonon/ds9 \
    97126                          $QTDIR/src/3rdparty/phonon/qt7 \
    98127                          $QTDIR/src/3rdparty/phonon/mmf \
    99                           $QTDIR/src/3rdparty/phonon/waveout
     128                          $QTDIR/src/3rdparty/phonon/waveout \
     129                          $QTDIR/doc/src/snippets \
     130                          $QTDIR/doc/src/ja_JP \
     131                          $QTDIR/doc/src/zh_CN
    100132
    101133sources.fileextensions  = "*.cpp *.qdoc *.mm"
    102 examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp"
     134examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml"
    103135examples.imageextensions = "*.png"
    104136
     
    110142                          $QTDIR/src/3rdparty/webkit/WebKit/qt/docs
    111143imagedirs               = $QTDIR/doc/src/images \
    112                           $QTDIR/examples
     144                          $QTDIR/examples \
     145                          $QTDIR/doc/src/declarative/pics \
     146                          $QTDIR/doc/src/template/images
    113147outputdir               = $QTDIR/doc/html
    114148tagfile                 = $QTDIR/doc/html/qt.tags
  • trunk/tools/qdoc3/text.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/text.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    7676    Text subText(Atom::Type left, Atom::Type right, const Atom *from = 0) const;
    7777    void dump() const;
     78    void clear();
    7879
    7980    static Text subText(const Atom *begin, const Atom *end = 0);
     
    8384
    8485 private:
    85     void clear();
    8686
    8787    Atom *first;
  • trunk/tools/qdoc3/tokenizer.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4848#include <qregexp.h>
    4949#include <qstring.h>
     50#include <qtextcodec.h>
    5051
    5152#include <ctype.h>
     
    6768    "slots", "static", "struct", "template", "typedef", "typename",
    6869    "union", "unsigned", "using", "virtual", "void", "volatile",
    69     "__int64", "Q_OBJECT", "Q_OVERRIDE", "Q_PROPERTY",
     70    "__int64",
     71    "Q_OBJECT",
     72    "Q_OVERRIDE",
     73    "Q_PROPERTY",
     74    "Q_PRIVATE_PROPERTY",
    7075    "Q_DECLARE_SEQUENTIAL_ITERATOR",
    7176    "Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR",
     
    98103static QRegExp *falsehoods = 0;
    99104
     105static QTextCodec *sourceCodec = 0;
     106
    100107/*
    101108  This function is a perfect hash function for the 37 keywords of C99
     
    119126}
    120127
    121 Tokenizer::Tokenizer(const Location& loc, FILE *in)
     128Tokenizer::Tokenizer(const Location& loc, QFile &in)
    122129{
    123130    init();
    124     QFile file;
    125     file.open(in, QIODevice::ReadOnly);
    126     yyIn = file.readAll();
    127     file.close();
     131    yyIn = in.readAll();
    128132    yyPos = 0;
    129133    start(loc);
     
    483487{
    484488    QString versionSym = config.getString(CONFIG_VERSIONSYM);
     489
     490    QString sourceEncoding = config.getString(CONFIG_SOURCEENCODING);
     491    if (sourceEncoding.isEmpty())
     492        sourceEncoding = QLatin1String("ISO-8859-1");
     493    sourceCodec = QTextCodec::codecForName(sourceEncoding.toLocal8Bit());
    485494
    486495    comment = new QRegExp("/(?:\\*.*\\*/|/.*\n|/[^\n]*$)");
     
    751760}
    752761
     762QString Tokenizer::lexeme() const
     763{
     764    return sourceCodec->toUnicode(yyLex);
     765}
     766
     767QString Tokenizer::previousLexeme() const
     768{
     769    return sourceCodec->toUnicode(yyPrevLex);
     770}
     771
    753772QT_END_NAMESPACE
  • trunk/tools/qdoc3/tokenizer.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4747#define TOKENIZER_H
    4848
     49#include <qfile.h>
    4950#include <qstack.h>
    5051#include <qstring.h>
    51 
    52 #include <stdio.h>
    5352
    5453#include "location.h"
     
    7776       Tok_typename, Tok_union, Tok_unsigned, Tok_using, Tok_virtual,
    7877       Tok_void, Tok_volatile, Tok_int64, Tok_Q_OBJECT, Tok_Q_OVERRIDE,
    79        Tok_Q_PROPERTY, Tok_Q_DECLARE_SEQUENTIAL_ITERATOR,
     78       Tok_Q_PROPERTY, Tok_Q_PRIVATE_PROPERTY, Tok_Q_DECLARE_SEQUENTIAL_ITERATOR,
    8079       Tok_Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR,
    8180       Tok_Q_DECLARE_ASSOCIATIVE_ITERATOR,
     
    10099 public:
    101100    Tokenizer(const Location& loc, const QByteArray &in);
    102     Tokenizer(const Location& loc, FILE *in);
     101    Tokenizer(const Location& loc, QFile &file);
    103102
    104103    ~Tokenizer();
     
    109108
    110109    const Location &location() const { return yyTokLoc; }
    111     QString previousLexeme() const { return QString(yyPrevLex); }
    112     QString lexeme() const { return QString(yyLex); }
     110    QString previousLexeme() const;
     111    QString lexeme() const;
    113112    QString version() const { return yyVersion; }
    114113    int braceDepth() const { return yyBraceDepth; }
     
    147146        if (ch == EOF)
    148147            return EOF;
    149         // cast explicitely to make sure the value of ch
     148        // cast explicitly to make sure the value of ch
    150149        // is in range [0..255] to avoid assert messages
    151150        // when using debug CRT that checks its input.
  • trunk/tools/qdoc3/tr.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/tree.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4444*/
    4545
    46 #include <QtCore>
    4746#include <QDomDocument>
    4847
     
    5453#include "text.h"
    5554#include "tree.h"
     55
     56#include <limits.h>
     57#include <qdebug.h>
    5658
    5759QT_BEGIN_NAMESPACE
     
    124126/*!
    125127 */
    126 Node *Tree::findNode(const QStringList &path, Node *relative, int findFlags)
     128Node *Tree::findNode(const QStringList &path, Node *relative, int findFlags, const Node* self)
    127129{
    128130    return const_cast<Node*>(const_cast<const Tree*>(this)->findNode(path,
    129131                                                                     relative,
    130                                                                      findFlags));
    131 }
    132 
    133 /*!
    134  */
    135 const Node *Tree::findNode(const QStringList &path,
    136                            const Node *relative,
    137                            int findFlags) const
    138 {
    139     if (!relative)
    140         relative = root();
     132                                                                     findFlags,
     133                                                                     self));
     134}
     135
     136/*!
     137 */
     138const Node* Tree::findNode(const QStringList &path,
     139                           const Node* start,
     140                           int findFlags,
     141                           const Node* self) const
     142{
     143    const Node* current = start;
     144    if (!current)
     145        current = root();
    141146
    142147    do {
    143         const Node *node = relative;
     148        const Node *node = current;
    144149        int i;
    145150
     
    150155            const Node *next =
    151156                static_cast<const InnerNode*>(node)->findNode(path.at(i));
     157           
    152158            if (!next && (findFlags & SearchEnumValues) && i == path.size()-1)
    153159                next = static_cast<const InnerNode*>(node)->findEnumNodeForValue(path.at(i));
     
    168174        if (node && i == path.size()
    169175                && (!(findFlags & NonFunction) || node->type() != Node::Function
    170                     || ((FunctionNode *)node)->metaness() == FunctionNode::MacroWithoutParams))
    171             return node;
    172         relative = relative->parent();
    173     } while (relative);
     176                    || ((FunctionNode *)node)->metaness() == FunctionNode::MacroWithoutParams)) {
     177            if ((node != self) && (node->subType() != Node::QmlPropertyGroup)) {
     178                return node;
     179            }
     180        }
     181        current = current->parent();
     182    } while (current);
    174183
    175184    return 0;
     
    461470        NodeList::ConstIterator c = rootNode->childNodes().begin();
    462471        while (c != rootNode->childNodes().end()) {
    463             if ((*c)->type() == Node::Class)
     472            if ((*c)->type() == Node::Class) {
    464473                resolveInheritance(pass, (ClassNode *) *c);
     474            }
    465475            else if ((*c)->type() == Node::Namespace) {
    466476                NamespaceNode *ns = static_cast<NamespaceNode*>(*c);
     
    534544            ClassNode *baseClass = (ClassNode*)findNode((*b).basePath,
    535545                                                        Node::Class);
    536             if (!baseClass && (*b).parent)
     546            if (!baseClass && (*b).parent) {
    537547                baseClass = (ClassNode*)findNode((*b).basePath,
    538548                                                 Node::Class,
    539549                                                 (*b).parent);
    540             if (baseClass)
     550            }
     551            if (baseClass) {
    541552                classe->addBaseClass((*b).access,
    542553                                     baseClass,
    543554                                     (*b).dataTypeWithTemplateArgs);
     555            }
    544556            ++b;
    545557        }
     
    11191131            nodeName = "target";
    11201132            break;
     1133        case Node::QmlProperty:
     1134            nodeName = "qmlproperty";
     1135            break;
     1136        case Node::QmlSignal:
     1137            nodeName = "qmlsignal";
     1138            break;
     1139        case Node::QmlMethod:
     1140            nodeName = "qmlmethod";
     1141            break;
    11211142        default:
    11221143            return false;
     
    12081229        writer.writeAttribute("fullname", fullName);
    12091230    writer.writeAttribute("href", fullDocumentLocation(node));
    1210     if (node->type() != Node::Fake)
     1231    if ((node->type() != Node::Fake) && (!node->isQmlNode()))
    12111232        writer.writeAttribute("location", node->location().fileName());
    12121233
     
    12621283                case Node::ExternalPage:
    12631284                    writer.writeAttribute("subtype", "externalpage");
     1285                    break;
     1286                case Node::QmlClass:
     1287                    writer.writeAttribute("subtype", "qmlclass");
     1288                    break;
     1289                case Node::QmlBasicType:
     1290                    writer.writeAttribute("subtype", "qmlbasictype");
    12641291                    break;
    12651292                default:
     
    13351362        break;
    13361363
     1364    case Node::QmlProperty:
     1365        {
     1366            const QmlPropertyNode *qpn = static_cast<const QmlPropertyNode*>(node);
     1367            writer.writeAttribute("type", qpn->dataType());
     1368        }
     1369        break;
    13371370    case Node::Property:
    13381371        {
     
    15221555            const InnerNode *inner = static_cast<const InnerNode *>(node);
    15231556
    1524             // Recurse to write an element for this child node and all its children.
    1525             foreach (const Node *child, inner->childNodes())
    1526                 generateIndexSections(writer, child, generateInternalNodes);
     1557            foreach (const Node *child, inner->childNodes()) {
     1558                /*
     1559                  Don't generate anything for a QML property group node.
     1560                  It is just a place holder for a collection of QML property
     1561                  nodes. Recurse to its children, which are the QML property
     1562                  nodes.
     1563                 */
     1564                if (child->subType() == Node::QmlPropertyGroup) {
     1565                    const InnerNode *pgn = static_cast<const InnerNode*>(child);
     1566                    foreach (const Node *c, pgn->childNodes()) {
     1567                        generateIndexSections(writer, c, generateInternalNodes);
     1568                    }
     1569                }
     1570                else
     1571                    generateIndexSections(writer, child, generateInternalNodes);
     1572            }
    15271573
    15281574/*
     
    19151961    else if (node->type() == Node::Fake) {
    19161962#ifdef QDOC_QML
    1917         if (node->subType() == Node::QmlClass)
    1918             return "qml-" + node->fileBase() + ".html";
    1919         else
     1963        if ((node->subType() == Node::QmlClass) ||
     1964            (node->subType() == Node::QmlBasicType)) {
     1965            QString fb = node->fileBase();
     1966            if (fb.startsWith(QLatin1String("qml-")))
     1967                return fb + ".html";
     1968            else
     1969                return "qml-" + node->fileBase() + ".html";
     1970        } else
    19201971#endif
    19211972        parentName = node->fileBase() + ".html";
     
    19281979    if ((parentNode = node->relates()))
    19291980        parentName = fullDocumentLocation(node->relates());
    1930     else if ((parentNode = node->parent()))
    1931         parentName = fullDocumentLocation(node->parent());
    1932 
     1981    else if ((parentNode = node->parent())) {
     1982        if (parentNode->subType() == Node::QmlPropertyGroup) {
     1983            parentNode = parentNode->parent();
     1984            parentName = fullDocumentLocation(parentNode);
     1985        }
     1986        else
     1987            parentName = fullDocumentLocation(node->parent());
     1988    }
     1989#if 0
     1990    if (node->type() == Node::QmlProperty) {
     1991        qDebug() << "Node::QmlProperty:" << node->name()
     1992                 << "parentName:" << parentName;
     1993        if (parentNode)
     1994            qDebug() << "PARENT NODE" << parentNode->type()
     1995                     << parentNode->subType() << parentNode->name();
     1996    }
     1997#endif
    19331998    switch (node->type()) {
    19341999        case Node::Class:
     
    19762041        case Node::Property:
    19772042            anchorRef = "#" + node->name() + "-prop";
     2043            break;
     2044        case Node::QmlProperty:
     2045            anchorRef = "#" + node->name() + "-prop";
     2046            break;
     2047        case Node::QmlSignal:
     2048            anchorRef = "#" + node->name() + "-signal";
     2049            break;
     2050        case Node::QmlMethod:
     2051            anchorRef = "#" + node->name() + "-method";
    19782052            break;
    19792053        case Node::Variable:
     
    20162090
    20172091/*!
     2092  Construct the full document name for \a node and return the
     2093  name.
    20182094 */
    20192095QString Tree::fullDocumentName(const Node *node) const
     
    20262102
    20272103    do {
    2028         if (!n->name().isEmpty())
     2104        if (!n->name().isEmpty() &&
     2105            ((n->type() != Node::Fake) || (n->subType() != Node::QmlPropertyGroup)))
    20292106            pieces.insert(0, n->name());
    20302107
    2031         if (n->type() == Node::Fake)
     2108        if ((n->type() == Node::Fake) && (n->subType() != Node::QmlPropertyGroup))
    20322109            break;
    20332110
  • trunk/tools/qdoc3/tree.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    6666    ~Tree();
    6767
    68     Node *findNode(const QStringList &path, Node *relative=0, int findFlags=0);
    69     Node *findNode(const QStringList &path,
     68    Node* findNode(const QStringList &path,
     69                   Node* relative=0,
     70                   int findFlags=0,
     71                   const Node* self=0);
     72    Node* findNode(const QStringList &path,
    7073                   Node::Type type,
    71                    Node *relative = 0,
     74                   Node* relative = 0,
    7275                   int findFlags = 0);
    7376    FunctionNode *findFunctionNode(const QStringList &path,
     
    99102
    100103    QString version() const { return vers; }
    101     const Node *findNode(const QStringList &path,
    102                          const Node *relative = 0,
    103                          int findFlags = 0) const;
    104     const Node *findNode(const QStringList &path,
     104    const Node* findNode(const QStringList &path,
     105                         const Node* relative = 0,
     106                         int findFlags = 0,
     107                         const Node* self=0) const;
     108    const Node* findNode(const QStringList &path,
    105109                         Node::Type type, const
    106                          Node *relative = 0,
     110                         Node* relative = 0,
    107111                         int findFlags = 0) const;
    108112    const FunctionNode *findFunctionNode(const QStringList &path,
  • trunk/tools/qdoc3/uncompressor.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/uncompressor.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
  • trunk/tools/qdoc3/webxmlgenerator.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4444*/
    4545
    46 #include <QtXml>
    47 
    4846#include "codemarker.h"
    4947#include "pagegenerator.h"
     
    5351#include "tree.h"
    5452
     53#include <QtCore/qxmlstream.h>
     54
    5555QT_BEGIN_NAMESPACE
    5656
     
    9191}
    9292
    93 QString WebXMLGenerator::fileExtension(const Node * /* node */)
     93QString WebXMLGenerator::fileExtension(const Node * /* node */) const
    9494{
    9595    return "xml";
  • trunk/tools/qdoc3/webxmlgenerator.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4747#define WEBXMLGENERATOR_H
    4848
     49#include <QtCore/qxmlstream.h>
     50
    4951#include "codemarker.h"
    5052#include "config.h"
     
    5254
    5355QT_BEGIN_NAMESPACE
     56
     57class QXmlStreamReader;
     58class QXmlStreamWriter;
    5459
    5560class WebXMLGenerator : public PageGenerator
     
    7075    virtual void generateClassLikeNode(const InnerNode *inner, CodeMarker *marker);
    7176    virtual void generateFakeNode(const FakeNode *fake, CodeMarker *marker);
    72     virtual QString fileExtension(const Node *node);
     77    virtual QString fileExtension(const Node *node) const;
    7378
    7479    virtual const Atom *addAtomElements(QXmlStreamWriter &writer, const Atom *atom,
  • trunk/tools/qdoc3/yyindent.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
Note: See TracChangeset for help on using the changeset viewer.