Changeset 846 for trunk/tools/qdoc3
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 104 edited
- 53 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/tools/qdoc3/apigenerator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/apigenerator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/archiveextractor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/archiveextractor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/atom.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/atom.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/bookgenerator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/bookgenerator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/ccodeparser.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/ccodeparser.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/codechunk.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/codechunk.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 56 56 The CodeChunk class represents a tiny piece of C++ code. 57 57 58 The class provides conver tion between a list of lexemes and a string. It adds58 The class provides conversion between a list of lexemes and a string. It adds 59 59 spaces at the right place for consistent style. The tiny pieces of code it 60 60 represents are data types, enum values, and default parameter values. -
trunk/tools/qdoc3/codemarker.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 178 178 { 179 179 if (sizeof(const Node *) == sizeof(ulong)) { 180 return QString::number(reinterpret_cast< ulong>(node));180 return QString::number(reinterpret_cast<quintptr>(node)); 181 181 } 182 182 else { … … 258 258 { 259 259 QString tag; 260 QString name = node->name(); 260 261 261 262 switch (node->type()) { … … 278 279 tag = QLatin1String("@property"); 279 280 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 280 290 default: 281 291 tag = QLatin1String("@unknown"); 282 292 break; 283 293 } 284 return QLatin1Char('<') + tag + QLatin1Char('>') + protect(n ode->name())294 return QLatin1Char('<') + tag + QLatin1Char('>') + protect(name) 285 295 + QLatin1String("</") + tag + QLatin1Char('>'); 286 296 } … … 458 468 { 459 469 if (!fs.isEmpty()) { 460 Section section(fs.name,fs. singularMember,fs.pluralMember);470 Section section(fs.name,fs.divClass,fs.singularMember,fs.pluralMember); 461 471 section.members = fs.memberMap.values(); 462 472 section.reimpMembers = fs.reimpMemberMap.values(); … … 615 625 the specified QmlClassNode. 616 626 */ 617 QList<Section> CodeMarker::qmlSections(const QmlClassNode* , SynopsisStyle ) 627 QList<Section> CodeMarker::qmlSections(const QmlClassNode* , 628 SynopsisStyle , 629 const Tree* ) 618 630 { 619 631 return QList<Section>(); … … 621 633 #endif 622 634 635 const Node* CodeMarker::resolveTarget(const QString& , 636 const Tree* , 637 const Node* , 638 const Node* ) 639 { 640 return 0; 641 } 642 623 643 QT_END_NAMESPACE -
trunk/tools/qdoc3/codemarker.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 59 59 { 60 60 QString name; 61 QString divClass; 61 62 QString singularMember; 62 63 QString pluralMember; … … 67 68 Section() { } 68 69 Section(const QString& name0, 70 const QString& divClass0, 69 71 const QString& singularMember0, 70 72 const QString& pluralMember0) 71 : name(name0), 73 : name(name0), 74 divClass(divClass0), 72 75 singularMember(singularMember0), 73 76 pluralMember(pluralMember0) { } … … 80 83 const InnerNode *innerNode; 81 84 QString name; 85 QString divClass; 82 86 QString singularMember; 83 87 QString pluralMember; … … 87 91 88 92 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) 92 97 : innerNode(innerNode0), 93 98 name(name0), 99 divClass(divClass0), 94 100 singularMember(singularMember0), 95 101 pluralMember(pluralMember0) { } 96 102 bool isEmpty() const { 97 return (memberMap.isEmpty() && inherited.isEmpty() && 103 return (memberMap.isEmpty() && 104 inherited.isEmpty() && 98 105 reimpMemberMap.isEmpty()); 99 106 } 100 107 101 108 }; 109 110 #if 0 111 const QString& name0 = "", 112 const QString& divClass0 = "", 113 const QString& singularMember0 = "member", 114 const QString& pluralMember0 = "members") 115 #endif 102 116 103 117 class CodeMarker … … 140 154 #ifdef QDOC_QML 141 155 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); 148 164 149 165 static void initialize(const Config& config); -
trunk/tools/qdoc3/codeparser.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 */ 45 45 46 #include <QtCore>47 46 #include "codeparser.h" 48 47 #include "node.h" 49 48 #include "tree.h" 50 49 #include "config.h" 50 #include <QDebug> 51 51 52 52 QT_BEGIN_NAMESPACE … … 60 60 #define COMMAND_NONREENTRANT Doc::alias(QLatin1String("nonreentrant")) 61 61 #define COMMAND_OBSOLETE Doc::alias(QLatin1String("obsolete")) 62 #define COMMAND_PAGEKEYWORDS Doc::alias(QLatin1String("pagekeywords")) 62 63 #define COMMAND_PRELIMINARY Doc::alias(QLatin1String("preliminary")) 63 64 #define COMMAND_INPUBLICGROUP Doc::alias(QLatin1String("inpublicgroup")) … … 70 71 QList<CodeParser *> CodeParser::parsers; 71 72 bool CodeParser::showInternal = false; 73 QMap<QString,QString> CodeParser::nameToTitle; 72 74 73 75 /*! … … 171 173 << COMMAND_NONREENTRANT 172 174 << COMMAND_OBSOLETE 175 << COMMAND_PAGEKEYWORDS 173 176 << COMMAND_PRELIMINARY 174 177 << COMMAND_INPUBLICGROUP … … 231 234 node->setSince(arg); 232 235 } 236 else if (command == COMMAND_PAGEKEYWORDS) { 237 node->addPageKeywords(arg); 238 } 233 239 else if (command == COMMAND_SUBTITLE) { 234 240 if (node->type() == Node::Fake) { … … 246 252 FakeNode *fake = static_cast<FakeNode *>(node); 247 253 fake->setTitle(arg); 254 nameToTitle.insert(fake->name(),arg); 248 255 } 249 256 else … … 252 259 } 253 260 261 /*! 262 Find the page title given the page \a name and return it. 263 */ 264 const QString CodeParser::titleFromName(const QString& name) 265 { 266 const QString t = nameToTitle.value(name); 267 return t; 268 } 269 254 270 QT_END_NAMESPACE -
trunk/tools/qdoc3/codeparser.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 79 79 static void terminate(); 80 80 static CodeParser *parserForLanguage(const QString& language); 81 static const QString titleFromName(const QString& name); 81 82 82 83 protected: … … 89 90 static QList<CodeParser *> parsers; 90 91 static bool showInternal; 92 static QMap<QString,QString> nameToTitle; 91 93 }; 92 94 -
trunk/tools/qdoc3/command.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 48 48 #include "command.h" 49 49 50 #include <stdlib.h> 51 50 52 QT_BEGIN_NAMESPACE 51 53 … … 70 72 toolName.truncate(space); 71 73 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 72 80 QProcess process; 73 81 process.start(QLatin1String("sh"), … … 90 98 "It emitted these errors:\n%2") 91 99 .arg(actualCommand).arg(errors)); 100 #endif 92 101 } 93 102 -
trunk/tools/qdoc3/command.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/config.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 */ 45 45 46 #include <QtCore> 46 #include <QDir> 47 #include <QVariant> 48 #include <QFile> 49 #include <QTemporaryFile> 50 #include <QTextStream> 47 51 48 52 #include "archiveextractor.h" … … 525 529 QStringList::ConstIterator e = fileExtensions.begin(); 526 530 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); 529 536 if (!filePath.isEmpty()) 530 537 return filePath; … … 672 679 } 673 680 674 QString text = fin.readAll(); 681 QTextStream stream(&fin); 682 stream.setCodec("UTF-8"); 683 QString text = stream.readAll(); 675 684 text += QLatin1String("\n\n"); 676 685 text += QChar('\0'); -
trunk/tools/qdoc3/config.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 120 120 121 121 #define CONFIG_ALIAS "alias" 122 #define CONFIG_APPLICATION "application" 122 123 #define CONFIG_BASE "base" // ### don't document for now 123 124 #define CONFIG_CODEINDENT "codeindent" … … 141 142 #define CONFIG_LANGUAGE "language" 142 143 #define CONFIG_MACRO "macro" 144 #define CONFIG_NATURALLANGUAGE "naturallanguage" 143 145 #define CONFIG_OBSOLETELINKS "obsoletelinks" 146 #define CONFIG_APPLICATION "application" 144 147 #define CONFIG_OUTPUTDIR "outputdir" 148 #define CONFIG_OUTPUTENCODING "outputencoding" 145 149 #define CONFIG_OUTPUTLANGUAGE "outputlanguage" 146 150 #define CONFIG_OUTPUTFORMATS "outputformats" … … 148 152 #define CONFIG_QHP "qhp" 149 153 #define CONFIG_QUOTINGINFORMATION "quotinginformation" 154 #define CONFIG_SCRIPTDIRS "scriptdirs" 155 #define CONFIG_SCRIPTS "scripts" 150 156 #define CONFIG_SLOW "slow" 151 157 #define CONFIG_SHOWINTERNAL "showinternal" 152 158 #define CONFIG_SOURCEDIRS "sourcedirs" 159 #define CONFIG_SOURCEENCODING "sourceencoding" 153 160 #define CONFIG_SOURCES "sources" 154 161 #define CONFIG_SPURIOUS "spurious" 162 #define CONFIG_STYLEDIRS "styledirs" 163 #define CONFIG_STYLES "styles" 155 164 #define CONFIG_STYLESHEETS "stylesheets" 156 165 #define CONFIG_TABSIZE "tabsize" -
trunk/tools/qdoc3/cppcodemarker.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 146 146 else { 147 147 QString fullName; 148 for (;;) {148 while (node) { 149 149 fullName.prepend(plainName(node)); 150 150 if (node->parent() == relative || node->parent()->name().isEmpty()) … … 483 483 FastSection privateFunctions(classe, 484 484 "Private Functions", 485 "", 485 486 "private function", 486 487 "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"); 489 490 FastSection protectedFunctions(classe, 490 491 "Protected Functions", 492 "", 491 493 "protected function", 492 494 "protected functions"); 493 495 FastSection protectedSlots(classe, 494 496 "Protected Slots", 497 "", 495 498 "protected slot", 496 499 "protected slots"); 497 500 FastSection protectedTypes(classe, 498 501 "Protected Types", 502 "", 499 503 "protected type", 500 504 "protected types"); 501 505 FastSection protectedVariables(classe, 502 506 "Protected Variables", 507 "", 503 508 "protected type", 504 509 "protected variables"); 505 510 FastSection publicFunctions(classe, 506 511 "Public Functions", 512 "", 507 513 "public function", 508 514 "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"); 512 518 FastSection publicVariables(classe, 513 519 "Public Variables", 514 "public type", 520 "", 521 "public variable", 515 522 "public variables"); 516 FastSection properties(classe, "Properties", " property", "properties");523 FastSection properties(classe, "Properties", "", "property", "properties"); 517 524 FastSection relatedNonMembers(classe, 518 525 "Related Non-Members", 526 "", 519 527 "related non-member", 520 528 "related non-members"); 521 529 FastSection staticPrivateMembers(classe, 522 530 "Static Private Members", 531 "", 523 532 "static private member", 524 533 "static private members"); 525 534 FastSection staticProtectedMembers(classe, 526 535 "Static Protected Members", 536 "", 527 537 "static protected member", 528 538 "static protected members"); 529 539 FastSection staticPublicMembers(classe, 530 540 "Static Public Members", 541 "", 531 542 "static public member", 532 543 "static public members"); 533 FastSection macros(inner, "Macros", " macro", "macros");544 FastSection macros(inner, "Macros", "", "macro", "macros"); 534 545 535 546 NodeList::ConstIterator r = classe->relatedNodes().begin(); … … 667 678 } 668 679 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"); 675 686 676 687 NodeList::ConstIterator r = classe->relatedNodes().begin(); … … 718 729 } 719 730 else { 720 FastSection all(classe );731 FastSection all(classe,"","","member","members"); 721 732 722 733 QStack<const ClassNode *> stack; … … 748 759 FastSection namespaces(inner, 749 760 "Namespaces", 761 style == Detailed ? "nmspace" : "", 750 762 "namespace", 751 763 "namespaces"); 752 764 FastSection classes(inner, 753 765 "Classes", 766 style == Detailed ? "classes" : "", 754 767 "class", 755 768 "classes"); 756 769 FastSection types(inner, 757 style == Summary ? 758 "Types" : "Type Documentation",770 style == Summary ? "Types" : "Type Documentation", 771 style == Detailed ? "types" : "", 759 772 "type", 760 773 "types"); … … 762 775 style == Summary ? 763 776 "Functions" : "Function Documentation", 777 style == Detailed ? "func" : "", 764 778 "function", 765 779 "functions"); … … 767 781 style == Summary ? 768 782 "Macros" : "Macro Documentation", 783 style == Detailed ? "macros" : "", 769 784 "macro", 770 785 "macros"); … … 811 826 } 812 827 813 const Node *CppCodeMarker::resolveTarget(const QString &target, 814 const Tree *tree, 815 const Node *relative) 828 const Node *CppCodeMarker::resolveTarget(const QString& target, 829 const Tree* tree, 830 const Node* relative, 831 const Node* self) 816 832 { 817 833 if (target.endsWith("()")) { … … 855 871 QStringList path = target.split("::"); 856 872 const Node *node; 873 int flags = Tree::SearchBaseClasses | 874 Tree::SearchEnumValues | 875 Tree::NonFunction; 857 876 if ((node = tree->findNode(path, 858 877 relative, 859 Tree::SearchBaseClasses | 860 Tree::SearchEnumValues | 861 Tree::NonFunction))) 878 flags, 879 self))) 862 880 return node; 863 881 } … … 882 900 static QRegExp multiLineComment("/(?:( )?\\*(?:[^*]+|\\*(?! /))*\\*\\1/)"); 883 901 multiLineComment.setMinimal(true); 884 static QRegExp singleLineComment(" //(?!!)[^!\n]*");902 static QRegExp singleLineComment("[^:]//(?!!)[^!\\n]*"); 885 903 static QRegExp preprocessor("(?:^|\n)(#[ \t]*(?:include|if|elif|endif|error|pragma|define" 886 904 "|warning)(?:(?:\\\\\n|\\n#)[^\n]*)*)"); … … 1068 1086 } 1069 1087 else if (mlpos == -1) { 1070 pos = slpos ;1071 len = singleLineComment.matchedLength() ;1088 pos = slpos + 1; 1089 len = singleLineComment.matchedLength() - 1; 1072 1090 } 1073 1091 else { 1074 1092 if (slpos < mlpos) { 1075 pos = slpos ;1076 len = singleLineComment.matchedLength() ;1093 pos = slpos + 1; 1094 len = singleLineComment.matchedLength() - 1; 1077 1095 } 1078 1096 else { … … 1110 1128 */ 1111 1129 QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, 1112 SynopsisStyle style) 1130 SynopsisStyle style, 1131 const Tree* tree) 1113 1132 { 1114 1133 QList<Section> sections; … … 1117 1136 FastSection qmlproperties(qmlClassNode, 1118 1137 "Properties", 1138 "", 1119 1139 "property", 1120 1140 "properties"); 1121 1141 FastSection qmlattachedproperties(qmlClassNode, 1122 1142 "Attached Properties", 1143 "", 1123 1144 "property", 1124 1145 "properties"); 1125 1146 FastSection qmlsignals(qmlClassNode, 1126 "Signals", 1127 "signal", 1128 "signals"); 1147 "Signals", 1148 "", 1149 "signal", 1150 "signals"); 1129 1151 FastSection qmlattachedsignals(qmlClassNode, 1130 "QML Attached Signals", 1152 "Attached Signals", 1153 "", 1131 1154 "signal", 1132 1155 "signals"); 1133 1156 FastSection qmlmethods(qmlClassNode, 1134 1157 "Methods", 1158 "", 1135 1159 "method", 1136 1160 "methods"); 1137 1161 FastSection qmlattachedmethods(qmlClassNode, 1138 "QML Attached Methods", 1162 "Attached Methods", 1163 "", 1139 1164 "method", 1140 1165 "methods"); … … 1180 1205 } 1181 1206 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"); 1188 1216 NodeList::ConstIterator c = qmlClassNode->childNodes().begin(); 1189 1217 while (c != qmlClassNode->childNodes().end()) { … … 1218 1246 append(sections,qmlattachedmethods); 1219 1247 } 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 } 1220 1290 } 1221 1291 -
trunk/tools/qdoc3/cppcodemarker.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 81 81 Status status); 82 82 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); 87 89 88 90 private: -
trunk/tools/qdoc3/cppcodeparser.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 */ 45 45 46 #include <QtCore>47 46 #include <qfile.h> 48 47 49 48 #include <stdio.h> 50 49 #include <errno.h> 50 #include <qdebug.h> 51 51 52 52 #include "codechunk.h" … … 96 96 #define COMMAND_QMLATTACHEDMETHOD Doc::alias("qmlattachedmethod") 97 97 #define COMMAND_QMLDEFAULT Doc::alias("default") 98 #define COMMAND_QMLBASICTYPE Doc::alias("qmlbasictype") 98 99 #endif 99 100 … … 281 282 Tree *tree) 282 283 { 283 FILE *in = fopen(QFile::encodeName(filePath), "r");284 if (!in ) {284 QFile in(filePath); 285 if (!in.open(QIODevice::ReadOnly)) { 285 286 location.error(tr("Cannot open C++ header file '%1'").arg(filePath)); 286 287 return; … … 295 296 if (!fileTokenizer.version().isEmpty()) 296 297 tree->setVersion(fileTokenizer.version()); 297 fclose(in);298 in.close(); 298 299 299 300 if (fileLocation.fileName() == "qiterator.h") … … 312 313 Tree *tree) 313 314 { 314 FILE *in = fopen(QFile::encodeName(filePath), "r");315 if (!in ) {315 QFile in(filePath); 316 if (!in.open(QIODevice::ReadOnly)) { 316 317 location.error(tr("Cannot open C++ source file '%1' (%2)").arg(filePath).arg(strerror(errno))); 317 318 return; … … 325 326 usedNamespaces.clear(); 326 327 matchDocsAndStuff(); 327 fclose(in);328 in.close(); 328 329 } 329 330 … … 492 493 } 493 494 494 495 495 496 /* 496 497 There are several functions with the correct … … 537 538 << COMMAND_QMLATTACHEDSIGNAL 538 539 << COMMAND_QMLMETHOD 539 << COMMAND_QMLATTACHEDMETHOD; 540 << COMMAND_QMLATTACHEDMETHOD 541 << COMMAND_QMLBASICTYPE; 540 542 #else 541 543 << COMMAND_VARIABLE; … … 544 546 545 547 /*! 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. 547 549 */ 548 550 Node *CppCodeParser::processTopicCommand(const Doc& doc, … … 727 729 classNode = static_cast<const ClassNode*>(n); 728 730 } 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); 730 738 } 731 739 else if ((command == COMMAND_QMLSIGNAL) || … … 737 745 QmlClassNode* qmlClass = 0; 738 746 if (splitQmlMethodArg(doc,arg,type,element)) { 747 if (element.startsWith(QLatin1String("Qt"))) 748 element = QLatin1String("QML:") + element; 739 749 Node* n = tre->findNode(QStringList(element),Node::Fake); 740 750 if (n && n->subType() == Node::QmlClass) { … … 897 907 << COMMAND_PREVIOUSPAGE 898 908 << COMMAND_INDEXPAGE 899 #ifdef QDOC_QML 909 #ifdef QDOC_QML 900 910 << COMMAND_STARTPAGE 901 911 << COMMAND_QMLINHERITS 902 912 << COMMAND_QMLDEFAULT; 903 #else 913 #else 904 914 << COMMAND_STARTPAGE; 905 #endif 915 #endif 906 916 } 907 917 … … 1018 1028 else if (command == COMMAND_QMLINHERITS) { 1019 1029 setLink(node, Node::InheritsLink, arg); 1020 } 1030 if (node->subType() == Node::QmlClass) { 1031 QmlClassNode::addInheritedBy(arg,node); 1032 } 1033 } 1021 1034 else if (command == COMMAND_QMLDEFAULT) { 1022 1035 QmlPropGroupNode* qpgn = static_cast<QmlPropGroupNode*>(node); … … 1105 1118 else 1106 1119 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 */ 1126 bool CppCodeParser::skipTo(int target) 1127 { 1128 while ((tok != Tok_Eoi) && (tok != target)) 1129 readToken(); 1130 return (tok == target ? true : false); 1107 1131 } 1108 1132 … … 1350 1374 if (!matchDataType(&returnType)) { 1351 1375 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))) 1353 1379 returnType = CodeChunk(previousLexeme()); 1354 1380 else { … … 1633 1659 QString namespaceName = previousLexeme(); 1634 1660 NamespaceNode *namespasse = 0; 1635 if (parent) 1661 if (parent) { 1636 1662 namespasse = static_cast<NamespaceNode*>(parent->findNode(namespaceName, Node::Namespace)); 1663 } 1637 1664 if (!namespasse) { 1638 1665 namespasse = new NamespaceNode(parent, namespaceName); … … 1783 1810 bool CppCodeParser::matchProperty(InnerNode *parent) 1784 1811 { 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)) { 1788 1821 return false; 1789 if (!match(Tok_LeftParen)) 1822 } 1823 1824 if (!match(expected_tok)) 1790 1825 return false; 1791 1826 … … 1831 1866 tre->addPropertyFunction(property, value, PropertyNode::Setter); 1832 1867 property->setWritable(true); 1833 } else if (key == "STORED") 1868 } 1869 else if (key == "STORED") 1834 1870 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 } 1837 1882 else if (key == "RESET") 1838 1883 tre->addPropertyFunction(property, value, PropertyNode::Resetter); … … 1840 1885 tre->addPropertyFunction(property, value, PropertyNode::Notifier); 1841 1886 } 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(); 1843 1902 } 1844 1903 match(Tok_RightParen); … … 1912 1971 case Tok_Q_OVERRIDE: 1913 1972 case Tok_Q_PROPERTY: 1973 case Tok_Q_PRIVATE_PROPERTY: 1914 1974 case Tok_QDOC_PROPERTY: 1915 1975 matchProperty(parent); … … 2100 2160 ++a; 2101 2161 } 2102 #endif 2162 #endif 2103 2163 } 2104 2164 … … 2249 2309 { 2250 2310 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"; 2256 2312 QString userFriendlyFilePath; 2313 2257 2314 QString fullPath = Config::findFile(fake->doc().location(), 2258 2315 exampleFiles, … … 2260 2317 proFileName, 2261 2318 userFriendlyFilePath); 2262 2319 2263 2320 if (fullPath.isEmpty()) { 2264 2321 QString tmp = proFileName; … … 2271 2328 userFriendlyFilePath); 2272 2329 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 } 2276 2342 } 2277 2343 } … … 2283 2349 QString imagesPath = fullPath + "/images"; 2284 2350 QStringList imageFiles = Config::getFilesHere(imagesPath,exampleImageFilter); 2285 2286 #if 02287 qDebug() << "examplePath:" << examplePath;2288 qDebug() << " exampleFiles" << exampleFiles;2289 qDebug() << "imagesPath:" << imagesPath;2290 qDebug() << "fullPath:" << fullPath;2291 qDebug() << " imageFiles" << imageFiles;2292 #endif2293 2351 2294 2352 if (!exampleFiles.isEmpty()) { … … 2304 2362 } 2305 2363 else if (fileName.contains("/qrc_") || fileName.contains("/moc_") 2306 2364 || fileName.contains("/ui_")) 2307 2365 i.remove(); 2308 2366 } … … 2311 2369 2312 2370 // 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"); 2314 2372 } 2315 2373 -
trunk/tools/qdoc3/cppcodeparser.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 120 120 QString lexeme(); 121 121 bool match(int target); 122 bool skipTo(int target); 122 123 bool matchCompat(); 123 124 bool matchTemplateAngles(CodeChunk *type = 0); -
trunk/tools/qdoc3/cpptoqsconverter.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/cpptoqsconverter.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/dcfsection.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/dcfsection.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/doc.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 2747 2747 } 2748 2748 2749 #if notyet // ###2750 Doc::SectioningUnit Doc::sectioningUnit() const2751 {2752 if (priv == 0 || priv->extra == 0) {2753 return DocPrivateExtra().sectioningUnit;2754 }2755 else {2756 return priv->extra->sectioningUnit;2757 }2758 }2759 #endif2760 2761 2749 const QSet<QString> &Doc::parameterNames() const 2762 2750 { … … 3037 3025 result.reserve(title.size()); 3038 3026 3039 bool slurping= false;3027 bool dashAppended = false; 3040 3028 bool begun = false; 3041 3029 int lastAlnum = 0; … … 3048 3036 result += QLatin1Char(c); 3049 3037 begun = true; 3050 slurping= false;3038 dashAppended = false; 3051 3039 lastAlnum = result.size(); 3052 3040 } 3053 else if (! slurping) {3041 else if (!dashAppended) { 3054 3042 if (begun) 3055 3043 result += QLatin1Char('-'); 3056 slurping= true;3044 dashAppended = true; 3057 3045 } 3046 #if 0 3047 // This was screwing things up. 3058 3048 else { 3059 // !alnum && slurping -> nothin 3049 result += title[i]; 3050 lastAlnum = result.size(); 3060 3051 } 3052 #endif 3061 3053 } 3062 3054 result.truncate(lastAlnum); -
trunk/tools/qdoc3/doc.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 49 49 #include <QSet> 50 50 #include <QString> 51 #include <QMap> 51 52 52 53 #include "location.h" -
trunk/tools/qdoc3/editdistance.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/editdistance.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/generator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 43 43 generator.cpp 44 44 */ 45 #include <QtCore>46 45 #include <qdir.h> 47 46 #include <qdebug.h> … … 68 67 QStringList Generator::exampleDirs; 69 68 QStringList Generator::exampleImgExts; 69 QStringList Generator::scriptFiles; 70 QStringList Generator::scriptDirs; 71 QStringList Generator::styleFiles; 72 QStringList Generator::styleDirs; 70 73 QString Generator::outDir; 71 74 QString Generator::project; … … 126 129 config.lastLocation().fatal(tr("Cannot create output directory '%1'") 127 130 .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")); 128 137 } 129 138 130 139 imageFiles = config.getStringList(CONFIG_IMAGES); 131 140 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); 132 145 exampleDirs = config.getStringList(CONFIG_EXAMPLEDIRS); 133 146 exampleImgExts = config.getStringList(CONFIG_EXAMPLES + Config::dot + … … 167 180 ++e; 168 181 } 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 } 169 223 } 170 224 ++g; … … 228 282 imageDirs.clear(); 229 283 outDir = ""; 284 QmlClassNode::clear(); 230 285 } 231 286 … … 323 378 324 379 if (node->type() == Node::Function) { 325 #if 0 380 #if 0 326 381 const FunctionNode *func = (const FunctionNode *) node; 327 382 if (func->isOverload() && func->metaness() != FunctionNode::Ctor) 328 383 generateOverload(node, marker); 329 #endif 384 #endif 330 385 } 331 386 else if (node->type() == Node::Fake) { … … 348 403 generateReimplementedFrom(func, marker); 349 404 } 350 405 351 406 if (!generateText(node->doc().body(), node, marker)) 352 407 if (node->isReimp()) … … 453 508 if (func->reimplementedFrom() != 0) 454 509 generateReimplementedFrom(func, marker); 455 #endif 510 #endif 456 511 } 457 512 } … … 545 600 files comprising the example, and the list of images used 546 601 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/...} 548 603 */ 549 604 void Generator::generateFileList(const FakeNode* fake, … … 641 696 } 642 697 #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::ParaLeft652 << 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::ParaLeft659 << 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 }670 698 671 699 QString Generator::indent(int level, const QString& markedCode) … … 954 982 NodeList::ConstIterator c = innerNode->childNodes().begin(); 955 983 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); 960 999 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 } 973 1004 } 974 1005 ++c; 975 1006 } 976 if (!exceptions) 1007 if (!exceptions) 977 1008 text << "."; 978 1009 else if (threadSafeness == Node::Reentrant) { … … 1041 1072 text << Atom::ParaLeft 1042 1073 << "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 "; 1045 1079 if (project.isEmpty()) 1046 1080 text << "version"; … … 1061 1095 << "This function overloads "; 1062 1096 QString t = node->name() + "()"; 1063 text << Atom::AutoLink << t 1097 text << Atom::AutoLink << t 1064 1098 << Atom::ParaRight; 1065 1099 generateText(text, node, marker); … … 1214 1248 } 1215 1249 1250 void 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 1216 1279 int Generator::skipAtoms(const Atom *atom, Atom::Type type) const 1217 1280 { -
trunk/tools/qdoc3/generator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 125 125 const QString& tag); 126 126 void generateExampleFiles(const FakeNode *fake, CodeMarker *marker); 127 void generateModuleWarning(const ClassNode *classe, CodeMarker *marker);128 127 129 128 virtual int skipAtoms(const Atom *atom, Atom::Type type) const; … … 171 170 CodeMarker *marker); 172 171 172 protected: 173 void appendSortedQmlNames(Text& text, 174 const Node* base, 175 const NodeList& subs, 176 CodeMarker *marker); 177 178 private: 173 179 QString amp; 174 180 QString lt; … … 186 192 static QStringList exampleDirs; 187 193 static QStringList exampleImgExts; 194 static QStringList scriptFiles; 195 static QStringList scriptDirs; 196 static QStringList styleFiles; 197 static QStringList styleDirs; 188 198 static QString outDir; 189 199 static QString project; -
trunk/tools/qdoc3/helpprojectwriter.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 40 40 ****************************************************************************/ 41 41 42 #include <QtXml>43 42 #include <QHash> 44 43 #include <QMap> 44 //#include <qdebug.h> 45 45 46 46 #include "atom.h" … … 50 50 #include "node.h" 51 51 #include "tree.h" 52 #include <qdebug.h> 52 53 53 54 QT_BEGIN_NAMESPACE … … 92 93 subproject.indexTitle = config.getString(subprefix + "indexTitle"); 93 94 subproject.sortPages = config.getBool(subprefix + "sortPages"); 95 subproject.type = config.getString(subprefix + "type"); 94 96 readSelectors(subproject, config.getStringList(subprefix + "selectors")); 95 97 project.subprojects[name] = subproject; … … 118 120 typeHash["variable"] = Node::Variable; 119 121 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 120 127 121 128 QHash<QString, Node::SubType> subTypeHash; … … 129 136 #ifdef QDOC_QML 130 137 subTypeHash["qmlclass"] = Node::QmlClass; 138 subTypeHash["qmlpropertygroup"] = Node::QmlPropertyGroup; 139 subTypeHash["qmlbasictype"] = Node::QmlBasicType; 131 140 #endif 132 141 … … 178 187 QStringList details; 179 188 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()) { 181 196 // "name" 182 197 if (node->type() == Node::Enum || node->type() == Node::Typedef) … … 186 201 // "id" 187 202 details << node->parent()->name()+"::"+node->name(); 188 } else if (node->type() == Node::Fake) { 203 } 204 else if (node->type() == Node::Fake) { 189 205 const FakeNode *fake = static_cast<const FakeNode *>(node); 190 #ifdef QDOC_QML191 206 if (fake->subType() == Node::QmlClass) { 192 207 details << (QmlClassNode::qmlOnly ? fake->name() : fake->fullTitle()); 193 208 details << "QML." + fake->name(); 194 } else 195 #endif 196 { 209 } 210 else { 197 211 details << fake->fullTitle(); 198 212 details << fake->fullTitle(); 199 213 } 200 } else { 214 } 215 else { 201 216 details << node->name(); 202 217 details << node->name(); 203 218 } 204 219 details << tree->fullDocumentLocation(node); 205 206 220 return details; 207 221 } 208 222 209 223 bool HelpProjectWriter::generateSection(HelpProject &project, 210 QXmlStreamWriter & /* writer */, const Node *node) 224 QXmlStreamWriter & /* writer */, 225 const Node *node) 211 226 { 212 227 if (!node->url().isEmpty()) … … 227 242 const FakeNode *fake = static_cast<const FakeNode *>(node); 228 243 objName = fake->fullTitle(); 229 } else 244 } 245 else 230 246 objName = tree->fullDocumentName(node); 231 247 232 248 // Only add nodes to the set for each subproject if they match a selector. 233 249 // Those that match will be listed in the table of contents. … … 236 252 SubProject subproject = project.subprojects[name]; 237 253 // No selectors: accept all nodes. 238 if (subproject.selectors.isEmpty()) 254 if (subproject.selectors.isEmpty()) { 239 255 project.subprojects[name].nodes[objName] = node; 256 } 240 257 else if (subproject.selectors.contains(node->type())) { 241 258 // Accept only the node types in the selectors hash. … … 248 265 if (subproject.selectors[node->type()].contains(fakeNode->subType()) && 249 266 fakeNode->subType() != Node::ExternalPage && 250 !fakeNode->fullTitle().isEmpty()) 267 !fakeNode->fullTitle().isEmpty()) { 251 268 252 269 project.subprojects[name].nodes[objName] = node; 270 } 253 271 } 254 272 } … … 291 309 292 310 case Node::Property: 311 case Node::QmlProperty: 312 case Node::QmlSignal: 313 case Node::QmlMethod: 293 314 project.keywords.append(keywordDetails(node)); 294 315 break; … … 401 422 if (!generateSection(project, writer, node)) 402 423 return; 403 424 404 425 if (node->isInnerNode()) { 405 426 const InnerNode *inner = static_cast<const InnerNode *>(node); … … 410 431 if (node->access() == Node::Private) 411 432 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 } 414 450 else { 415 451 if (node->type() == Node::Function) { … … 495 531 writer.writeAttribute("ref", href); 496 532 writer.writeAttribute("title", fakeNode->fullTitle()); 497 // qDebug() << "Title:" << fakeNode->fullTitle();498 533 499 if (fakeNode->subType() == Node::HeaderFile) { 500 534 if ((fakeNode->subType() == Node::HeaderFile) || (fakeNode->subType() == Node::QmlClass)) { 501 535 // Write subsections for all members, obsolete members and Qt 3 502 536 // members. 503 if (!project.memberStatus[node].isEmpty() ) {537 if (!project.memberStatus[node].isEmpty() || (fakeNode->subType() == Node::QmlClass)) { 504 538 QString membersPath = href.left(href.size()-5) + "-members.html"; 505 539 writer.writeStartElement("section"); … … 594 628 SubProject subproject = project.subprojects[name]; 595 629 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 608 682 } 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; 626 717 } 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 } 634 724 } 635 725 -
trunk/tools/qdoc3/helpprojectwriter.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 61 61 QHash<Node::Type, QSet<FakeNode::SubType> > selectors; 62 62 bool sortPages; 63 QString type; 63 64 QHash<QString, const Node *> nodes; 64 65 }; -
trunk/tools/qdoc3/htmlgenerator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 46 46 #include "codemarker.h" 47 #include "codeparser.h" 47 48 #include "helpprojectwriter.h" 48 49 #include "htmlgenerator.h" … … 55 56 #include <qlist.h> 56 57 #include <qiterator.h> 58 #include <qtextcodec.h> 57 59 58 60 QT_BEGIN_NAMESPACE 59 61 60 62 #define COMMAND_VERSION Doc::alias("version") 63 int HtmlGenerator::id = 0; 64 bool HtmlGenerator::debugging_on = false; 65 66 #if 0 67 QString HtmlGenerator::divNavTop = "<div class=\"navTop\"><a href=\"#toc\"><img src=\"./images/bullet_up.png\"></a></div>"; 68 #endif 69 70 QString HtmlGenerator::divNavTop = ""; 61 71 62 72 QString HtmlGenerator::sinceTitles[] = … … 72 82 " New Properties", 73 83 " New Variables", 84 " New QML Elements", 74 85 " New Qml Properties", 75 86 " New Qml Signals", … … 202 213 203 214 HtmlGenerator::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) 208 227 { 209 228 } … … 249 268 Config::dot + 250 269 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); 251 279 footer = config.getString(HtmlGenerator::format() + 252 280 Config::dot + … … 261 289 project = config.getString(CONFIG_PROJECT); 262 290 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 263 299 projectDescription = config.getString(CONFIG_DESCRIPTION); 264 300 if (projectDescription.isEmpty() && !project.isEmpty()) … … 266 302 267 303 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"); 268 313 269 314 QSet<QString> editionNames = config.subVars(CONFIG_EDITION); … … 322 367 void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) 323 368 { 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 334 369 myTree = tree; 335 370 nonCompatClasses.clear(); … … 342 377 legaleseTexts.clear(); 343 378 serviceClasses.clear(); 379 qmlClasses.clear(); 344 380 findAllClasses(tree->root()); 345 381 findAllFunctions(tree->root()); 346 382 findAllLegaleseTexts(tree->root()); 347 383 findAllNamespaces(tree->root()); 348 #ifdef ZZZ_QDOC_QML349 findAllQmlClasses(tree->root());350 #endif351 384 findAllSince(tree->root()); 352 385 … … 390 423 dcfQmakeRoot); 391 424 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); 395 428 396 429 helpProjectWriter->generate(myTree); … … 410 443 } 411 444 445 /*! 446 Generate html from an instance of Atom. 447 */ 412 448 int HtmlGenerator::generateAtom(const Atom *atom, 413 449 const Node *relative, … … 432 468 } 433 469 else { 434 out() << protect (atom->string());470 out() << protectEnc(atom->string()); 435 471 } 436 472 } 437 473 else { 438 out() << protect (atom->string());474 out() << protectEnc(atom->string()); 439 475 } 440 476 break; … … 484 520 out() << formattingLeftMap()[ATOM_FORMATTING_TELETYPE]; 485 521 if (inLink) { 486 out() << protect (plainCode(atom->string()));522 out() << protectEnc(plainCode(atom->string())); 487 523 } 488 524 else { … … 492 528 break; 493 529 case Atom::Code: 494 out() << "<pre>"530 out() << "<pre class=\"highlightedCode brush: cpp\">" 495 531 << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), 496 532 marker,relative)) 497 533 << "</pre>\n"; 498 534 break; 499 535 #ifdef QDOC_QML 500 536 case Atom::Qml: 501 out() << "<pre>"537 out() << "<pre class=\"highlightedCode brush: cpp\">" 502 538 << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), 503 539 marker,relative)) 504 540 << "</pre>\n"; 505 541 break; 506 542 #endif 507 543 case Atom::CodeNew: 508 544 out() << "<p>you can rewrite it as</p>\n" 509 << "<pre >"545 << "<pre class=\"highlightedCode brush: cpp\">" 510 546 << trimmedTrailing(highlightedCode(indent(codeIndent,atom->string()), 511 547 marker,relative)) … … 516 552 // fallthrough 517 553 case Atom::CodeBad: 518 out() << "<pre ><font color=\"#404040\">"519 << trimmedTrailing(protect (plainCode(indent(codeIndent,atom->string()))))520 << "</ font></pre>\n";521 554 out() << "<pre class=\"highlightedCode brush: cpp\">" 555 << trimmedTrailing(protectEnc(plainCode(indent(codeIndent,atom->string())))) 556 << "</pre>\n"; 557 break; 522 558 case Atom::FootnoteLeft: 523 559 // ### For now … … 575 611 } 576 612 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); 578 617 } 579 618 else if (atom->string().contains("classesbymodule")) { … … 623 662 } 624 663 else if (atom->string() == "compatclasses") { 625 generateCompactList(relative, marker, compatClasses );664 generateCompactList(relative, marker, compatClasses, false); 626 665 } 627 666 else if (atom->string() == "obsoleteclasses") { 628 generateCompactList(relative, marker, obsoleteClasses );667 generateCompactList(relative, marker, obsoleteClasses, false); 629 668 } 630 669 else if (atom->string() == "functionindex") { … … 635 674 } 636 675 else if (atom->string() == "mainclasses") { 637 generateCompactList(relative, marker, mainClasses );676 generateCompactList(relative, marker, mainClasses, true); 638 677 } 639 678 else if (atom->string() == "services") { 640 generateCompactList(relative, marker, serviceClasses );679 generateCompactList(relative, marker, serviceClasses, false); 641 680 } 642 681 else if (atom->string() == "overviews") { … … 677 716 NewClassMaps::const_iterator ncmap; 678 717 ncmap = newClassMaps.find(atom->string()); 718 NewClassMaps::const_iterator nqcmap; 719 nqcmap = newQmlClassMaps.find(atom->string()); 679 720 if ((nsmap != newSinceMaps.constEnd()) && !nsmap.value().isEmpty()) { 680 721 QList<Section> sections; 681 722 QList<Section>::ConstIterator s; 682 723 for (int i=0; i<LastSinceType; ++i) 683 sections.append(Section(sinceTitle(i),QString(),QString() ));724 sections.append(Section(sinceTitle(i),QString(),QString(),QString())); 684 725 685 726 NodeMultiMap::const_iterator n = nsmap.value().constBegin(); … … 687 728 const Node* node = n.value(); 688 729 switch (node->type()) { 730 case Node::Fake: 731 if (node->subType() == Node::QmlClass) { 732 sections[QmlClass].appendMember((Node*)node); 733 } 734 break; 689 735 case Node::Namespace: 690 736 sections[Namespace].appendMember((Node*)node); … … 769 815 << Doc::canonicalTitle((*s).name) 770 816 << "\"></a>\n"; 771 out() << "<h3>" << protect ((*s).name) << "</h3>\n";817 out() << "<h3>" << protectEnc((*s).name) << "</h3>\n"; 772 818 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")); 774 822 else if (idx == MemberFunction) { 775 823 ParentMaps parentmaps; … … 793 841 << "\">"; 794 842 QStringList pieces = fullName(pmap.key(), 0, marker).split("::"); 795 out() << protect (pieces.last());843 out() << protectEnc(pieces.last()); 796 844 out() << "</a>" << ":</p>\n"; 797 845 798 846 generateSection(nlist, 0, marker, CodeMarker::Summary); 799 out() << "<br 847 out() << "<br/>"; 800 848 ++pmap; 801 849 } … … 818 866 text = atom->next()->string(); 819 867 if (atom->type() == Atom::Image) 820 out() << "<p align=\"center\">";868 out() << "<p class=\"centerAlign\">"; 821 869 if (fileName.isEmpty()) { 822 870 out() << "<font color=\"red\">[Missing image " 823 << protect (atom->string()) << "]</font>";871 << protectEnc(atom->string()) << "]</font>"; 824 872 } 825 873 else { 826 out() << "<img src=\"" << protect (fileName) << "\"";874 out() << "<img src=\"" << protectEnc(fileName) << "\""; 827 875 if (!text.isEmpty()) 828 out() << " alt=\"" << protect (text) << "\"";876 out() << " alt=\"" << protectEnc(text) << "\""; 829 877 out() << " />"; 830 878 helpProjectWriter->addExtraFile(fileName); … … 837 885 break; 838 886 case Atom::LegaleseLeft: 839 out() << "<div style=\"padding: 0.5em; background: #e0e0e0; color: black\">";887 out() << "<div class=\"LegaleseLeft\">"; 840 888 break; 841 889 case Atom::LegaleseRight: … … 843 891 break; 844 892 case Atom::LineBreak: 845 out() << "<br 893 out() << "<br/>"; 846 894 break; 847 895 case Atom::Link: … … 879 927 threeColumnEnumValueTable = isThreeColumnEnumValueTable(atom); 880 928 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"; 886 938 } 887 939 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"; 892 942 } 893 943 } 894 944 else { 895 out() << "<ol type=";945 out() << "<ol class="; 896 946 if (atom->string() == ATOM_LIST_UPPERALPHA) { 897 947 out() << "\"A\""; 898 } 948 } /* why type? changed to */ 899 949 else if (atom->string() == ATOM_LIST_LOWERALPHA) { 900 950 out() << "\"a\""; … … 923 973 // ### Trenton 924 974 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(), 927 977 relative))) 928 << "</tt></td><td align=\"center\" valign=\"top\">";978 << "</tt></td><td class=\" topAlign\">"; 929 979 930 980 QString itemValue; … … 937 987 out() << "?"; 938 988 else 939 out() << "<tt>" << protect (itemValue) << "</tt>";989 out() << "<tt>" << protectEnc(itemValue) << "</tt>"; 940 990 941 991 skipAhead = 1; … … 952 1002 else if (atom->string() == ATOM_LIST_VALUE) { 953 1003 if (threeColumnEnumValueTable) { 954 out() << "</td><td valign=\"top\">";1004 out() << "</td><td class=\"topAlign\">"; 955 1005 if (matchAhead(atom, Atom::ListItemRight)) 956 1006 out() << " "; … … 982 1032 } 983 1033 else if (atom->string() == ATOM_LIST_VALUE) { 984 out() << "</table> </p>\n";1034 out() << "</table>\n"; 985 1035 } 986 1036 else { … … 1027 1077 sectionNumber.last() = QString::number(sectionNumber.last().toInt() + 1); 1028 1078 } 1029 out() << "<a name=\"sec-" << sectionNumber.join("-") << "\"></a> \n";1079 out() << "<a name=\"sec-" << sectionNumber.join("-") << "\"></a>" << divNavTop << "\n"; 1030 1080 } 1031 1081 #else 1032 1082 out() << "<a name=\"" << Doc::canonicalTitle(Text::sectionHeading(atom).toString()) 1033 << "\"></a> \n";1083 << "\"></a>" << divNavTop << "\n"; 1034 1084 #endif 1035 1085 break; … … 1053 1103 } 1054 1104 else { 1055 out() << protect (atom->string());1105 out() << protectEnc(atom->string()); 1056 1106 } 1057 1107 break; … … 1063 1113 if (!atom->string().isEmpty()) { 1064 1114 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 "; 1068 1116 else { 1069 out() << "<p><table class=\"generic\" align=\"center\" cellpadding=\"2\" " 1070 << "cellspacing=\"1\" border=\"0\">\n"; 1117 out() << "<table class=\"generic\">\n"; 1071 1118 } 1072 1119 } 1073 1120 else { 1074 out() << "<p><table class=\"generic\" align=\"center\" cellpadding=\"2\" " 1075 << "cellspacing=\"1\" border=\"0\">\n"; 1121 out() << "<table class=\"generic\">\n"; 1076 1122 } 1077 1123 numTableRows = 0; 1078 1124 break; 1079 1125 case Atom::TableRight: 1080 out() << "</table> </p>\n";1126 out() << "</table>\n"; 1081 1127 break; 1082 1128 case Atom::TableHeaderLeft: 1083 out() << "<thead><tr valign=\"top\" class=\"qt-style\">";1129 out() << "<thead><tr class=\"qt-style topAlign\">"; 1084 1130 inTableHeader = true; 1085 1131 break; … … 1088 1134 if (matchAhead(atom, Atom::TableHeaderLeft)) { 1089 1135 skipAhead = 1; 1090 out() << "\n<tr valign=\"top\" class=\"qt-style\">";1136 out() << "\n<tr class=\"qt-style topAlign\">"; 1091 1137 } 1092 1138 else { … … 1097 1143 case Atom::TableRowLeft: 1098 1144 if (++numTableRows % 2 == 1) 1099 out() << "<tr valign=\"top\" class=\"odd\">";1145 out() << "<tr class=\"odd topAlign\">"; 1100 1146 else 1101 out() << "<tr valign=\"top\" class=\"even\">";1147 out() << "<tr class=\"even topAlign\">"; 1102 1148 break; 1103 1149 case Atom::TableRowRight: … … 1107 1153 { 1108 1154 if (inTableHeader) 1109 out() << "<th ";1155 out() << "<th "; 1110 1156 else 1111 out() << "<td ";1157 out() << "<td "; 1112 1158 1113 1159 QStringList spans = atom->string().split(","); … … 1117 1163 if (spans.at(1) != "1") 1118 1164 out() << " rowspan=\"" << spans.at(1) << "\""; 1165 if (inTableHeader) 1119 1166 out() << ">"; 1167 else 1168 out() << "><p>"; 1120 1169 } 1121 1170 if (matchAhead(atom, Atom::ParaLeft)) … … 1127 1176 out() << "</th>"; 1128 1177 else 1129 out() << "</ td>";1178 out() << "</p></td>"; 1130 1179 if (matchAhead(atom, Atom::ParaLeft)) 1131 1180 skipAhead = 1; … … 1164 1213 break; 1165 1214 case Atom::UnhandledFormat: 1166 out() << "< font color=\"red\"><b><Missing HTML></b></font>";1215 out() << "<b class=\"redFont\"><Missing HTML></b>"; 1167 1216 break; 1168 1217 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>"; 1171 1220 break; 1172 1221 #ifdef QDOC_QML … … 1182 1231 } 1183 1232 1233 /*! 1234 Generate a reference page for a C++ class. 1235 */ 1184 1236 void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, 1185 1237 CodeMarker *marker) … … 1198 1250 rawTitle = marker->plainName(inner); 1199 1251 fullTitle = marker->plainFullName(inner); 1200 title = rawTitle + " Namespace Reference";1252 title = rawTitle + " Namespace"; 1201 1253 } 1202 1254 else if (inner->type() == Node::Class) { … … 1217 1269 << Atom(Atom::LineBreak); 1218 1270 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,§ions); 1274 generateTitle(title, subtitleText, SmallSubTitle, inner, marker); 1249 1275 generateBrief(inner, marker); 1250 1276 generateIncludes(inner, marker); 1251 1277 generateStatus(inner, marker); 1252 1278 if (classe) { 1253 generateModuleWarning(classe, marker);1254 1279 generateInherits(classe, marker); 1255 1280 generateInheritedBy(classe, marker); 1281 #ifdef QDOC_QML 1282 if (!classe->qmlElement().isEmpty()) { 1283 generateInstantiatedBy(classe,marker); 1284 } 1285 #endif 1256 1286 } 1257 1287 generateThreadSafeness(inner, marker); … … 1283 1313 bool needOtherSection = false; 1284 1314 1285 sections = marker->sections(inner, CodeMarker::Summary, CodeMarker::Okay); 1315 /* 1316 sections is built above for the call to generateTableOfContents(). 1317 */ 1286 1318 s = sections.begin(); 1287 1319 while (s != sections.end()) { … … 1292 1324 else { 1293 1325 if (!s->members.isEmpty()) { 1294 out() << "<hr />\n";1326 // out() << "<hr />\n"; 1295 1327 out() << "<a name=\"" 1296 1328 << 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"; 1299 1331 generateSection(s->members, inner, marker, CodeMarker::Summary); 1300 1332 } 1301 1333 if (!s->reimpMembers.isEmpty()) { 1302 1334 QString name = QString("Reimplemented ") + (*s).name; 1303 out() << "<hr />\n";1335 // out() << "<hr />\n"; 1304 1336 out() << "<a name=\"" 1305 1337 << registerRef(name.toLower()) 1306 << "\"></a> \n";1307 out() << "<h2>" << protect (name) << "</h2>\n";1338 << "\"></a>" << divNavTop << "\n"; 1339 out() << "<h2>" << protectEnc(name) << "</h2>\n"; 1308 1340 generateSection(s->reimpMembers, inner, marker, CodeMarker::Summary); 1309 1341 } … … 1311 1343 if (!s->inherited.isEmpty()) { 1312 1344 out() << "<ul>\n"; 1313 generateSectionInheritedList(*s, inner, marker , true);1345 generateSectionInheritedList(*s, inner, marker); 1314 1346 out() << "</ul>\n"; 1315 1347 } … … 1331 1363 } 1332 1364 1333 out() << "<a name=\"" << registerRef("details") << "\"></a> \n";1365 out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << "\n"; 1334 1366 1335 1367 if (!inner->doc().isEmpty()) { 1336 out() << "<hr />\n" 1368 generateExtractionMark(inner, DetailedDescriptionMark); 1369 //out() << "<hr />\n" 1370 out() << "<div class=\"descr\">\n" // QTBUG-9504 1337 1371 << "<h2>" << "Detailed Description" << "</h2>\n"; 1338 1372 generateBody(inner, marker); 1373 out() << "</div>\n"; // QTBUG-9504 1339 1374 generateAlsoList(inner, marker); 1375 generateExtractionMark(inner, EndMark); 1340 1376 } 1341 1377 … … 1343 1379 s = sections.begin(); 1344 1380 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"; 1347 1385 1348 1386 NodeList::ConstIterator m = (*s).members.begin(); … … 1393 1431 ++m; 1394 1432 } 1433 if (!(*s).divClass.isEmpty()) 1434 out() << "</div>\n"; // QTBUG-9504 1395 1435 ++s; 1396 1436 } … … 1419 1459 } 1420 1460 1461 /*! 1462 Generate the html page for a qdoc file that doesn't map 1463 to an underlying c++ file. 1464 */ 1421 1465 void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) 1422 1466 { … … 1429 1473 QList<Section>::const_iterator s; 1430 1474 1431 QString htmlTitle = fake->fullTitle(); 1475 QString fullTitle = fake->fullTitle(); 1476 QString htmlTitle = fullTitle; 1432 1477 if (fake->subType() == Node::File && !fake->subTitle().isEmpty()) { 1433 1478 subTitleSize = SmallSubTitle; 1434 1479 htmlTitle += " (" + fake->subTitle() + ")"; 1435 1480 } 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,§ions); 1497 } 1498 else if (fake->name() != QString("index.html")) 1499 generateTableOfContents(fake,marker,0); 1500 1501 generateTitle(fullTitle, 1439 1502 Text() << fake->subTitle(), 1440 1503 subTitleSize, … … 1448 1511 1449 1512 if (moduleNamespaceMap.contains(fake->name())) { 1513 out() << "<a name=\"" << registerRef("namespaces") << "\"></a>" << divNavTop << "\n"; 1450 1514 out() << "<h2>Namespaces</h2>\n"; 1451 1515 generateAnnotatedList(fake, marker, moduleNamespaceMap[fake->name()]); 1452 1516 } 1453 1517 if (moduleClassMap.contains(fake->name())) { 1518 out() << "<a name=\"" << registerRef("classes") << "\"></a>" << divNavTop << "\n"; 1454 1519 out() << "<h2>Classes</h2>\n"; 1455 1520 generateAnnotatedList(fake, marker, moduleClassMap[fake->name()]); … … 1505 1570 #ifdef QDOC_QML 1506 1571 else if (fake->subType() == Node::QmlClass) { 1507 const QmlClassNode* qml_cn = static_cast<const QmlClassNode*>(fake);1508 1572 const ClassNode* cn = qml_cn->classNode(); 1573 generateBrief(qml_cn, marker); 1509 1574 generateQmlInherits(qml_cn, marker); 1575 generateQmlInheritedBy(qml_cn, marker); 1510 1576 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 1513 1584 s = sections.begin(); 1514 1585 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"; 1517 1589 generateQmlSummary(*s,fake,marker); 1518 1590 ++s; 1519 1591 } 1520 1592 1521 out() << "<a name=\"" << registerRef("details") << "\"></a>\n"; 1593 generateExtractionMark(fake, DetailedDescriptionMark); 1594 out() << "<a name=\"" << registerRef("details") << "\"></a>" << divNavTop << "\n"; 1522 1595 out() << "<h2>" << "Detailed Description" << "</h2>\n"; 1523 1596 generateBody(fake, marker); … … 1525 1598 generateQmlText(cn->doc().body(), cn, marker, fake->name()); 1526 1599 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); 1530 1604 s = sections.begin(); 1531 1605 while (s != sections.end()) { 1532 out() << "<h2>" << protect ((*s).name) << "</h2>\n";1606 out() << "<h2>" << protectEnc((*s).name) << "</h2>\n"; 1533 1607 NodeList::ConstIterator m = (*s).members.begin(); 1534 1608 while (m != (*s).members.end()) { 1535 1609 generateDetailedQmlMember(*m, fake, marker); 1536 out() << "<br 1610 out() << "<br/>\n"; 1537 1611 fakeSection.keywords += qMakePair((*m)->name(), 1538 1612 linkForNode(*m,0)); … … 1549 1623 s = sections.begin(); 1550 1624 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"; 1553 1627 generateSectionList(*s, fake, marker, CodeMarker::Summary); 1554 1628 ++s; … … 1557 1631 Text brief = fake->doc().briefText(); 1558 1632 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 1560 1636 out() << "<h2>" << "Detailed Description" << "</h2>\n"; 1561 1637 } 1638 else { 1639 generateExtractionMark(fake, DetailedDescriptionMark); 1640 out() << "<div class=\"descr\"> <a name=\"" << registerRef("details") << "\"></a>\n"; // QTBUG-9504 1641 } 1562 1642 1563 1643 generateBody(fake, marker); 1644 out() << "</div>\n"; // QTBUG-9504 1564 1645 generateAlsoList(fake, marker); 1646 generateExtractionMark(fake, EndMark); 1565 1647 1566 1648 if (!fake->groupMembers().isEmpty()) { … … 1578 1660 s = sections.begin(); 1579 1661 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"; 1582 1664 1583 1665 NodeList::ConstIterator m = (*s).members.begin(); … … 1615 1697 } 1616 1698 1617 QString HtmlGenerator::fileExtension(const Node * /* node */) 1699 /*! 1700 Returns "html" for this subclass of Generator. 1701 */ 1702 QString HtmlGenerator::fileExtension(const Node * /* node */) const 1618 1703 { 1619 1704 return "html"; 1705 } 1706 1707 /*! 1708 Output breadcrumb list in the html file. 1709 */ 1710 void 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 & 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 & 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 } 1620 1779 } 1621 1780 1622 1781 void HtmlGenerator::generateHeader(const QString& title, 1623 1782 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"; 1633 1790 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(); 1666 1878 1667 1879 if (node && !node->links().empty()) { … … 1688 1900 navigationLinks += "</a>]\n"; 1689 1901 } 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 else1696 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 else1705 navigationLinks += protect(linkPair.second);1706 navigationLinks += "</a>]\n";1707 }1708 1902 if (node->links().contains(Node::NextLink)) { 1709 1903 linkPair = node->links()[Node::NextLink]; … … 1723 1917 navigationLinks += protect(linkPair.second); 1724 1918 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 else1732 anchorPair = anchorForNode(linkNode);1733 out() << " <link rel=\"index\" href=\""1734 << anchorPair.first << "\" />\n";1735 1919 } 1736 1920 if (node->links().contains(Node::StartLink)) { … … 1746 1930 } 1747 1931 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 1764 1932 if (node && !node->links().empty()) 1765 out() << "<p >\n" << navigationLinks << "</p>\n";1933 out() << "<p class=\"naviNextPrevious headerNavi\">\n" << navigationLinks << "</p><p/>\n"; 1766 1934 } 1767 1935 … … 1772 1940 CodeMarker *marker) 1773 1941 { 1774 out() << "<h1 class=\"title\">" << protect(title); 1942 if (!title.isEmpty()) 1943 out() << "<h1 class=\"title\">" << protectEnc(title) << "</h1>\n"; 1775 1944 if (!subTitle.isEmpty()) { 1776 out() << "< br />";1945 out() << "<span"; 1777 1946 if (subTitleSize == SmallSubTitle) 1778 out() << " <spanclass=\"small-subtitle\">";1947 out() << " class=\"small-subtitle\">"; 1779 1948 else 1780 out() << " <spanclass=\"subtitle\">";1949 out() << " class=\"subtitle\">"; 1781 1950 generateText(subTitle, relative, marker); 1782 1951 out() << "</span>\n"; 1783 1952 } 1784 out() << "</h1>\n";1785 1953 } 1786 1954 … … 1788 1956 { 1789 1957 if (node && !node->links().empty()) 1790 out() << "<p >\n" << navigationLinks << "</p>\n";1958 out() << "<p class=\"naviNextPrevious footerNavi\">\n" << navigationLinks << "</p>\n"; 1791 1959 1792 1960 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"; 1796 1987 } 1797 1988 … … 1801 1992 Text brief = node->doc().briefText(); 1802 1993 if (!brief.isEmpty()) { 1994 generateExtractionMark(node, BriefMark); 1803 1995 out() << "<p>"; 1804 1996 generateText(brief, node, marker); 1997 1805 1998 if (!relative || node == relative) 1806 1999 out() << " <a href=\"#"; … … 1808 2001 out() << " <a href=\"" << linkForNode(node, relative) << "#"; 1809 2002 out() << registerRef("details") << "\">More...</a></p>\n"; 2003 2004 2005 generateExtractionMark(node, EndMark); 1810 2006 } 1811 2007 } … … 1814 2010 { 1815 2011 if (!inner->includes().isEmpty()) { 1816 out() << "<pre >"2012 out() << "<pre class=\"highlightedCode brush: cpp\">" 1817 2013 << trimmedTrailing(highlightedCode(indent(codeIndent, 1818 2014 marker->markedUpIncludes(inner->includes())), … … 1822 2018 } 1823 2019 2020 /*! 2021 Generates a table of contents beginning at \a node. 2022 */ 1824 2023 void HtmlGenerator::generateTableOfContents(const Node *node, 1825 2024 CodeMarker *marker, … … 1829 2028 1830 2029 { 2030 return; 1831 2031 if (!node->doc().hasTableOfContents()) 1832 2032 return; … … 1844 2044 QString tdTag; 1845 2045 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\">" 1848 2048 << tdTag << "\n"; 1849 2049 } … … 1897 2097 1898 2098 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 */ 2109 void 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"; 1901 2218 inContents = false; 1902 2219 inLink = false; … … 1910 2227 if (bar.prev.begin() != 0 || bar.current.begin() != 0 || 1911 2228 bar.next.begin() != 0) { 1912 out() << "<p align=\"right\">";2229 out() << "<p class=\"rightAlign\">"; 1913 2230 if (bar.prev.begin() != 0) { 1914 2231 #if 0 … … 1919 2236 #endif 1920 2237 } 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 } 1932 2251 } 1933 2252 } … … 1949 2268 beginSubPage(inner->location(), fileName); 1950 2269 QString title = "List of All Members for " + inner->name(); 1951 generateHeader(title, inner, marker , false);2270 generateHeader(title, inner, marker); 1952 2271 generateTitle(title, Text(), SmallSubTitle, inner, marker); 1953 2272 out() << "<p>This is the complete list of members for "; 1954 2273 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 */ 2289 QString 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); 1955 2306 out() << ", including inherited members.</p>\n"; 1956 2307 … … 1993 2344 1994 2345 beginSubPage(inner->location(), fileName); 1995 generateHeader(title, inner, marker , false);2346 generateHeader(title, inner, marker); 1996 2347 generateTitle(title, Text(), SmallSubTitle, inner, marker); 1997 2348 … … 2010 2361 out() << "<p><ul><li><a href=\"" 2011 2362 << linkForNode(inner, 0) << "\">" 2012 << protect (inner->name())2363 << protectEnc(inner->name()) 2013 2364 << " class reference</a></li></ul></p>\n"; 2014 2365 2015 2366 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"; 2017 2368 generateSectionList(sections.at(i), inner, marker, CodeMarker::Summary); 2018 2369 } … … 2020 2371 sections = marker->sections(inner, CodeMarker::Detailed, status); 2021 2372 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"; 2024 2375 2025 2376 NodeList::ConstIterator m = sections.at(i).members.begin(); … … 2086 2437 const NodeMap &nodeMap) 2087 2438 { 2088 out() << "<p><table width=\"100%\" class=\"annotated\" cellpadding=\"2\" " 2089 << "cellspacing=\"1\" border=\"0\">\n"; 2439 out() << "<table class=\"annotated\">\n"; 2090 2440 2091 2441 int row = 0; … … 2097 2447 2098 2448 if (++row % 2 == 1) 2099 out() << "<tr valign=\"top\" class=\"odd\">";2449 out() << "<tr class=\"odd topAlign\">"; 2100 2450 else 2101 out() << "<tr valign=\"top\" class=\"even\">";2102 out() << "<t h>";2451 out() << "<tr class=\"even topAlign\">"; 2452 out() << "<td class=\"tblName\"><p>"; 2103 2453 generateFullName(node, relative, marker); 2104 out() << "</ th>";2454 out() << "</p></td>"; 2105 2455 2106 2456 if (!(node->type() == Node::Fake)) { 2107 2457 Text brief = node->doc().trimmedBriefText(name); 2108 2458 if (!brief.isEmpty()) { 2109 out() << "<td >";2459 out() << "<td class=\"tblDescr\"><p>"; 2110 2460 generateText(brief, node, marker); 2111 out() << "</ td>";2461 out() << "</p></td>"; 2112 2462 } 2113 2463 } 2114 2464 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>"; 2118 2468 } 2119 2469 out() << "</tr>\n"; 2120 2470 } 2121 out() << "</table> </p>\n";2471 out() << "</table>\n"; 2122 2472 } 2123 2473 … … 2134 2484 CodeMarker *marker, 2135 2485 const NodeMap &classMap, 2486 bool includeAlphabet, 2136 2487 QString commonPrefix) 2137 2488 { 2138 2489 const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' 2139 const int NumColumns = 4; // number of columns in the result2140 2490 2141 2491 if (classMap.isEmpty()) … … 2206 2556 NodeMap paragraph[NumParagraphs+1]; 2207 2557 QString paragraphName[NumParagraphs+1]; 2558 QSet<char> usedParagraphNames; 2208 2559 2209 2560 NodeMap::ConstIterator c = classMap.begin(); … … 2219 2570 key = pieces.last().toLower(); 2220 2571 2221 int paragraphN o= NumParagraphs - 1;2572 int paragraphNr = NumParagraphs - 1; 2222 2573 2223 2574 if (key[0].digitValue() != -1) { 2224 paragraphN o= key[0].digitValue();2575 paragraphNr = key[0].digitValue(); 2225 2576 } 2226 2577 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()); 2232 2584 ++c; 2233 2585 } … … 2242 2594 */ 2243 2595 int paragraphOffset[NumParagraphs + 1]; // 37 + 1 2244 int i, j, k;2245 2246 2596 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 << " </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> ").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"; 2335 2684 } 2336 2685 … … 2338 2687 CodeMarker *marker) 2339 2688 { 2340 out() << "<p align=\"center\"><font size=\"+1\"><b>";2689 out() << "<p class=\"centerAlign functionIndex\"><b>"; 2341 2690 for (int i = 0; i < 26; i++) { 2342 2691 QChar ch('a' + i); 2343 2692 out() << QString("<a href=\"#%1\">%2</a> ").arg(ch).arg(ch.toUpper()); 2344 2693 } 2345 out() << "</b></ font></p>\n";2694 out() << "</b></p>\n"; 2346 2695 2347 2696 char nextLetter = 'a'; … … 2358 2707 out() << "<p>"; 2359 2708 #endif 2360 out() << protect (f.key()) << ":";2709 out() << protectEnc(f.key()) << ":"; 2361 2710 2362 2711 currentLetter = f.key()[0].unicode(); … … 2391 2740 while (it != legaleseTexts.end()) { 2392 2741 Text text = it.key(); 2393 out() << "<hr />\n";2742 //out() << "<hr />\n"; 2394 2743 generateText(text, relative, marker); 2395 2744 out() << "<ul>\n"; … … 2404 2753 } 2405 2754 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>", " <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 2444 2755 #ifdef QDOC_QML 2445 2756 void HtmlGenerator::generateQmlItem(const Node *node, … … 2451 2762 QRegExp templateTag("(<[^@>]*>)"); 2452 2763 if (marked.indexOf(templateTag) != -1) { 2453 QString contents = protect (marked.mid(templateTag.pos(1),2764 QString contents = protectEnc(marked.mid(templateTag.pos(1), 2454 2765 templateTag.cap(1).length())); 2455 2766 marked.replace(templateTag.pos(1), templateTag.cap(1).length(), … … 2464 2775 marked.replace("@name>", "b>"); 2465 2776 2466 marked.replace("<@extra>", " <tt>");2777 marked.replace("<@extra>", "<tt>"); 2467 2778 marked.replace("</@extra>", "</tt>"); 2468 2779 … … 2471 2782 marked.replace("</@type>", ""); 2472 2783 } 2473 out() << highlightedCode(marked, marker, relative );2784 out() << highlightedCode(marked, marker, relative, false, node); 2474 2785 } 2475 2786 #endif … … 2557 2868 out() << QString("<h3><a href=\"%1\">%2</a></h3>\n").arg( 2558 2869 linkForNode(groupNode, relative)).arg( 2559 protect (groupNode->fullTitle()));2870 protectEnc(groupNode->fullTitle())); 2560 2871 2561 2872 if (fakeNodeMap[groupNode].count() == 0) … … 2569 2880 title.remove(0, 4); 2570 2881 out() << "<li><a href=\"" << linkForNode(fakeNode, relative) << "\">" 2571 << protect (title) << "</a></li>\n";2882 << protectEnc(title) << "</a></li>\n"; 2572 2883 } 2573 2884 out() << "</ul>\n"; … … 2583 2894 title.remove(0, 4); 2584 2895 out() << "<li><a href=\"" << linkForNode(fakeNode, relative) << "\">" 2585 << protect (title) << "</a></li>\n";2896 << protectEnc(title) << "</a></li>\n"; 2586 2897 } 2587 2898 out() << "</ul>\n"; … … 2589 2900 } 2590 2901 2591 #ifdef QDOC_NAME_ALIGNMENT2592 2902 void HtmlGenerator::generateSection(const NodeList& nl, 2593 2903 const Node *relative, … … 2595 2905 CodeMarker::SynopsisStyle style) 2596 2906 { 2597 bool name_alignment= true;2907 bool alignNames = true; 2598 2908 if (!nl.isEmpty()) { 2599 2909 bool twoColumn = false; 2600 2910 if (style == CodeMarker::SeparateList) { 2601 name_alignment= false;2911 alignNames = false; 2602 2912 twoColumn = (nl.count() >= 16); 2603 2913 } 2604 2914 else if (nl.first()->type() == Node::Property) { 2605 2915 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"; 2611 2920 } 2612 2921 else { 2613 2922 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\">"; 2618 2925 out() << "<ul>\n"; 2619 2926 } … … 2627 2934 } 2628 2935 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\"> "; 2632 2938 } 2633 2939 else { 2634 2940 if (twoColumn && i == (int) (nl.count() + 1) / 2) 2635 out() << "</ul></td><td valign=\"top\"><ul>\n";2636 out() << "<li ><divclass=\"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) 2641 2947 out() << "</td></tr>\n"; 2642 2948 else 2643 out() << "</ div></li>\n";2949 out() << "</li>\n"; 2644 2950 i++; 2645 2951 ++m; 2646 2952 } 2647 if ( name_alignment)2953 if (alignNames) 2648 2954 out() << "</table>\n"; 2649 2955 else { 2650 2956 out() << "</ul>\n"; 2651 2957 if (twoColumn) 2652 out() << "</td></tr>\n</table> </p>\n";2958 out() << "</td></tr>\n</table>\n"; 2653 2959 } 2654 2960 } … … 2660 2966 CodeMarker::SynopsisStyle style) 2661 2967 { 2662 bool name_alignment= true;2968 bool alignNames = true; 2663 2969 if (!section.members.isEmpty()) { 2664 2970 bool twoColumn = false; 2665 2971 if (style == CodeMarker::SeparateList) { 2666 name_alignment= false;2972 alignNames = false; 2667 2973 twoColumn = (section.members.count() >= 16); 2668 2974 } 2669 2975 else if (section.members.first()->type() == Node::Property) { 2670 2976 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"; 2676 2981 } 2677 2982 else { 2678 2983 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\">"; 2683 2986 out() << "<ul>\n"; 2684 2987 } … … 2692 2995 } 2693 2996 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\"> "; 2697 2999 } 2698 3000 else { 2699 3001 if (twoColumn && i == (int) (section.members.count() + 1) / 2) 2700 out() << "</ul></td><td valign=\"top\"><ul>\n";2701 out() << "<li ><divclass=\"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) 2706 3008 out() << "</td></tr>\n"; 2707 3009 else 2708 out() << "</ div></li>\n";3010 out() << "</li>\n"; 2709 3011 i++; 2710 3012 ++m; 2711 3013 } 2712 if ( name_alignment)3014 if (alignNames) 2713 3015 out() << "</table>\n"; 2714 3016 else { 2715 3017 out() << "</ul>\n"; 2716 3018 if (twoColumn) 2717 out() << "</td></tr>\n</table> </p>\n";3019 out() << "</td></tr>\n</table>\n"; 2718 3020 } 2719 3021 } … … 2721 3023 if (style == CodeMarker::Summary && !section.inherited.isEmpty()) { 2722 3024 out() << "<ul>\n"; 2723 generateSectionInheritedList(section, relative, marker , name_alignment);3025 generateSectionInheritedList(section, relative, marker); 2724 3026 out() << "</ul>\n"; 2725 3027 } … … 2728 3030 void HtmlGenerator::generateSectionInheritedList(const Section& section, 2729 3031 const Node *relative, 2730 CodeMarker *marker, 2731 bool nameAlignment) 3032 CodeMarker *marker) 2732 3033 { 2733 3034 QList<QPair<ClassNode *, int> >::ConstIterator p = section.inherited.begin(); 2734 3035 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\">"; 2739 3037 out() << (*p).second << " "; 2740 3038 if ((*p).second == 1) { … … 2746 3044 out() << " inherited from <a href=\"" << fileName((*p).first) 2747 3045 << "#" << HtmlGenerator::cleanRef(section.name.toLower()) << "\">" 2748 << protect (marker->plainFullName((*p).first, relative))3046 << protectEnc(marker->plainFullName((*p).first, relative)) 2749 3047 << "</a></li>\n"; 2750 3048 ++p; … … 2756 3054 CodeMarker *marker, 2757 3055 CodeMarker::SynopsisStyle style, 2758 bool nameAlignment)3056 bool alignNames) 2759 3057 { 2760 3058 QString marked = marker->markedUpSynopsis(node, relative, style); 2761 3059 QRegExp templateTag("(<[^@>]*>)"); 2762 3060 if (marked.indexOf(templateTag) != -1) { 2763 QString contents = protect (marked.mid(templateTag.pos(1),3061 QString contents = protectEnc(marked.mid(templateTag.pos(1), 2764 3062 templateTag.cap(1).length())); 2765 3063 marked.replace(templateTag.pos(1), templateTag.cap(1).length(), … … 2781 3079 marked.replace(extraRegExp, ""); 2782 3080 } else { 2783 marked.replace("<@extra>", " <tt>");3081 marked.replace("<@extra>", "<tt>"); 2784 3082 marked.replace("</@extra>", "</tt>"); 2785 3083 } … … 2789 3087 marked.replace("</@type>", ""); 2790 3088 } 2791 out() << highlightedCode(marked, marker, relative, style, nameAlignment);3089 out() << highlightedCode(marked, marker, relative, alignNames); 2792 3090 } 2793 3091 2794 3092 QString 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) 2799 3097 { 2800 3098 QString src = markedCode; … … 2806 3104 const QChar charAt = '@'; 2807 3105 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 2808 3111 // replace all <@link> tags: "(<@link node=\"([^\"]+)\">).*(</@link>)" 2809 static const QString linkTag("link");2810 3112 bool done = false; 2811 for (int i = 0, n = src.size(); i < n;) {3113 for (int i = 0, srcSize = src.size(); i < srcSize;) { 2812 3114 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\">"; 2815 3117 done = true; 2816 3118 } 2817 3119 i += 2; 2818 if (parseArg(src, linkTag, &i, n, &arg, &par1)) {3120 if (parseArg(src, linkTag, &i, srcSize, &arg, &par1)) { 2819 3121 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); 2822 3124 addLink(link, arg, &html); 2823 3125 html += "</b>"; … … 2839 3141 src = html; 2840 3142 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;) { 2843 3144 if (src.at(i) == charLangle && src.at(i + 1) == charAt) { 2844 3145 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); 2851 3151 addLink(link, arg, &html); 2852 3152 par1 = QStringRef(); … … 2866 3166 src = html; 2867 3167 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) { 2871 3171 i += 2; 2872 3172 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(); 2882 3181 } 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 2884 3199 if (!handled) { 2885 3200 html += charLangle; … … 2909 3224 "</@string>", "</span>", 2910 3225 "</@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>",2927 3226 }; 2928 3227 for (int i = 0, n = src.size(); i < n;) { … … 2962 3261 } 2963 3262 2964 #else2965 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>", " <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>)" tags3136 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 all3165 // "<@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 others3221 html += charLangle;3222 }3223 }3224 }3225 else {3226 html += src.at(i);3227 ++i;3228 }3229 }3230 3231 return html;3232 }3233 #endif3234 3235 3263 void HtmlGenerator::generateLink(const Atom* atom, 3236 3264 const Node* /* relative */, … … 3242 3270 // hack for C++: move () outside of link 3243 3271 int k = funcLeftParen.pos(1); 3244 out() << protect (atom->string().left(k));3272 out() << protectEnc(atom->string().left(k)); 3245 3273 if (link.isEmpty()) { 3246 3274 if (showBrokenLinks) … … 3250 3278 } 3251 3279 inLink = false; 3252 out() << protect (atom->string().mid(k));3280 out() << protectEnc(atom->string().mid(k)); 3253 3281 } else if (marker->recognizeLanguage("Java")) { 3254 3282 // hack for Java: remove () and use <tt> when appropriate 3255 3283 bool func = atom->string().endsWith("()"); 3256 3284 bool tt = (func || atom->string().contains(camelCase)); … … 3258 3286 out() << "<tt>"; 3259 3287 if (func) { 3260 out() << protect (atom->string().left(atom->string().length() - 2));3288 out() << protectEnc(atom->string().left(atom->string().length() - 2)); 3261 3289 } else { 3262 out() << protect (atom->string());3290 out() << protectEnc(atom->string()); 3263 3291 } 3264 3292 out() << "</tt>"; 3265 3293 } else { 3266 out() << protect (atom->string());3294 out() << protectEnc(atom->string()); 3267 3295 } 3268 3296 } … … 3338 3366 } 3339 3367 3340 QString HtmlGenerator::protect(const QString& string) 3368 QString HtmlGenerator::protectEnc(const QString &string) 3369 { 3370 return protect(string, outputEncoding); 3371 } 3372 3373 QString HtmlGenerator::protect(const QString &string, const QString &outputEncoding) 3341 3374 { 3342 3375 #define APPEND(x) \ … … 3361 3394 } else if (ch == QLatin1Char('"')) { 3362 3395 APPEND("""); 3363 } else if ( ch.unicode() > 0x007F3396 } else if ((outputEncoding == "ISO-8859-1" && ch.unicode() > 0x007F) 3364 3397 || (ch == QLatin1Char('*') && i + 1 < n && string.at(i) == QLatin1Char('/')) 3365 3398 || (ch == QLatin1Char('.') && i > 2 && string.at(i - 2) == QLatin1Char('.'))) { … … 3381 3414 } 3382 3415 3383 QString HtmlGenerator::fileBase(const Node *node) 3416 QString HtmlGenerator::fileBase(const Node *node) const 3384 3417 { 3385 3418 QString result; … … 3491 3524 break; 3492 3525 case Node::Target: 3493 return protect (node->name());3526 return protectEnc(node->name()); 3494 3527 } 3495 3528 return registerRef(ref); … … 3510 3543 if (node->access() == Node::Private) 3511 3544 return QString(); 3512 3545 3513 3546 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 3516 3552 #if 0 3517 3553 // ### reintroduce this test, without breaking .dcf files … … 3565 3601 } 3566 3602 out() << "\">"; 3567 out() << protect (fullName(apparentNode, relative, marker));3603 out() << protectEnc(fullName(apparentNode, relative, marker)); 3568 3604 out() << "</a>"; 3569 3605 } … … 3575 3611 const EnumNode *enume; 3576 3612 3613 #ifdef GENERATE_MAC_REFS 3577 3614 generateMacRef(node, marker); 3615 #endif 3616 generateExtractionMark(node, MemberMark); 3578 3617 if (node->type() == Node::Enum 3579 3618 && (enume = static_cast<const EnumNode *>(node))->flagsType()) { 3619 #ifdef GENERATE_MAC_REFS 3580 3620 generateMacRef(enume->flagsType(), marker); 3621 #endif 3581 3622 out() << "<h3 class=\"flags\">"; 3582 3623 out() << "<a name=\"" + refForNode(node) + "\"></a>"; 3583 3624 generateSynopsis(enume, relative, marker, CodeMarker::Detailed); 3584 out() << "<br 3625 out() << "<br/>"; 3585 3626 generateSynopsis(enume->flagsType(), 3586 3627 relative, … … 3593 3634 out() << "<a name=\"" + refForNode(node) + "\"></a>"; 3594 3635 generateSynopsis(node, relative, marker, CodeMarker::Detailed); 3595 out() << "</h3> \n";3636 out() << "</h3>" << divNavTop << "\n"; 3596 3637 } 3597 3638 … … 3626 3667 const EnumNode *enume = static_cast<const EnumNode *>(node); 3627 3668 if (enume->flagsType()) { 3628 out() << "<p>The " << protect (enume->flagsType()->name())3669 out() << "<p>The " << protectEnc(enume->flagsType()->name()) 3629 3670 << " type is a typedef for " 3630 3671 << "<a href=\"qflags.html\">QFlags</a><" 3631 << protect (enume->name())3672 << protectEnc(enume->name()) 3632 3673 << ">. It stores an OR combination of " 3633 << protect (enume->name())3674 << protectEnc(enume->name()) 3634 3675 << " values.</p>\n"; 3635 3676 } 3636 3677 } 3637 3678 generateAlsoList(node, marker); 3679 generateExtractionMark(node, EndMark); 3638 3680 } 3639 3681 … … 3677 3719 serviceClasses.insert(serviceName, *c); 3678 3720 } 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 } 3679 3731 else if ((*c)->isInnerNode()) { 3680 3732 findAllClasses(static_cast<InnerNode *>(*c)); … … 3701 3753 if (ncmap == newClassMaps.end()) 3702 3754 ncmap = newClassMaps.insert(sinceVersion,NodeMap()); 3755 NewClassMaps::iterator nqcmap = newQmlClassMaps.find(sinceVersion); 3756 if (nqcmap == newQmlClassMaps.end()) 3757 nqcmap = newQmlClassMaps.insert(sinceVersion,NodeMap()); 3703 3758 3704 3759 if ((*child)->type() == Node::Function) { … … 3720 3775 ncmap.value().insert(className,(*child)); 3721 3776 } 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 } 3722 3786 } 3723 3787 else { … … 3736 3800 } 3737 3801 } 3738 3739 #if 03740 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 #endif3745 3802 3746 3803 void HtmlGenerator::findAllFunctions(const InnerNode *node) … … 3807 3864 } 3808 3865 3809 #ifdef ZZZ_QDOC_QML3810 /*!3811 This function finds all the qml element nodes and3812 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 #endif3831 3832 3866 int HtmlGenerator::hOffset(const Node *node) 3833 3867 { … … 3837 3871 return 2; 3838 3872 case Node::Fake: 3839 if (node->doc().briefText().isEmpty()) 3840 return 1; 3841 else 3842 return 2; 3873 return 1; 3843 3874 case Node::Enum: 3844 3875 case Node::Typedef: … … 3940 3971 else { 3941 3972 *node = marker->resolveTarget(first, myTree, relative); 3942 if (!*node) 3973 if (!*node) { 3943 3974 *node = myTree->findFakeNodeByTitle(first); 3944 if (!*node) 3975 } 3976 if (!*node) { 3945 3977 *node = myTree->findUnambiguousTarget(first, targetAtom); 3978 } 3946 3979 } 3947 3980 … … 4036 4069 case Node::Obsolete: 4037 4070 if (node->isInnerNode()) 4038 4071 Generator::generateStatus(node, marker); 4039 4072 break; 4040 4073 case Node::Compat: … … 4078 4111 } 4079 4112 4113 #ifdef GENERATE_MAC_REFS 4114 /* 4115 No longer valid. 4116 */ 4080 4117 void HtmlGenerator::generateMacRef(const Node *node, CodeMarker *marker) 4081 4118 { … … 4087 4124 out() << "<a name=\"" << "//apple_ref/" << macRef << "\"></a>\n"; 4088 4125 } 4126 #endif 4089 4127 4090 4128 void HtmlGenerator::beginLink(const QString &link, … … 4138 4176 } 4139 4177 4140 QT_END_NAMESPACE4141 4142 4178 #ifdef QDOC_QML 4143 4179 4144 4180 /*! 4145 Generates the summary for forthe \a section. Only used for4181 Generates the summary for the \a section. Only used for 4146 4182 sections of QML element documentation. 4147 4183 … … 4153 4189 { 4154 4190 if (!section.members.isEmpty()) { 4191 out() << "<ul>\n"; 4155 4192 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;4168 4193 m = section.members.begin(); 4169 4194 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\">"; 4173 4196 generateQmlItem(*m,relative,marker,true); 4174 4197 out() << "</li>\n"; 4175 row++;4176 4198 ++m; 4177 4199 } 4178 4200 out() << "</ul>\n"; 4179 if (twoColumn)4180 out() << "</td></tr>\n</table></p>\n";4181 4201 } 4182 4202 } … … 4191 4211 { 4192 4212 const QmlPropertyNode* qpn = 0; 4213 #ifdef GENERATE_MAC_REFS 4193 4214 generateMacRef(node, marker); 4215 #endif 4216 generateExtractionMark(node, MemberMark); 4194 4217 out() << "<div class=\"qmlitem\">"; 4195 4218 if (node->subType() == Node::QmlPropertyGroup) { … … 4197 4220 NodeList::ConstIterator p = qpgn->childNodes().begin(); 4198 4221 out() << "<div class=\"qmlproto\">"; 4199 out() << "<table width=\"100%\"class=\"qmlname\">";4222 out() << "<table class=\"qmlname\">"; 4200 4223 4201 4224 while (p != qpgn->childNodes().end()) { 4202 4225 if ((*p)->type() == Node::QmlProperty) { 4203 4226 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 4205 4234 out() << "<a name=\"" + refForNode(qpn) + "\"></a>"; 4206 if (!qpn->isWritable()) 4235 4236 if (!qpn->isWritable(myTree)) { 4207 4237 out() << "<span class=\"qmlreadonly\">read-only</span>"; 4238 } 4239 if (qpgn->isDefault()) 4240 out() << "<span class=\"qmldefault\">default</span>"; 4208 4241 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>"; 4219 4243 } 4220 4244 ++p; … … 4227 4251 out() << "<div class=\"qmlproto\">"; 4228 4252 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>"; 4230 4259 out() << "<a name=\"" + refForNode(qsn) + "\"></a>"; 4231 4260 generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false); 4232 4261 //generateQmlItem(qsn,relative,marker,false); 4233 out() << "</ td></tr>";4262 out() << "</p></td></tr>"; 4234 4263 out() << "</table>"; 4235 4264 out() << "</div>"; … … 4239 4268 out() << "<div class=\"qmlproto\">"; 4240 4269 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>"; 4242 4276 out() << "<a name=\"" + refForNode(qmn) + "\"></a>"; 4243 4277 generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false); 4244 out() << "</ td></tr>";4278 out() << "</p></td></tr>"; 4245 4279 out() << "</table>"; 4246 4280 out() << "</div>"; … … 4254 4288 out() << "</div>"; 4255 4289 out() << "</div>"; 4290 generateExtractionMark(node, EndMark); 4256 4291 } 4257 4292 … … 4271 4306 if (n && n->subType() == Node::QmlClass) { 4272 4307 const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n); 4273 out() << "<p style=\"text-align: center\">";4274 4308 Text text; 4275 text << "[Inherits ";4309 text << Atom::ParaLeft << "Inherits "; 4276 4310 text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); 4277 4311 text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK); 4278 4312 text << Atom(Atom::String, linkPair.second); 4279 4313 text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK); 4280 text << "]";4314 text << Atom::ParaRight; 4281 4315 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 */ 4325 void 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); 4284 4337 } 4285 4338 } … … 4298 4351 const ClassNode* cn = qcn->classNode(); 4299 4352 if (cn && (cn->status() != Node::Internal)) { 4300 out() << "<p style=\"text-align: center\">";4301 4353 Text text; 4302 text << "[";4354 text << Atom::ParaLeft; 4303 4355 text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); 4304 4356 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); 4306 4361 text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK); 4307 4362 text << " instantiates the C++ class "; … … 4310 4365 text << Atom(Atom::String, cn->name()); 4311 4366 text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK); 4312 text << "]";4367 text << Atom::ParaRight; 4313 4368 generateText(text, qcn, marker); 4314 out() << "</p>";4315 4369 } 4316 4370 } … … 4329 4383 const Node* n = myTree->root()->findNode(cn->qmlElement(),Node::Fake); 4330 4384 if (n && n->subType() == Node::QmlClass) { 4331 out() << "<p style=\"text-align: center\">";4332 4385 Text text; 4333 text << "[";4386 text << Atom::ParaLeft; 4334 4387 text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn)); 4335 4388 text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK); … … 4341 4394 text << Atom(Atom::String, n->name()); 4342 4395 text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK); 4343 text << "]";4396 text << Atom::ParaRight; 4344 4397 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 */ 4406 bool 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 */ 4566 void 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 */ 4583 void 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 4601 void 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"; 4347 4636 } 4348 4637 } 4349 4638 4350 4639 #endif 4640 4641 QT_END_NAMESPACE -
trunk/tools/qdoc3/htmlgenerator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 47 47 #define HTMLGENERATOR_H 48 48 49 #define QDOC_NAME_ALIGNMENT50 51 49 #include <qmap.h> 52 50 #include <qregexp.h> 51 #include <QXmlStreamWriter> 53 52 54 53 #include "codemarker.h" … … 90 89 Property, 91 90 Variable, 91 QmlClass, 92 92 QmlProperty, 93 93 QmlSignal, … … 96 96 }; 97 97 98 enum Application { 99 Online, 100 Creator}; 101 98 102 public: 99 103 HtmlGenerator(); … … 105 109 virtual void generateTree(const Tree *tree, CodeMarker *marker); 106 110 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"); 108 113 static QString cleanRef(const QString& ref); 109 114 static QString sinceTitle(int i) { return sinceTitles[i]; } … … 116 121 virtual void generateClassLikeNode(const InnerNode *inner, CodeMarker *marker); 117 122 virtual void generateFakeNode(const FakeNode *fake, CodeMarker *marker); 118 virtual QString fileExtension(const Node *node) ;123 virtual QString fileExtension(const Node *node) const; 119 124 virtual QString refForNode(const Node *node); 120 125 virtual QString linkForNode(const Node *node, const Node *relative); … … 123 128 private: 124 129 enum SubTitleSize { SmallSubTitle, LargeSubTitle }; 130 enum ExtractionMarkType { 131 BriefMark, 132 DetailedDescriptionMark, 133 MemberMark, 134 EndMark 135 }; 125 136 126 137 const QPair<QString,QString> anchorForNode(const Node *node); … … 129 140 CodeMarker *marker, 130 141 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); 133 148 void generateTitle(const QString& title, 134 149 const Text &subTitle, … … 151 166 int numColumns, 152 167 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); 154 175 QString generateLowStatusMemberFile(const InnerNode *inner, 155 176 CodeMarker *marker, … … 164 185 CodeMarker *marker, 165 186 const NodeMap &classMap, 187 bool includeAlphabet, 166 188 QString commonPrefix = QString()); 167 189 void generateFunctionIndex(const Node *relative, CodeMarker *marker); … … 184 206 CodeMarker *marker); 185 207 void generateQmlInherits(const QmlClassNode* cn, CodeMarker* marker); 208 void generateQmlInheritedBy(const QmlClassNode* cn, CodeMarker* marker); 186 209 void generateQmlInstantiates(const QmlClassNode* qcn, CodeMarker* marker); 187 210 void generateInstantiatedBy(const ClassNode* cn, CodeMarker* marker); 188 211 #endif 189 #ifdef QDOC_NAME_ALIGNMENT 212 190 213 void generateSection(const NodeList& nl, 191 214 const Node *relative, … … 196 219 CodeMarker *marker, 197 220 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); 213 222 void generateSectionInheritedList(const Section& section, 214 223 const Node *relative, 215 224 CodeMarker *marker); 216 225 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 220 231 void generateFullName(const Node *apparentNode, 221 232 const Node *relative, … … 231 242 232 243 QString registerRef(const QString& ref); 233 QString fileBase(const Node *node);244 virtual QString fileBase(const Node *node) const; 234 245 #if 0 235 246 QString fileBase(const Node *node, const SectionIterator& section); … … 240 251 void findAllLegaleseTexts(const InnerNode *node); 241 252 void findAllNamespaces(const InnerNode *node); 242 #ifdef ZZZ_QDOC_QML243 void findAllQmlClasses(const InnerNode *node);244 #endif245 253 void findAllSince(const InnerNode *node); 246 254 static int hOffset(const Node *node); … … 256 264 const QString &url, 257 265 const QString &title); 266 #ifdef GENERATE_MAC_REFS 258 267 void generateMacRef(const Node *node, CodeMarker *marker); 268 #endif 259 269 void beginLink(const QString &link, 260 270 const Node *node, … … 262 272 CodeMarker *marker); 263 273 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); 264 283 265 284 #if 0 … … 283 302 int numTableRows; 284 303 bool threeColumnEnumValueTable; 304 Application application; 285 305 QString link; 286 306 QStringList sectionNumber; … … 288 308 QString style; 289 309 QString postHeader; 310 QString postPostHeader; 311 QString creatorPostHeader; 312 QString creatorPostPostHeader; 290 313 QString footer; 291 314 QString address; … … 308 331 NodeMap namespaceIndex; 309 332 NodeMap serviceClasses; 310 #ifdef QDOC_QML311 333 NodeMap qmlClasses; 312 #endif313 334 QMap<QString, NodeMap > funcIndex; 314 335 QMap<Text, const Node *> legaleseTexts; … … 316 337 static QString sinceTitles[]; 317 338 NewClassMaps newClassMaps; 339 NewClassMaps newQmlClassMaps; 340 static int id; 341 public: 342 static bool debugging_on; 343 static QString divNavTop; 318 344 }; 319 345 320 346 #define HTMLGENERATOR_ADDRESS "address" 321 347 #define HTMLGENERATOR_FOOTER "footer" 322 #define HTMLGENERATOR_GENERATEMACREFS 348 #define HTMLGENERATOR_GENERATEMACREFS "generatemacrefs" // ### document me 323 349 #define HTMLGENERATOR_POSTHEADER "postheader" 350 #define HTMLGENERATOR_POSTPOSTHEADER "postpostheader" 351 #define HTMLGENERATOR_CREATORPOSTHEADER "postheader" 352 #define HTMLGENERATOR_CREATORPOSTPOSTHEADER "postpostheader" 324 353 #define HTMLGENERATOR_STYLE "style" 325 354 #define HTMLGENERATOR_STYLESHEETS "stylesheets" -
trunk/tools/qdoc3/jambiapiparser.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 43 43 jambiapiparser.cpp 44 44 */ 45 46 #include <QtXml>47 45 48 46 #include "cppcodeparser.h" -
trunk/tools/qdoc3/jambiapiparser.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/javacodemarker.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 156 156 } 157 157 158 const Node *JavaCodeMarker::resolveTarget(const QString &target, const Tree *tree, 159 const Node *relative) 158 const Node *JavaCodeMarker::resolveTarget(const QString &target, 159 const Tree *tree, 160 const Node *relative, 161 const Node* /* self */) 160 162 { 161 163 if (target.endsWith("()")) { -
trunk/tools/qdoc3/javacodemarker.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 73 73 QString functionBeginRegExp( const QString& funcName ); 74 74 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 ); 76 79 }; 77 80 -
trunk/tools/qdoc3/javadocgenerator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 146 146 } 147 147 148 QString JavadocGenerator::fileExtension(const Node *node) 148 QString JavadocGenerator::fileExtension(const Node *node) const 149 149 { 150 150 if (node->type() == Node::Fake) { -
trunk/tools/qdoc3/javadocgenerator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 62 62 63 63 protected: 64 QString fileExtension(const Node *node) ;64 QString fileExtension(const Node *node) const; 65 65 void startText( const Node *relative, CodeMarker *marker ); 66 66 void endText( const Node *relative, CodeMarker *marker ); -
trunk/tools/qdoc3/linguistgenerator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 83 83 } 84 84 85 QString LinguistGenerator::fileExtension(const Node * /* node */) 85 QString LinguistGenerator::fileExtension(const Node * /* node */) const 86 86 { 87 87 return "ts"; … … 90 90 void LinguistGenerator::generateClassLikeNode(const InnerNode *inner, CodeMarker *marker) 91 91 { 92 out().setCodec(" utf-8");92 out().setCodec("UTF-8"); 93 93 94 94 QDomDocument document("TS"); … … 101 101 102 102 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")); 104 104 document.appendChild(process); 105 105 document.appendChild(documentElement); -
trunk/tools/qdoc3/linguistgenerator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 71 71 CodeMarker *marker); 72 72 virtual void generateFakeNode( const FakeNode *fake, CodeMarker *marker ); 73 virtual QString fileExtension(const Node *node) ;73 virtual QString fileExtension(const Node *node) const; 74 74 75 75 QList<QDomElement> generateIndexSections(QDomDocument &document, -
trunk/tools/qdoc3/location.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 266 266 { 267 267 emitMessage(Error, message, details); 268 information(message); 269 information(details); 268 270 information("Aborting"); 269 271 exit(EXIT_FAILURE); -
trunk/tools/qdoc3/location.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/loutgenerator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/loutgenerator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 46 46 #include <qglobal.h> 47 #include <QtCore>48 47 #include <stdlib.h> 49 48 #include "apigenerator.h" … … 70 69 #include "sgmlgenerator.h" 71 70 #include "webxmlgenerator.h" 71 #include "ditaxmlgenerator.h" 72 72 #include "tokenizer.h" 73 73 #include "tree.h" 74 #include <qdebug.h> 75 76 #include "qtranslator.h" 77 #ifndef QT_BOOTSTRAPPED 78 # include "qcoreapplication.h" 79 #endif 74 80 75 81 QT_BEGIN_NAMESPACE … … 100 106 static QStringList defines; 101 107 static QHash<QString, Tree *> trees; 108 static QString appArg; // application 102 109 103 110 /*! … … 142 149 static void printVersion() 143 150 { 144 QString s = QString(tr("qdoc version ")) + QString(QT_VERSION_STR);151 QString s = tr("qdoc version %1").arg(QT_VERSION_STR); 145 152 Location::information(s); 146 153 } … … 152 159 static void processQdocconfFile(const QString &fileName) 153 160 { 161 #ifndef QT_NO_TRANSLATION 154 162 QList<QTranslator *> translators; 163 #endif 155 164 156 165 /* … … 183 192 Location::initialize(config); 184 193 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)); 185 212 186 213 /* … … 208 235 Generator::initialize(config); 209 236 237 #ifndef QT_NO_TRANSLATION 210 238 /* 211 239 Load the language translators, if the configuration specifies any. … … 222 250 ++fn; 223 251 } 252 #endif 224 253 225 254 //QSet<QString> outputLanguages = config.getStringSet(CONFIG_OUTPUTLANGUAGES); … … 338 367 */ 339 368 QString tagFile = config.getString(CONFIG_TAGFILE); 340 if (!tagFile.isEmpty()) 369 if (!tagFile.isEmpty()) { 341 370 tree->generateTagFile(tagFile); 371 } 342 372 343 373 tree->setVersion(""); … … 351 381 QDir::setCurrent(prevCurrentDir); 352 382 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 355 389 delete tree; 390 #ifdef DEBUG_SHUTDOWN_CRASH 391 qDebug() << "main(): Tree deleted"; 392 #endif 356 393 } 357 394 … … 362 399 QT_USE_NAMESPACE 363 400 401 #ifndef QT_BOOTSTRAPPED 364 402 QCoreApplication app(argc, argv); 403 #endif 365 404 QString cf = "qsauncompress \1 \2"; 366 405 PolyArchiveExtractor qsaExtractor(QStringList() << "qsa",cf); … … 409 448 SgmlGenerator smglGenerator; 410 449 WebXMLGenerator webxmlGenerator; 450 DitaXmlGenerator ditaxmlGenerator; 411 451 412 452 QStringList qdocFiles; … … 442 482 obsoleteLinks = true; 443 483 } 484 else if (opt == "-creator") 485 appArg = "creator"; 486 else if (opt == "-online") 487 appArg = "online"; 444 488 else { 445 489 qdocFiles.append(opt); … … 447 491 } 448 492 449 493 if (qdocFiles.isEmpty()) { 450 494 printHelp(); 451 495 return EXIT_FAILURE; … … 455 499 Main loop. 456 500 */ 457 foreach (QString qf, qdocFiles) 501 foreach (QString qf, qdocFiles) { 502 //qDebug() << "PROCESSING:" << qf; 458 503 processQdocconfFile(qf); 504 } 459 505 460 506 qDeleteAll(trees); -
trunk/tools/qdoc3/mangenerator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 188 188 } 189 189 190 QString ManGenerator::fileExtension(const Node * /* node */) 190 QString ManGenerator::fileExtension(const Node * /* node */) const 191 191 { 192 192 return "3qt"; -
trunk/tools/qdoc3/mangenerator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 64 64 virtual void generateClassLikeNode(const InnerNode *node, CodeMarker *marker); 65 65 virtual void generateFakeNode( const FakeNode *fake, CodeMarker *marker ); 66 virtual QString fileExtension(const Node *node) ;66 virtual QString fileExtension(const Node *node) const; 67 67 68 68 private: -
trunk/tools/qdoc3/node.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 */ 45 45 46 #include <QtCore>47 46 #include "node.h" 47 #include "tree.h" 48 #include "codemarker.h" 49 #include <qdebug.h> 48 50 49 51 QT_BEGIN_NAMESPACE … … 86 88 87 89 /*! 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. 88 93 */ 89 94 Node::Node(Type type, InnerNode *parent, const QString& name) 90 95 : typ(type), 91 96 acc(Public), 97 saf(UnspecifiedSafeness), 98 pageTyp(NoPageType), 92 99 sta(Commendable), 93 saf(UnspecifiedSafeness),94 100 par(parent), 95 101 rel(0), … … 98 104 if (par) 99 105 par->addChild(this); 100 } 101 102 /*! 106 //uuid = QUuid::createUuid(); 107 } 108 109 /*! 110 Returns the node's URL. 103 111 */ 104 112 QString Node::url() const … … 108 116 109 117 /*! 118 Sets the node's URL to \a url 110 119 */ 111 120 void Node::setUrl(const QString &url) … … 114 123 } 115 124 116 /*! 125 void 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. 117 137 */ 118 138 void Node::setRelates(InnerNode *pseudoParent) … … 138 158 139 159 /*! 160 Returns a string representing the access specifier. 161 */ 162 QString 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 */ 179 QString 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 */ 206 QString 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 /*! 140 221 */ 141 222 Node::Status Node::inheritedStatus() const … … 148 229 149 230 /*! 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? 150 236 */ 151 237 Node::ThreadSafeness Node::threadSafeness() const … … 157 243 158 244 /*! 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? 159 248 */ 160 249 Node::ThreadSafeness Node::inheritedThreadSafeness() const … … 166 255 167 256 /*! 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? 168 260 */ 169 261 QString Node::fileBase() const … … 179 271 180 272 /*! 273 Returns this node's Universally Unique IDentifier. 274 If its UUID has not yet been created, it is created 275 first. 276 */ 277 QUuid 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 */ 291 QString 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 /*! 181 308 \class InnerNode 182 309 */ 183 310 184 311 /*! 312 The inner node destructor deletes the children and removes 313 this node from its related nodes. 185 314 */ 186 315 InnerNode::~InnerNode() … … 191 320 192 321 /*! 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. 193 326 */ 194 327 Node *InnerNode::findNode(const QString& name) 195 328 { 196 329 Node *node = childMap.value(name); 197 if (node )330 if (node && node->subType() != QmlPropertyGroup) 198 331 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 } 199 342 return primaryFunctionMap.value(name); 200 343 } 201 344 202 345 /*! 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. 203 349 */ 204 350 Node *InnerNode::findNode(const QString& name, Type type) … … 309 455 310 456 /*! 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. 311 460 */ 312 461 void InnerNode::makeUndocumentedChildrenInternal() … … 382 531 /*! 383 532 */ 384 void InnerNode::removeFromRelated() 533 void InnerNode::removeFromRelated() 385 534 { 386 535 while (!related.isEmpty()) { … … 399 548 400 549 /*! 401 Returns true .550 Returns true because this is an inner node. 402 551 */ 403 552 bool InnerNode::isInnerNode() const … … 423 572 424 573 /*! 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. 426 575 */ 427 576 const FunctionNode *InnerNode::findFunctionNode(const QString& name) const … … 453 602 454 603 /*! 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. 455 607 */ 456 608 int InnerNode::overloadNumber(const FunctionNode *func) const … … 466 618 467 619 /*! 620 Returns the number of member functions of a class such that 621 the functions are all named \a funcName. 468 622 */ 469 623 int InnerNode::numOverloads(const QString& funcName) const … … 478 632 479 633 /*! 634 Returns a node list containing all the member functions of 635 some class such that the functions overload the name \a funcName. 480 636 */ 481 637 NodeList InnerNode::overloads(const QString &funcName) const … … 491 647 492 648 /*! 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. 493 651 */ 494 652 InnerNode::InnerNode(Type type, InnerNode *parent, const QString& name) 495 653 : Node(type, parent, name) 496 654 { 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. 500 667 */ 501 668 void InnerNode::addInclude(const QString& include) … … 505 672 506 673 /*! 674 Sets the list of include files to \a includes. 507 675 */ 508 676 void InnerNode::setIncludes(const QStringList& includes) … … 548 716 549 717 /*! 718 Adds the \a child to this node's child list. 550 719 */ 551 720 void InnerNode::addChild(Node *child) … … 565 734 if (child->type() == Enum) 566 735 enumChildren.append(child); 567 736 childMap.insert(child->name(), child); 568 737 } 569 738 } … … 579 748 primaryFunctionMap.find(child->name()); 580 749 NodeList& secs = secondaryFunctionMap[child->name()]; 581 if ( *prim == child) {750 if (prim != primaryFunctionMap.end() && *prim == child) { 582 751 if (secs.isEmpty()) { 583 752 primaryFunctionMap.remove(child->name()); … … 591 760 } 592 761 QMap<QString, Node *>::Iterator ent = childMap.find( child->name() ); 593 if ( *ent == child)762 if (ent != childMap.end() && *ent == child) 594 763 childMap.erase( ent ); 595 764 } 596 765 else { 597 766 QMap<QString, Node *>::Iterator ent = childMap.find(child->name()); 598 if ( *ent == child)767 if (ent != childMap.end() && *ent == child) 599 768 childMap.erase(ent); 600 769 } … … 677 846 678 847 /*! 848 Constructs a leaf node named \a name of the specified 849 \a type. The new leaf node becomes a child of \a parent. 679 850 */ 680 851 LeafNode::LeafNode(Type type, InnerNode *parent, const QString& name) 681 852 : Node(type, parent, name) 682 853 { 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 } 683 867 } 684 868 … … 688 872 689 873 /*! 874 Constructs a namespace node. 690 875 */ 691 876 NamespaceNode::NamespaceNode(InnerNode *parent, const QString& name) 692 877 : InnerNode(Namespace, parent, name) 693 878 { 879 setPageType(ApiPage); 694 880 } 695 881 696 882 /*! 697 883 \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. 701 889 */ 702 890 ClassNode::ClassNode(InnerNode *parent, const QString& name) … … 704 892 { 705 893 hidden = false; 894 abstract = false; 895 setPageType(ApiPage); 706 896 } 707 897 … … 712 902 const QString &dataTypeWithTemplateArgs) 713 903 { 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)); 716 906 } 717 907 … … 721 911 { 722 912 int i; 723 724 913 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)); 733 923 } 734 924 else { … … 738 928 739 929 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)); 749 937 } 750 938 else { … … 755 943 756 944 /*! 945 Search the child list to find the property node with the 946 specified \a name. 947 */ 948 const 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 /*! 757 955 \class FakeNode 758 956 */ … … 760 958 /*! 761 959 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. 763 962 */ 764 963 FakeNode::FakeNode(InnerNode *parent, const QString& name, SubType subtype) 765 964 : InnerNode(Fake, parent, name), sub(subtype) 766 965 { 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 */ 987 QString FakeNode::title() const 988 { 989 return tle; 767 990 } 768 991 … … 817 1040 818 1041 /*! 1042 The constructor for the node representing an enum type 1043 has a \a parent class and an enum type \a name. 819 1044 */ 820 1045 EnumNode::EnumNode(InnerNode *parent, const QString& name) … … 824 1049 825 1050 /*! 1051 Add \a item to the enum type's item list. 826 1052 */ 827 1053 void EnumNode::addItem(const EnumItem& item) … … 832 1058 833 1059 /*! 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. 834 1063 */ 835 1064 Node::Access EnumNode::itemAccess(const QString &name) const 836 1065 { 837 if (doc().omitEnumItemNames().contains(name)) {1066 if (doc().omitEnumItemNames().contains(name)) 838 1067 return Private; 839 } 840 else { 841 return Public; 842 } 1068 return Public; 843 1069 } 844 1070 … … 905 1131 /*! 906 1132 Assigning Parameter \a p to this Parameter copies the 907 strings across. 1133 strings across. 908 1134 */ 909 1135 Parameter& Parameter::operator=(const Parameter& p) … … 975 1201 976 1202 /*! 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 */ 1207 void 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 /*! 977 1216 */ 978 1217 void FunctionNode::setOverload(bool overlode) … … 1064 1303 } 1065 1304 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 */ 1312 QString FunctionNode::rawParameters(bool names, bool values) const 1313 { 1314 QString raw; 1315 foreach (const Parameter ¶meter, 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; 1066 1323 } 1067 1324 … … 1110 1367 void FunctionNode::debug() const 1111 1368 { 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(" "))); 1113 1371 } 1114 1372 1115 1373 /*! 1116 1374 \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. 1120 1382 */ 1121 1383 PropertyNode::PropertyNode(InnerNode *parent, const QString& name) … … 1123 1385 sto(Trool_Default), 1124 1386 des(Trool_Default), 1387 scr(Trool_Default), 1388 wri(Trool_Default), 1389 usr(Trool_Default), 1390 cst(false), 1391 fnl(false), 1125 1392 overrides(0) 1126 1393 { 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 */ 1407 void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty) 1132 1408 { 1133 1409 for (int i = 0; i < NumFunctionRoles; ++i) { … … 1139 1415 if (des == Trool_Default) 1140 1416 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; 1141 1423 overrides = baseProperty; 1142 1424 } … … 1164 1446 } 1165 1447 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. 1167 1451 */ 1168 1452 PropertyNode::Trool PropertyNode::toTrool(bool boolean) … … 1172 1456 1173 1457 /*! 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. 1174 1467 */ 1175 1468 bool PropertyNode::fromTrool(Trool troolean, bool defaultValue) … … 1206 1499 #ifdef QDOC_QML 1207 1500 bool QmlClassNode::qmlOnly = false; 1208 1209 /*! 1210 Constructor for the Qml class node. 1501 QMultiMap<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. 1211 1509 */ 1212 1510 QmlClassNode::QmlClassNode(InnerNode *parent, … … 1215 1513 : FakeNode(parent, name, QmlClass), cnode(cn) 1216 1514 { 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 */ 1524 QmlClassNode::~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 */ 1535 void QmlClassNode::clear() 1536 { 1537 inheritedBy.clear(); 1218 1538 } 1219 1539 … … 1226 1546 QString QmlClassNode::fileBase() const 1227 1547 { 1228 #if 0 1548 #if 0 1229 1549 if (Node::fileBase() == "item") 1230 1550 qDebug() << "FILEBASE: qmlitem" << name(); … … 1235 1555 1236 1556 /*! 1557 Record the fact that QML class \a base is inherited by 1558 QML class \a sub. 1559 */ 1560 void 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 */ 1571 void 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 */ 1588 QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent, 1589 const QString& name) 1590 : FakeNode(parent, name, QmlBasicType) 1591 { 1592 setTitle(name); 1593 } 1594 1595 /*! 1237 1596 Constructor for the Qml property group node. \a parent is 1238 always a QmlClassNode. 1597 always a QmlClassNode. 1239 1598 */ 1240 1599 QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, … … 1261 1620 att(attached) 1262 1621 { 1263 // nothing.1622 setPageType(ApiPage); 1264 1623 } 1265 1624 … … 1286 1645 } 1287 1646 } 1647 1648 static 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 */ 1686 bool 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 1288 1785 #endif 1289 1786 -
trunk/tools/qdoc3/node.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 56 56 #include "location.h" 57 57 #include "text.h" 58 #include <QUuid> 58 59 59 60 QT_BEGIN_NAMESPACE … … 97 98 ExternalPage, 98 99 QmlClass, 99 QmlPropertyGroup 100 QmlPropertyGroup, 101 QmlBasicType 100 102 #else 101 103 ExternalPage … … 137 139 }; 138 140 141 enum PageType { 142 NoPageType, 143 ApiPage, 144 ArticlePage, 145 ExamplePage 146 }; 147 139 148 virtual ~Node(); 140 149 … … 145 154 void setThreadSafeness(ThreadSafeness safeness) { saf = safeness; } 146 155 void setSince(const QString &since) { sinc = since; } 147 void setRelates(InnerNode *pseudoParent);156 void setRelates(InnerNode* pseudoParent); 148 157 void setModuleName(const QString &module) { mod = module; } 149 158 void setLink(LinkType linkType, const QString &link, const QString &desc); 150 159 void setUrl(const QString &url); 151 160 void setTemplateStuff(const QString &templateStuff) { tpl = templateStuff; } 161 void setPageType(PageType t) { pageTyp = t; } 162 void setPageType(const QString& t); 152 163 153 164 virtual bool isInnerNode() const = 0; 154 165 virtual bool isReimp() const { return false; } 155 166 virtual bool isFunction() const { return false; } 167 virtual bool isQmlNode() const { return false; } 156 168 Type type() const { return typ; } 157 169 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; } 160 172 const QString& name() const { return nam; } 161 173 QMap<LinkType, QPair<QString,QString> > links() const { return linkMap; } … … 165 177 166 178 Access access() const { return acc; } 179 QString accessString() const; 167 180 const Location& location() const { return loc; } 168 181 const Doc& doc() const { return d; } … … 173 186 QString since() const { return sinc; } 174 187 QString templateStuff() const { return tpl; } 188 PageType pageType() const { return pageTyp; } 189 virtual void addPageKeywords(const QString& ) { } 175 190 176 191 void clearRelated() { rel = 0; } 177 192 178 193 virtual QString fileBase() const; 194 QUuid guid() const; 195 QString ditaXmlHref(); 196 QString extractClassName(const QString &string) const; 179 197 180 198 protected: 181 Node(Type type, InnerNode *parent, const QString& name);199 Node(Type type, InnerNode* parent, const QString& name); 182 200 183 201 private: … … 186 204 Type typ; 187 205 Access acc; 206 ThreadSafeness saf; 207 PageType pageTyp; 188 208 Status sta; 189 ThreadSafeness saf;190 209 #else 191 210 Type typ : 4; 192 211 Access acc : 2; 212 ThreadSafeness saf : 2; 213 PageType pageTyp : 4; 193 214 Status sta : 3; 194 ThreadSafeness saf : 2;195 215 #endif 196 InnerNode *par;197 InnerNode *rel;216 InnerNode* par; 217 InnerNode* rel; 198 218 QString nam; 199 219 Location loc; … … 204 224 QString sinc; 205 225 QString tpl; 226 mutable QUuid uuid; 206 227 }; 207 228 … … 209 230 class EnumNode; 210 231 211 typedef QList<Node 232 typedef QList<Node*> NodeList; 212 233 213 234 class InnerNode : public Node … … 216 237 virtual ~InnerNode(); 217 238 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); 222 243 void addInclude(const QString &include); 223 244 void setIncludes(const QStringList &includes); 224 void setOverload(const FunctionNode *func, bool overlode);245 void setOverload(const FunctionNode* func, bool overlode); 225 246 void normalizeOverloads(); 226 247 void makeUndocumentedChildrenInternal(); … … 229 250 230 251 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; 236 257 const NodeList & childNodes() const { return children; } 237 258 const NodeList & relatedNodes() const { return related; } 238 259 int count() const { return children.size(); } 239 int overloadNumber(const FunctionNode *func) const;260 int overloadNumber(const FunctionNode* func) const; 240 261 int numOverloads(const QString& funcName) const; 241 262 NodeList overloads(const QString &funcName) const; … … 244 265 QStringList primaryKeys(); 245 266 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 ) { } 246 271 247 272 protected: 248 InnerNode(Type type, InnerNode *parent, const QString& name);273 InnerNode(Type type, InnerNode* parent, const QString& name); 249 274 250 275 private: 251 276 friend class Node; 252 277 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; 258 284 QStringList inc; 259 285 NodeList children; 260 286 NodeList enumChildren; 261 287 NodeList related; 262 QMap<QString, Node 263 QMap<QString, Node 288 QMap<QString, Node*> childMap; 289 QMap<QString, Node*> primaryFunctionMap; 264 290 QMap<QString, NodeList> secondaryFunctionMap; 265 291 }; … … 280 306 { 281 307 public: 282 NamespaceNode(InnerNode *parent, const QString& name);308 NamespaceNode(InnerNode* parent, const QString& name); 283 309 virtual ~NamespaceNode() { } 284 310 }; … … 295 321 node(node0), 296 322 dataTypeWithTemplateArgs(dataTypeWithTemplateArgs0) { } 323 QString accessString() const; 297 324 298 325 Node::Access access; … … 301 328 }; 302 329 330 class PropertyNode; 331 303 332 class ClassNode : public InnerNode 304 333 { 305 334 public: 306 ClassNode(InnerNode *parent, const QString& name);335 ClassNode(InnerNode* parent, const QString& name); 307 336 virtual ~ClassNode() { } 308 337 309 338 void addBaseClass(Access access, 310 ClassNode *node,339 ClassNode* node, 311 340 const QString &dataTypeWithTemplateArgs = ""); 312 341 void fixBaseClasses(); 313 342 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; } 316 346 317 347 bool hideFromMainList() const { return hidden; } … … 322 352 QString qmlElement() const { return qmlelement; } 323 353 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; 328 362 bool hidden; 363 bool abstract; 329 364 QString sname; 330 365 QString qmlelement; … … 335 370 public: 336 371 337 FakeNode(InnerNode *parent, const QString& name, SubType subType);372 FakeNode(InnerNode* parent, const QString& name, SubType subType); 338 373 virtual ~FakeNode() { } 339 374 340 375 void setTitle(const QString &title) { tle = title; } 341 376 void setSubTitle(const QString &subTitle) { stle = subTitle; } 342 void addGroupMember(Node *node) { gr.append(node); }377 void addGroupMember(Node* node) { gr.append(node); } 343 378 344 379 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; 348 383 const NodeList &groupMembers() const { return gr; } 349 384 virtual QString nameForLists() const { return title(); } … … 360 395 { 361 396 public: 362 QmlClassNode(InnerNode *parent,397 QmlClassNode(InnerNode* parent, 363 398 const QString& name, 364 399 const ClassNode* cn); 365 virtual ~QmlClassNode() { } 400 virtual ~QmlClassNode(); 401 virtual bool isQmlNode() const { return true; } 366 402 367 403 const ClassNode* classNode() const { return cnode; } 368 404 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: 370 410 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 417 class QmlBasicTypeNode : public FakeNode 418 { 419 public: 420 QmlBasicTypeNode(InnerNode* parent, 421 const QString& name); 422 virtual ~QmlBasicTypeNode() { } 423 virtual bool isQmlNode() const { return true; } 374 424 }; 375 425 … … 381 431 bool attached); 382 432 virtual ~QmlPropGroupNode() { } 433 virtual bool isQmlNode() const { return true; } 383 434 384 435 const QString& element() const { return parent()->name(); } … … 391 442 bool att; 392 443 }; 444 445 class Tree; 393 446 394 447 class QmlPropertyNode : public LeafNode … … 410 463 bool isStored() const { return fromTrool(sto,true); } 411 464 bool isDesignable() const { return fromTrool(des,false); } 412 bool isWritable( ) const { return fromTrool(wri,true); }465 bool isWritable(const Tree* tree) const; 413 466 bool isAttached() const { return att; } 467 virtual bool isQmlNode() const { return true; } 414 468 415 469 const QString& element() const { return static_cast<QmlPropGroupNode*>(parent())->element(); } … … 453 507 { 454 508 public: 455 EnumNode(InnerNode *parent, const QString& name);509 EnumNode(InnerNode* parent, const QString& name); 456 510 virtual ~EnumNode() { } 457 511 458 512 void addItem(const EnumItem& item); 459 void setFlagsType(TypedefNode *typedeff);513 void setFlagsType(TypedefNode* typedeff); 460 514 bool hasItem(const QString &name) const { return names.contains(name); } 461 515 462 516 const QList<EnumItem>& items() const { return itms; } 463 517 Access itemAccess(const QString& name) const; 464 const TypedefNode *flagsType() const { return ft; }518 const TypedefNode* flagsType() const { return ft; } 465 519 QString itemValue(const QString &name) const; 466 520 … … 468 522 QList<EnumItem> itms; 469 523 QSet<QString> names; 470 const TypedefNode *ft;524 const TypedefNode* ft; 471 525 }; 472 526 … … 474 528 { 475 529 public: 476 TypedefNode(InnerNode *parent, const QString& name);530 TypedefNode(InnerNode* parent, const QString& name); 477 531 virtual ~TypedefNode() { } 478 532 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); 483 537 484 538 friend class EnumNode; 485 539 486 const EnumNode *ae;487 }; 488 489 inline void EnumNode::setFlagsType(TypedefNode *typedeff)540 const EnumNode* ae; 541 }; 542 543 inline void EnumNode::setFlagsType(TypedefNode* typedeff) 490 544 { 491 545 ft = typedeff; … … 539 593 enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual }; 540 594 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); 543 597 virtual ~FunctionNode() { } 544 598 … … 546 600 void setParentPath(const QStringList& parentPath) { pp = parentPath; } 547 601 void setMetaness(Metaness metaness) { met = metaness; } 548 void setVirtualness(Virtualness virtualness) { vir = virtualness; }602 void setVirtualness(Virtualness virtualness); 549 603 void setConst(bool conste) { con = conste; } 550 604 void setStatic(bool statique) { sta = statique; } … … 553 607 void addParameter(const Parameter& parameter); 554 608 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); 557 611 558 612 const QString& returnType() const { return rt; } … … 571 625 const QList<Parameter>& parameters() const { return params; } 572 626 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; } 576 631 const QStringList& parentPath() const { return pp; } 577 632 … … 580 635 const QString& element() const { return parent()->name(); } 581 636 bool isAttached() const { return att; } 637 virtual bool isQmlNode() const { 638 return ((type() == QmlSignal) || (type() == QmlMethod)); 639 } 582 640 583 641 void debug() const; 584 642 585 643 private: 586 void setAssociatedProperty(PropertyNode *property);644 void setAssociatedProperty(PropertyNode* property); 587 645 588 646 friend class InnerNode; … … 604 662 bool att: 1; 605 663 QList<Parameter> params; 606 const FunctionNode *rf;607 const PropertyNode *ap;608 QList<FunctionNode 664 const FunctionNode* rf; 665 const PropertyNode* ap; 666 QList<FunctionNode*> rb; 609 667 }; 610 668 … … 615 673 enum { NumFunctionRoles = Notifier + 1 }; 616 674 617 PropertyNode(InnerNode *parent, const QString& name);675 PropertyNode(InnerNode* parent, const QString& name); 618 676 virtual ~PropertyNode() { } 619 677 620 678 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); 623 681 void setStored(bool stored) { sto = toTrool(stored); } 624 682 void setDesignable(bool designable) { des = toTrool(designable); } 683 void setScriptable(bool scriptable) { scr = toTrool(scriptable); } 625 684 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; } 627 691 628 692 const QString &dataType() const { return dt; } … … 636 700 bool isStored() const { return fromTrool(sto, storedDefault()); } 637 701 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; } 638 705 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(); } 640 716 641 717 private: … … 645 721 static bool fromTrool(Trool troolean, bool defaultValue); 646 722 647 bool storedDefault() const { return true; }648 bool designableDefault() const { return !setters().isEmpty(); }649 bool writableDefault() const { return !setters().isEmpty(); }650 651 723 QString dt; 724 QString runtimeDesFunc; 725 QString runtimeScrFunc; 652 726 NodeList funcs[NumFunctionRoles]; 653 727 Trool sto; 654 728 Trool des; 729 Trool scr; 655 730 Trool wri; 656 const PropertyNode *overrides; 731 Trool usr; 732 bool cst; 733 bool fnl; 734 const PropertyNode* overrides; 657 735 }; 658 736 … … 662 740 } 663 741 664 inline void PropertyNode::addFunction(FunctionNode *function, FunctionRole role)742 inline void PropertyNode::addFunction(FunctionNode* function, FunctionRole role) 665 743 { 666 744 funcs[(int)role].append(function); … … 668 746 } 669 747 670 inline void PropertyNode::addSignal(FunctionNode *function, FunctionRole role)748 inline void PropertyNode::addSignal(FunctionNode* function, FunctionRole role) 671 749 { 672 750 funcs[(int)role].append(function); … … 684 762 { 685 763 public: 686 VariableNode(InnerNode *parent, const QString &name);764 VariableNode(InnerNode* parent, const QString &name); 687 765 virtual ~VariableNode() { } 688 766 … … 702 780 }; 703 781 704 inline VariableNode::VariableNode(InnerNode *parent, const QString &name)782 inline VariableNode::VariableNode(InnerNode* parent, const QString &name) 705 783 : LeafNode(Variable, parent, name), sta(false) 706 784 { 785 // nothing. 707 786 } 708 787 … … 710 789 { 711 790 public: 712 TargetNode(InnerNode *parent, const QString& name);791 TargetNode(InnerNode* parent, const QString& name); 713 792 virtual ~TargetNode() { } 714 793 -
trunk/tools/qdoc3/openedlist.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/openedlist.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/pagegenerator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 */ 45 45 46 #include <QtCore>47 46 #include <qfile.h> 48 47 #include <qfileinfo.h> 49 48 #include <qdebug.h> 50 49 #include "pagegenerator.h" 51 50 #include "tree.h" … … 70 69 } 71 70 71 static QRegExp linkTag("(<@link node=\"([^\"]+)\">).*(</@link>)"); 72 static QRegExp funcTag("(<@func target=\"([^\"]*)\">)(.*)(</@func>)"); 73 static QRegExp typeTag("(<@(type|headerfile|func)(?: +[^>]*)?>)(.*)(</@\\2>)"); 74 static QRegExp spanTag("</@(?:comment|preprocessor|string|char)>"); 75 static QRegExp unknownTag("</?@[^>]*>"); 76 77 bool 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 72 175 /*! 73 176 This function is recursive. … … 78 181 } 79 182 80 QString PageGenerator::fileBase(const Node *node) 183 QString PageGenerator::fileBase(const Node *node) const 81 184 { 82 185 if (node->relates()) … … 105 208 files. 106 209 */ 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-"); 109 214 } 110 215 #endif … … 153 258 } 154 259 155 QString PageGenerator::fileName(const Node *node) 260 QString PageGenerator::fileName(const Node *node) const 156 261 { 157 262 if (!node->url().isEmpty()) … … 177 282 .arg(outFile->fileName())); 178 283 QTextStream *out = new QTextStream(outFile); 179 out->setCodec( "ISO-8859-1");284 out->setCodec(outputCodec); 180 285 outStreamStack.push(out); 181 286 } … … 196 301 Recursive writing of html files from the root \a node. 197 302 */ 198 void PageGenerator::generateInnerNode(const InnerNode *node,199 CodeMarker *marker)303 void 304 PageGenerator::generateInnerNode(const InnerNode* node, CodeMarker* marker) 200 305 { 201 306 if (!node->url().isNull()) … … 206 311 if (fakeNode->subType() == Node::ExternalPage) 207 312 return; 208 #ifdef QDOC_QML 313 if (fakeNode->subType() == Node::Image) 314 return; 209 315 if (fakeNode->subType() == Node::QmlPropertyGroup) 210 316 return; 211 #endif 317 if (fakeNode->subType() == Node::Page) { 318 if (node->count() > 0) 319 qDebug("PAGE %s HAS CHILDREN", qPrintable(fakeNode->title())); 320 } 212 321 } 213 322 -
trunk/tools/qdoc3/pagegenerator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 55 55 QT_BEGIN_NAMESPACE 56 56 57 class QTextCodec; 58 57 59 class ClassNode; 58 60 class InnerNode; … … 68 70 69 71 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; 73 75 QString outFileName(); 74 76 void beginSubPage(const Location& location, const QString& fileName); … … 77 79 QTextStream& out(); 78 80 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 79 92 private: 80 QStack<QTextStream 93 QStack<QTextStream*> outStreamStack; 81 94 }; 82 95 -
trunk/tools/qdoc3/plaincodemarker.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 130 130 } 131 131 132 const Node *PlainCodeMarker::resolveTarget( const QString& /* target */,133 const Tree * /* tree */,134 const Node * /* relative */ )135 {136 return 0;137 }138 139 132 QT_END_NAMESPACE -
trunk/tools/qdoc3/plaincodemarker.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 72 72 QString functionEndRegExp( const QString& funcName ); 73 73 QList<Section> sections(const InnerNode *innerNode, SynopsisStyle style, Status status); 74 const Node *resolveTarget(const QString &target, const Tree *tree, const Node *relative);75 74 }; 76 75 -
trunk/tools/qdoc3/polyarchiveextractor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/polyarchiveextractor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/polyuncompressor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/polyuncompressor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/qdoc3.pro
r561 r846 5 5 #DEFINES += QT_USE_FAST_CONCATENATION 6 6 7 QT = core xml 8 CONFIG += console 9 CONFIG -= debug_and_release_target 7 qdoc_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 10 18 !isEmpty(QT_BUILD_TREE):DESTDIR = $$QT_BUILD_TREE/bin 11 19 #CONFIG += debug … … 15 23 # CONFIG += debug 16 24 } 17 mac:CONFIG -= app_bundle 25 26 CONFIG -= app_bundle 18 27 HEADERS += apigenerator.h \ 19 28 archiveextractor.h \ … … 30 39 cpptoqsconverter.h \ 31 40 dcfsection.h \ 41 ditaxmlgenerator.h \ 32 42 doc.h \ 33 43 editdistance.h \ … … 74 84 cpptoqsconverter.cpp \ 75 85 dcfsection.cpp \ 86 ditaxmlgenerator.cpp \ 76 87 doc.cpp \ 77 88 editdistance.cpp \ … … 106 117 yyindent.cpp 107 118 119 ### Documentation for qdoc3 ### 120 121 qtPrepareTool(QDOC, qdoc3) 122 123 html-docs.commands = cd \"$$PWD/doc\" && $$QDOC qdoc-manual.qdocconf 124 125 QMAKE_EXTRA_TARGETS += html-docs 126 108 127 target.path = $$[QT_INSTALL_BINS] 109 128 INSTALLS += target -
trunk/tools/qdoc3/qsakernelparser.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 71 71 Tree * /* tree */ ) 72 72 { 73 FILE *in = fopen( QFile::encodeName(filePath), "r");74 if ( in == 0) {73 QFile in(filePath); 74 if (!in.open(QIODevice::ReadOnly)) { 75 75 location.error( tr("Cannot open QSA kernel file '%1'").arg(filePath) ); 76 76 return; … … 172 172 } 173 173 } 174 fclose( in);174 in.close(); 175 175 } 176 176 -
trunk/tools/qdoc3/qsakernelparser.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/qscodemarker.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 280 280 281 281 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"); 287 287 288 288 QStack<const ClassNode *> stack; … … 329 329 append( sections, signalz ); 330 330 } 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"); 334 334 335 335 NodeList::ConstIterator c = classe->childNodes().begin(); … … 350 350 append( sections, functionsAndSignals ); 351 351 } else { // ( style == SeparateList ) 352 FastSection all( classe);352 FastSection all(classe, "", "", "member", "members"); 353 353 354 354 QStack<const ClassNode *> stack; … … 376 376 } 377 377 378 const Node *QsCodeMarker::resolveTarget( const QString& /* target */,379 const Tree * /* tree */,380 const Node * /* relative */ )381 {382 return 0;383 }384 385 378 QT_END_NAMESPACE -
trunk/tools/qdoc3/qscodemarker.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 73 73 QString functionBeginRegExp( const QString& funcName ); 74 74 QString functionEndRegExp( const QString& funcName ); 75 const Node *resolveTarget( const QString& target, const Tree *tree, const Node *relative );76 75 }; 77 76 -
trunk/tools/qdoc3/qscodeparser.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 152 152 qsTre = tree; 153 153 154 FILE *in = fopen(QFile::encodeName(filePath), "r");155 if ( in == 0) {154 QFile in(filePath); 155 if (!in.open(QIODevice::ReadOnly)) { 156 156 location.error(tr("Cannot open Qt Script class list '%1'") 157 157 .arg(filePath)); … … 176 176 tok = fileTokenizer.getToken(); 177 177 } 178 fclose(in);178 in.close(); 179 179 } 180 180 -
trunk/tools/qdoc3/qscodeparser.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/quoter.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/quoter.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/separator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/separator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/sgmlgenerator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/sgmlgenerator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/test/assistant.qdocconf
r769 r846 7 7 project = Qt Assistant 8 8 description = Qt Assistant Manual 9 url = http:// qt.nokia.com/doc/4.69 url = http://doc.qt.nokia.com/4.7/ 10 10 11 11 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index … … 14 14 15 15 qhp.Assistant.file = assistant.qhp 16 qhp.Assistant.namespace = com.trolltech.assistant.4 6016 qhp.Assistant.namespace = com.trolltech.assistant.472 17 17 qhp.Assistant.virtualFolder = qdoc 18 18 qhp.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 19 qhp.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 53 qhp.Assistant.filterAttributes = qt 4.7.2 tools assistant 21 54 qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual 22 55 qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant … … 41 74 $QT_SOURCE_TREE/doc/src 42 75 43 imagedirs = $QT_SOURCE_TREE/doc/src/images 76 imagedirs = $QT_SOURCE_TREE/doc/src/images \ 77 $QT_SOURCE_TREE/doc/src/template/images 44 78 outputdir = $QT_BUILD_TREE/doc-build/html-assistant 45 79 base = file:$QT_BUILD_TREE/doc-build/html-assistant -
trunk/tools/qdoc3/test/designer.qdocconf
r769 r846 7 7 project = Qt Designer 8 8 description = Qt Designer Manual 9 url = http:// qt.nokia.com/doc/4.69 url = http://doc.qt.nokia.com/4.7/ 10 10 11 11 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index … … 14 14 15 15 qhp.Designer.file = designer.qhp 16 qhp.Designer.namespace = com.trolltech.designer.4 6016 qhp.Designer.namespace = com.trolltech.designer.472 17 17 qhp.Designer.virtualFolder = qdoc 18 18 qhp.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 19 qhp.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 53 qhp.Designer.filterAttributes = qt 4.7.2 tools designer 21 54 qhp.Designer.customFilters.Designer.name = Qt Designer Manual 22 55 qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer … … 47 80 $QT_SOURCE_TREE/doc/src 48 81 49 imagedirs = $QT_SOURCE_TREE/doc/src/images 82 imagedirs = $QT_SOURCE_TREE/doc/src/images \ 83 $QT_SOURCE_TREE/doc/src/template/images 50 84 outputdir = $QT_BUILD_TREE/doc-build/html-designer 51 85 base = file:$QT_BUILD_TREE/doc-build/html-designer -
trunk/tools/qdoc3/test/jambi.qdocconf
r651 r846 17 17 $QTDIR/examples \ 18 18 $JAMBI/doc/src/images \ 19 ../doc/src/images 19 ../doc/src/images \ 20 $QTDIR/doc/src/template/images 20 21 21 22 extraimages.javadoc = qt-logo \ -
trunk/tools/qdoc3/test/linguist.qdocconf
r769 r846 7 7 project = Qt Linguist 8 8 description = Qt Linguist Manual 9 url = http://qt.nokia.com/doc/4.69 url = http://doc.qt.nokia.com/4.7/ 10 10 11 11 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index … … 14 14 15 15 qhp.Linguist.file = linguist.qhp 16 qhp.Linguist.namespace = com.trolltech.linguist.4 6016 qhp.Linguist.namespace = com.trolltech.linguist.472 17 17 qhp.Linguist.virtualFolder = qdoc 18 18 qhp.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 19 qhp.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 53 qhp.Linguist.filterAttributes = qt 4.7.2 tools linguist 21 54 qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual 22 55 qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist … … 43 76 $QT_SOURCE_TREE/doc/src 44 77 45 imagedirs = $QT_SOURCE_TREE/doc/src/images 78 imagedirs = $QT_SOURCE_TREE/doc/src/images \ 79 $QT_SOURCE_TREE/doc/src/template/images 46 80 outputdir = $QT_BUILD_TREE/doc-build/html-linguist 47 81 base = file:$QT_BUILD_TREE/doc-build/html-linguist -
trunk/tools/qdoc3/test/macros.qdocconf
r651 r846 19 19 macro.QD = "\\e{Qt Designer}" 20 20 macro.QL = "\\e{Qt Linguist}" 21 macro.QQV = "\\e{Qt QML Viewer}" 21 22 macro.param = "\\e" 22 23 macro.raisedaster.HTML = "<sup>*</sup>" -
trunk/tools/qdoc3/test/qmake.qdocconf
r769 r846 7 7 project = QMake 8 8 description = QMake Manual 9 url = http://qt.nokia.com/doc/4. 69 url = http://qt.nokia.com/doc/4.7 10 10 11 11 indexes = $QT_BUILD_TREE/doc-build/html-qt/qt.index … … 14 14 15 15 qhp.qmake.file = qmake.qhp 16 qhp.qmake.namespace = com.trolltech.qmake.4 6016 qhp.qmake.namespace = com.trolltech.qmake.472 17 17 qhp.qmake.virtualFolder = qdoc 18 18 qhp.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 19 qhp.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 53 qhp.qmake.filterAttributes = qt 4.7.2 tools qmake 21 54 qhp.qmake.customFilters.qmake.name = qmake Manual 22 55 qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake … … 36 69 $QT_SOURCE_TREE/doc/src 37 70 38 imagedirs = $QT_SOURCE_TREE/doc/src/images 71 imagedirs = $QT_SOURCE_TREE/doc/src/images \ 72 $QT_SOURCE_TREE/doc/src/template/images 39 73 outputdir = $QT_BUILD_TREE/doc-build/html-qmake 40 74 base = file:$QT_BUILD_TREE/doc-build/html-qmake -
trunk/tools/qdoc3/test/qt-api-only.qdocconf
r561 r846 26 26 $QT_SOURCE_TREE/doc/src/development/qmake-manual.qdoc 27 27 28 # Remove the QML documentation from the Qt-only documentation. 29 30 excludedirs += $QT_SOURCE_TREE/src/imports 31 28 32 outputdir = $QT_BUILD_TREE/doc-build/html-qt 29 33 tagfile = $QT_BUILD_TREE/doc-build/html-qt/qt.tags -
trunk/tools/qdoc3/test/qt-build-docs.qdocconf
r769 r846 7 7 project = Qt 8 8 description = Qt Reference Documentation 9 url = http://qt.nokia.com/doc/4. 69 url = http://qt.nokia.com/doc/4.7 10 10 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 11 sourceencoding = UTF-8 12 outputencoding = UTF-8 13 naturallanguage = en_US 17 14 18 15 qhp.projects = Qt 19 16 20 17 qhp.Qt.file = qt.qhp 21 qhp.Qt.namespace = com.trolltech.qt.4 6018 qhp.Qt.namespace = com.trolltech.qt.472 22 19 qhp.Qt.virtualFolder = qdoc 23 20 qhp.Qt.indexTitle = Qt Reference Documentation … … 26 23 # Files not referenced in any qdoc file (last four are needed by qtdemo) 27 24 # See also extraimages.HTML 28 qhp.Qt.extraFiles = classic.css \ 29 images/qt-logo.png \ 25 qhp.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 \ 30 46 images/taskmenuextension-example.png \ 31 47 images/coloreditorfactoryimage.png \ 32 48 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 34 59 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 62 qhp.Qt.filterAttributes = qt 4.7.2 qtrefdoc 63 qhp.Qt.customFilters.Qt.name = Qt 4.7.2 64 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2 65 qhp.Qt.subprojects = classes qmlelements overviews examples 39 66 qhp.Qt.subprojects.classes.title = Classes 40 qhp.Qt.subprojects.classes.indexTitle = Qt'sClasses67 qhp.Qt.subprojects.classes.indexTitle = All Classes 41 68 qhp.Qt.subprojects.classes.selectors = class fake:headerfile 42 69 qhp.Qt.subprojects.classes.sortPages = true 70 qhp.Qt.subprojects.qmlelements.title = QML Elements 71 qhp.Qt.subprojects.qmlelements.indexTitle = QML Elements 72 qhp.Qt.subprojects.qmlelements.selectors = fake:qmlclass 73 qhp.Qt.subprojects.qmlelements.sortPages = true 43 74 qhp.Qt.subprojects.overviews.title = Overviews 44 75 qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs … … 77 108 $QT_SOURCE_TREE/src/3rdparty/harfbuzz \ 78 109 $QT_SOURCE_TREE/src/3rdparty/kdebase \ 110 $QT_SOURCE_TREE/src/3rdparty/libconninet \ 79 111 $QT_SOURCE_TREE/src/3rdparty/libjpeg \ 80 112 $QT_SOURCE_TREE/src/3rdparty/libmng \ … … 90 122 $QT_SOURCE_TREE/src/3rdparty/wintab \ 91 123 $QT_SOURCE_TREE/src/3rdparty/zlib \ 92 $QT_SOURCE_TREE/doc/src/snippets \93 124 $QT_SOURCE_TREE/src/3rdparty/phonon/gstreamer \ 94 125 $QT_SOURCE_TREE/src/3rdparty/phonon/ds9 \ 95 126 $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 97 132 98 133 sources.fileextensions = "*.cpp *.qdoc *.mm" 99 examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp "134 examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml" 100 135 examples.imageextensions = "*.png" 101 136 … … 107 142 $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs 108 143 imagedirs = $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 110 147 outputdir = $QT_BUILD_TREE/doc/html 111 148 tagfile = $QT_BUILD_TREE/doc/html/qt.tags -
trunk/tools/qdoc3/test/qt-cpp-ignore.qdocconf
r561 r846 65 65 Q_XMLPATTERNS_EXPORT \ 66 66 QDBUS_EXPORT \ 67 Q_DBUS_EXPORT \ 67 68 QT_BEGIN_NAMESPACE \ 68 69 QT_BEGIN_INCLUDE_NAMESPACE \ … … 71 72 PHONON_EXPORT \ 72 73 Q_DECLARATIVE_EXPORT \ 73 Q_GADGET \ 74 QWEBKIT_EXPORT 74 Q_GADGET \ 75 QWEBKIT_EXPORT \ 76 Q_INVOKABLE 75 77 Cpp.ignoredirectives = Q_DECLARE_HANDLE \ 76 78 Q_DECLARE_INTERFACE \ … … 91 93 K_DECLARE_PRIVATE \ 92 94 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 4 4 QT_COMPAT \ 5 5 QT_KEYPAD_NAVIGATION \ 6 QT_NO_EGL \ 6 7 QT3_SUPPORT \ 7 8 Q_WS_.* \ … … 20 21 extraimages.HTML = qt-logo \ 21 22 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 \ 22 43 taskmenuextension-example.png \ 23 44 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. 48 scriptdirs = $QT_SOURCE_TREE/doc/src/template/scripts 49 styledirs = $QT_SOURCE_TREE/doc/src/template/style 50 51 scripts.HTML = functions.js \ 52 narrow.js \ 53 superfish.js \ 54 jquery.js 55 56 styles.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\"> </td>" \ 8 "<td class=\"postheader\" valign=\"center\">" \ 9 "<a href=\"index.html\">" \ 10 "<font color=\"#004faf\">Home</font></a> ·" \ 11 " <a href=\"classes.html\">" \ 12 "<font color=\"#004faf\">All Classes</font></a> ·" \ 13 " <a href=\"functions.html\">" \ 14 "<font color=\"#004faf\">All Functions</font></a> ·" \ 15 " <a href=\"overviews.html\">" \ 16 "<font color=\"#004faf\">Overviews</font></a>" \ 17 "</td>" \ 18 "</tr></table>" 1 HTML.stylesheets = style/style.css \ 2 style/OfflineStyle.css \ 3 style/style_ie7.css \ 4 style/style_ie8.css \ 5 style/style_ie6.css 19 6 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 © 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>" 7 HTML.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 & 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> 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 & 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 134 HTML.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 148 HTML.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\">©</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 3 3 quotinginformation = true 4 4 imagedirs = $QTDIR/doc/src/images \ 5 $QTDIR/examples 5 $QTDIR/examples \ 6 $QTDIR/doc/src/template/images 6 7 7 8 outputdir = $QTDIR/doc/webxml -
trunk/tools/qdoc3/test/qt.qdocconf
r769 r846 7 7 project = Qt 8 8 versionsym = 9 version = 4. 6.39 version = 4.7.2 10 10 description = Qt Reference Documentation 11 url = http://qt.nokia.com/doc/4. 611 url = http://qt.nokia.com/doc/4.7 12 12 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 13 sourceencoding = UTF-8 14 outputencoding = UTF-8 15 naturallanguage = en_US 19 16 20 17 qhp.projects = Qt 21 18 22 19 qhp.Qt.file = qt.qhp 23 qhp.Qt.namespace = com.trolltech.qt.4 6020 qhp.Qt.namespace = com.trolltech.qt.472 24 21 qhp.Qt.virtualFolder = qdoc 25 22 qhp.Qt.indexTitle = Qt Reference Documentation … … 28 25 # Files not referenced in any qdoc file (last four are needed by qtdemo) 29 26 # 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 27 qhp.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 36 61 37 qhp.Qt.filterAttributes = qt 4. 6.3qtrefdoc38 qhp.Qt.customFilters.Qt.name = Qt 4. 6.339 qhp.Qt.customFilters.Qt.filterAttributes = qt 4. 6.340 qhp.Qt.subprojects = classes overviews examples62 qhp.Qt.filterAttributes = qt 4.7.2 qtrefdoc 63 qhp.Qt.customFilters.Qt.name = Qt 4.7.2 64 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.2 65 qhp.Qt.subprojects = classes qmlelements overviews examples 41 66 qhp.Qt.subprojects.classes.title = Classes 42 67 qhp.Qt.subprojects.classes.indexTitle = Qt's Classes 43 68 qhp.Qt.subprojects.classes.selectors = class fake:headerfile 44 69 qhp.Qt.subprojects.classes.sortPages = true 70 qhp.Qt.subprojects.qmlelements.title = QML Elements 71 qhp.Qt.subprojects.qmlelements.indexTitle = QML Elements 72 qhp.Qt.subprojects.qmlelements.selectors = fake:qmlclass 73 qhp.Qt.subprojects.qmlelements.sortPages = true 45 74 qhp.Qt.subprojects.overviews.title = Overviews 46 75 qhp.Qt.subprojects.overviews.indexTitle = All Overviews and HOWTOs … … 79 108 $QTDIR/src/3rdparty/harfbuzz \ 80 109 $QTDIR/src/3rdparty/kdebase \ 110 $QTDIR/src/3rdparty/libconninet \ 81 111 $QTDIR/src/3rdparty/libjpeg \ 82 112 $QTDIR/src/3rdparty/libmng \ … … 92 122 $QTDIR/src/3rdparty/wintab \ 93 123 $QTDIR/src/3rdparty/zlib \ 94 $QTDIR/doc/src/snippets \95 124 $QTDIR/src/3rdparty/phonon/gstreamer \ 96 125 $QTDIR/src/3rdparty/phonon/ds9 \ 97 126 $QTDIR/src/3rdparty/phonon/qt7 \ 98 127 $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 100 132 101 133 sources.fileextensions = "*.cpp *.qdoc *.mm" 102 examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp "134 examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml" 103 135 examples.imageextensions = "*.png" 104 136 … … 110 142 $QTDIR/src/3rdparty/webkit/WebKit/qt/docs 111 143 imagedirs = $QTDIR/doc/src/images \ 112 $QTDIR/examples 144 $QTDIR/examples \ 145 $QTDIR/doc/src/declarative/pics \ 146 $QTDIR/doc/src/template/images 113 147 outputdir = $QTDIR/doc/html 114 148 tagfile = $QTDIR/doc/html/qt.tags -
trunk/tools/qdoc3/text.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/text.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 76 76 Text subText(Atom::Type left, Atom::Type right, const Atom *from = 0) const; 77 77 void dump() const; 78 void clear(); 78 79 79 80 static Text subText(const Atom *begin, const Atom *end = 0); … … 83 84 84 85 private: 85 void clear();86 86 87 87 Atom *first; -
trunk/tools/qdoc3/tokenizer.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 48 48 #include <qregexp.h> 49 49 #include <qstring.h> 50 #include <qtextcodec.h> 50 51 51 52 #include <ctype.h> … … 67 68 "slots", "static", "struct", "template", "typedef", "typename", 68 69 "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", 70 75 "Q_DECLARE_SEQUENTIAL_ITERATOR", 71 76 "Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR", … … 98 103 static QRegExp *falsehoods = 0; 99 104 105 static QTextCodec *sourceCodec = 0; 106 100 107 /* 101 108 This function is a perfect hash function for the 37 keywords of C99 … … 119 126 } 120 127 121 Tokenizer::Tokenizer(const Location& loc, FILE *in)128 Tokenizer::Tokenizer(const Location& loc, QFile &in) 122 129 { 123 130 init(); 124 QFile file; 125 file.open(in, QIODevice::ReadOnly); 126 yyIn = file.readAll(); 127 file.close(); 131 yyIn = in.readAll(); 128 132 yyPos = 0; 129 133 start(loc); … … 483 487 { 484 488 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()); 485 494 486 495 comment = new QRegExp("/(?:\\*.*\\*/|/.*\n|/[^\n]*$)"); … … 751 760 } 752 761 762 QString Tokenizer::lexeme() const 763 { 764 return sourceCodec->toUnicode(yyLex); 765 } 766 767 QString Tokenizer::previousLexeme() const 768 { 769 return sourceCodec->toUnicode(yyPrevLex); 770 } 771 753 772 QT_END_NAMESPACE -
trunk/tools/qdoc3/tokenizer.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 47 47 #define TOKENIZER_H 48 48 49 #include <qfile.h> 49 50 #include <qstack.h> 50 51 #include <qstring.h> 51 52 #include <stdio.h>53 52 54 53 #include "location.h" … … 77 76 Tok_typename, Tok_union, Tok_unsigned, Tok_using, Tok_virtual, 78 77 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, 80 79 Tok_Q_DECLARE_MUTABLE_SEQUENTIAL_ITERATOR, 81 80 Tok_Q_DECLARE_ASSOCIATIVE_ITERATOR, … … 100 99 public: 101 100 Tokenizer(const Location& loc, const QByteArray &in); 102 Tokenizer(const Location& loc, FILE *in);101 Tokenizer(const Location& loc, QFile &file); 103 102 104 103 ~Tokenizer(); … … 109 108 110 109 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; 113 112 QString version() const { return yyVersion; } 114 113 int braceDepth() const { return yyBraceDepth; } … … 147 146 if (ch == EOF) 148 147 return EOF; 149 // cast explicit ely to make sure the value of ch148 // cast explicitly to make sure the value of ch 150 149 // is in range [0..255] to avoid assert messages 151 150 // when using debug CRT that checks its input. -
trunk/tools/qdoc3/tr.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/tree.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 */ 45 45 46 #include <QtCore>47 46 #include <QDomDocument> 48 47 … … 54 53 #include "text.h" 55 54 #include "tree.h" 55 56 #include <limits.h> 57 #include <qdebug.h> 56 58 57 59 QT_BEGIN_NAMESPACE … … 124 126 /*! 125 127 */ 126 Node *Tree::findNode(const QStringList &path, Node *relative, int findFlags )128 Node *Tree::findNode(const QStringList &path, Node *relative, int findFlags, const Node* self) 127 129 { 128 130 return const_cast<Node*>(const_cast<const Tree*>(this)->findNode(path, 129 131 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 */ 138 const 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(); 141 146 142 147 do { 143 const Node *node = relative;148 const Node *node = current; 144 149 int i; 145 150 … … 150 155 const Node *next = 151 156 static_cast<const InnerNode*>(node)->findNode(path.at(i)); 157 152 158 if (!next && (findFlags & SearchEnumValues) && i == path.size()-1) 153 159 next = static_cast<const InnerNode*>(node)->findEnumNodeForValue(path.at(i)); … … 168 174 if (node && i == path.size() 169 175 && (!(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); 174 183 175 184 return 0; … … 461 470 NodeList::ConstIterator c = rootNode->childNodes().begin(); 462 471 while (c != rootNode->childNodes().end()) { 463 if ((*c)->type() == Node::Class) 472 if ((*c)->type() == Node::Class) { 464 473 resolveInheritance(pass, (ClassNode *) *c); 474 } 465 475 else if ((*c)->type() == Node::Namespace) { 466 476 NamespaceNode *ns = static_cast<NamespaceNode*>(*c); … … 534 544 ClassNode *baseClass = (ClassNode*)findNode((*b).basePath, 535 545 Node::Class); 536 if (!baseClass && (*b).parent) 546 if (!baseClass && (*b).parent) { 537 547 baseClass = (ClassNode*)findNode((*b).basePath, 538 548 Node::Class, 539 549 (*b).parent); 540 if (baseClass) 550 } 551 if (baseClass) { 541 552 classe->addBaseClass((*b).access, 542 553 baseClass, 543 554 (*b).dataTypeWithTemplateArgs); 555 } 544 556 ++b; 545 557 } … … 1119 1131 nodeName = "target"; 1120 1132 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; 1121 1142 default: 1122 1143 return false; … … 1208 1229 writer.writeAttribute("fullname", fullName); 1209 1230 writer.writeAttribute("href", fullDocumentLocation(node)); 1210 if ( node->type() != Node::Fake)1231 if ((node->type() != Node::Fake) && (!node->isQmlNode())) 1211 1232 writer.writeAttribute("location", node->location().fileName()); 1212 1233 … … 1262 1283 case Node::ExternalPage: 1263 1284 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"); 1264 1291 break; 1265 1292 default: … … 1335 1362 break; 1336 1363 1364 case Node::QmlProperty: 1365 { 1366 const QmlPropertyNode *qpn = static_cast<const QmlPropertyNode*>(node); 1367 writer.writeAttribute("type", qpn->dataType()); 1368 } 1369 break; 1337 1370 case Node::Property: 1338 1371 { … … 1522 1555 const InnerNode *inner = static_cast<const InnerNode *>(node); 1523 1556 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 } 1527 1573 1528 1574 /* … … 1915 1961 else if (node->type() == Node::Fake) { 1916 1962 #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 1920 1971 #endif 1921 1972 parentName = node->fileBase() + ".html"; … … 1928 1979 if ((parentNode = node->relates())) 1929 1980 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 1933 1998 switch (node->type()) { 1934 1999 case Node::Class: … … 1976 2041 case Node::Property: 1977 2042 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"; 1978 2052 break; 1979 2053 case Node::Variable: … … 2016 2090 2017 2091 /*! 2092 Construct the full document name for \a node and return the 2093 name. 2018 2094 */ 2019 2095 QString Tree::fullDocumentName(const Node *node) const … … 2026 2102 2027 2103 do { 2028 if (!n->name().isEmpty()) 2104 if (!n->name().isEmpty() && 2105 ((n->type() != Node::Fake) || (n->subType() != Node::QmlPropertyGroup))) 2029 2106 pieces.insert(0, n->name()); 2030 2107 2031 if ( n->type() == Node::Fake)2108 if ((n->type() == Node::Fake) && (n->subType() != Node::QmlPropertyGroup)) 2032 2109 break; 2033 2110 -
trunk/tools/qdoc3/tree.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 66 66 ~Tree(); 67 67 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, 70 73 Node::Type type, 71 Node *relative = 0,74 Node* relative = 0, 72 75 int findFlags = 0); 73 76 FunctionNode *findFunctionNode(const QStringList &path, … … 99 102 100 103 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, 105 109 Node::Type type, const 106 Node *relative = 0,110 Node* relative = 0, 107 111 int findFlags = 0) const; 108 112 const FunctionNode *findFunctionNode(const QStringList &path, -
trunk/tools/qdoc3/uncompressor.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/uncompressor.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/tools/qdoc3/webxmlgenerator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 */ 45 45 46 #include <QtXml>47 48 46 #include "codemarker.h" 49 47 #include "pagegenerator.h" … … 53 51 #include "tree.h" 54 52 53 #include <QtCore/qxmlstream.h> 54 55 55 QT_BEGIN_NAMESPACE 56 56 … … 91 91 } 92 92 93 QString WebXMLGenerator::fileExtension(const Node * /* node */) 93 QString WebXMLGenerator::fileExtension(const Node * /* node */) const 94 94 { 95 95 return "xml"; -
trunk/tools/qdoc3/webxmlgenerator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 47 47 #define WEBXMLGENERATOR_H 48 48 49 #include <QtCore/qxmlstream.h> 50 49 51 #include "codemarker.h" 50 52 #include "config.h" … … 52 54 53 55 QT_BEGIN_NAMESPACE 56 57 class QXmlStreamReader; 58 class QXmlStreamWriter; 54 59 55 60 class WebXMLGenerator : public PageGenerator … … 70 75 virtual void generateClassLikeNode(const InnerNode *inner, CodeMarker *marker); 71 76 virtual void generateFakeNode(const FakeNode *fake, CodeMarker *marker); 72 virtual QString fileExtension(const Node *node) ;77 virtual QString fileExtension(const Node *node) const; 73 78 74 79 virtual const Atom *addAtomElements(QXmlStreamWriter &writer, const Atom *atom, -
trunk/tools/qdoc3/yyindent.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com)
Note:
See TracChangeset
for help on using the changeset viewer.