diff options
Diffstat (limited to 'tools/qdoc3')
-rw-r--r-- | tools/qdoc3/codemarker.cpp | 12 | ||||
-rw-r--r-- | tools/qdoc3/cppcodeparser.cpp | 7 | ||||
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.cpp | 105 | ||||
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.h | 8 | ||||
-rw-r--r-- | tools/qdoc3/node.cpp | 13 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 6 | ||||
-rw-r--r-- | tools/qdoc3/pagegenerator.cpp | 3 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-build-docs.qdocconf | 76 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf | 67 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf | 14 | ||||
-rw-r--r-- | tools/qdoc3/tree.cpp | 10 |
11 files changed, 228 insertions, 93 deletions
diff --git a/tools/qdoc3/codemarker.cpp b/tools/qdoc3/codemarker.cpp index 818a91f..33ceaf5 100644 --- a/tools/qdoc3/codemarker.cpp +++ b/tools/qdoc3/codemarker.cpp @@ -257,6 +257,7 @@ QString CodeMarker::typified(const QString &string) QString CodeMarker::taggedNode(const Node* node) { QString tag; + QString name = node->name(); switch (node->type()) { case Node::Namespace: @@ -277,11 +278,20 @@ QString CodeMarker::taggedNode(const Node* node) case Node::Property: tag = QLatin1String("@property"); break; +#ifdef QDOC_QML + case Node::Fake: + if (node->subType() == Node::QmlClass) { + if (node->name().startsWith(QLatin1String("QML:"))) + name = name.mid(4); // remove the "QML:" prefix + } + tag = QLatin1String("@property"); + break; +#endif default: tag = QLatin1String("@unknown"); break; } - return QLatin1Char('<') + tag + QLatin1Char('>') + protect(node->name()) + return QLatin1Char('<') + tag + QLatin1Char('>') + protect(name) + QLatin1String("</") + tag + QLatin1Char('>'); } diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index ce7eba3..e4870e3 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -728,7 +728,10 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, if (n) classNode = static_cast<const ClassNode*>(n); } - return new QmlClassNode(tre->root(), names[0], classNode); + if (names[0].startsWith("Q")) + return new QmlClassNode(tre->root(), QLatin1String("QML:")+names[0], classNode); + else + return new QmlClassNode(tre->root(), names[0], classNode); } else if (command == COMMAND_QMLBASICTYPE) { #if 0 @@ -752,6 +755,8 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, QString type; QmlClassNode* qmlClass = 0; if (splitQmlMethodArg(doc,arg,type,element)) { + if (element.startsWith(QLatin1String("Q"))) + element = QLatin1String("QML:") + element; Node* n = tre->findNode(QStringList(element),Node::Fake); if (n && n->subType() == Node::QmlClass) { qmlClass = static_cast<QmlClassNode*>(n); diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index d48a578..d7a9c9e 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -1466,7 +1466,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark writeFunctions((*s),cn,marker); } else if ((*s).name == "Member Type Documentation") { - writeNestedClasses((*s),cn,marker); writeEnumerations((*s),cn,marker); writeTypedefs((*s),cn,marker); } @@ -1476,6 +1475,9 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark else if ((*s).name == "Property Documentation") { writeProperties((*s),cn,marker); } + else if ((*s).name == "Macro Documentation") { + writeMacros((*s),cn,marker); + } ++s; } writer.writeEndElement(); // </cxxClass> @@ -4736,12 +4738,6 @@ void DitaXmlGenerator::writeParameters(const FunctionNode* fn, CodeMarker* marke } } -void DitaXmlGenerator::writeNestedClasses(const Section& s, - const ClassNode* cn, - CodeMarker* marker) -{ -} - void DitaXmlGenerator::writeEnumerations(const Section& s, const ClassNode* cn, CodeMarker* marker) @@ -4929,10 +4925,10 @@ void DitaXmlGenerator::writeProperties(const Section& s, writer.writeCharacters(pn->qualifiedDataType()); writer.writeCharacters(" "); writer.writeCharacters(pn->name()); - writerFunctions("READ",pn->getters()); - writerFunctions("WRITE",pn->setters()); - writerFunctions("RESET",pn->resetters()); - writerFunctions("NOTIFY",pn->notifiers()); + writePropParams("READ",pn->getters()); + writePropParams("WRITE",pn->setters()); + writePropParams("RESET",pn->resetters()); + writePropParams("NOTIFY",pn->notifiers()); if (pn->isDesignable() != pn->designableDefault()) { writer.writeCharacters(" DESIGNABLE "); if (!pn->runtimeDesignabilityFunction().isEmpty()) @@ -5058,7 +5054,92 @@ void DitaXmlGenerator::writeDataMembers(const Section& s, } } -void DitaXmlGenerator::writerFunctions(const QString& tag, const NodeList& nlist) +void DitaXmlGenerator::writeMacros(const Section& s, + const ClassNode* cn, + CodeMarker* marker) +{ + NodeList::ConstIterator m = s.members.begin(); + while (m != s.members.end()) { + if ((*m)->type() == Node::Function) { + const FunctionNode* fn = static_cast<const FunctionNode*>(*m); + if (fn->isMacro()) { + writer.writeStartElement(CXXDEFINE); + writer.writeAttribute("id",fn->guid()); + writer.writeStartElement(APINAME); + writer.writeCharacters(fn->name()); + writer.writeEndElement(); // </apiName> + generateBrief(fn,marker); + writer.writeStartElement(CXXDEFINEDETAIL); + writer.writeStartElement(CXXDEFINEDEFINITION); + writer.writeStartElement(CXXDEFINEACCESSSPECIFIER); + writer.writeAttribute("value",fn->accessString()); + writer.writeEndElement(); // <cxxDefineAccessSpecifier> + + writer.writeStartElement(CXXDEFINEPROTOTYPE); + writer.writeCharacters("#define "); + writer.writeCharacters(fn->name()); + if (fn->metaness() == FunctionNode::MacroWithParams) { + QStringList params = fn->parameterNames(); + if (!params.isEmpty()) { + writer.writeCharacters("("); + for (int i = 0; i < params.size(); ++i) { + if (params[i].isEmpty()) + writer.writeCharacters("..."); + else + writer.writeCharacters(params[i]); + if ((i+1) < params.size()) + writer.writeCharacters(", "); + } + writer.writeCharacters(")"); + } + } + writer.writeEndElement(); // <cxxDefinePrototype> + + writer.writeStartElement(CXXDEFINENAMELOOKUP); + writer.writeCharacters(fn->name()); + writer.writeEndElement(); // <cxxDefineNameLookup> + + if (fn->reimplementedFrom() != 0) { + FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom(); + writer.writeStartElement(CXXDEFINEREIMPLEMENTED); + writer.writeAttribute("href",rfn->ditaXmlHref()); + writer.writeCharacters(marker->plainFullName(rfn)); + writer.writeEndElement(); // </cxxDefineReimplemented> + } + + if (fn->metaness() == FunctionNode::MacroWithParams) { + QStringList params = fn->parameterNames(); + if (!params.isEmpty()) { + writer.writeStartElement(CXXDEFINEPARAMETERS); + for (int i = 0; i < params.size(); ++i) { + writer.writeStartElement(CXXDEFINEPARAMETER); + writer.writeStartElement(CXXDEFINEPARAMETERDECLARATIONNAME); + writer.writeCharacters(params[i]); + writer.writeEndElement(); // <cxxDefineParameterDeclarationName> + writer.writeEndElement(); // <cxxDefineParameter> + } + writer.writeEndElement(); // <cxxDefineParameters> + } + } + + writeLocation(fn); + writer.writeEndElement(); // <cxxDefineDefinition> + writer.writeStartElement(APIDESC); + + if (!fn->doc().isEmpty()) { + generateBody(fn, marker); + } + + writer.writeEndElement(); // </apiDesc> + writer.writeEndElement(); // </cxxDefineDetail> + writer.writeEndElement(); // </cxxDefine> + } + } + ++m; + } +} + +void DitaXmlGenerator::writePropParams(const QString& tag, const NodeList& nlist) { NodeList::const_iterator n = nlist.begin(); while (n != nlist.end()) { diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index 26788d7..446f735 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -118,9 +118,6 @@ class DitaXmlGenerator : public PageGenerator const ClassNode* cn, CodeMarker* marker); void writeParameters(const FunctionNode* fn, CodeMarker* marker); - void writeNestedClasses(const Section& s, - const ClassNode* cn, - CodeMarker* marker); void writeEnumerations(const Section& s, const ClassNode* cn, CodeMarker* marker); @@ -133,7 +130,10 @@ class DitaXmlGenerator : public PageGenerator void writeProperties(const Section& s, const ClassNode* cn, CodeMarker* marker); - void writerFunctions(const QString& tag, const NodeList& nlist); + void writeMacros(const Section& s, + const ClassNode* cn, + CodeMarker* marker); + void writePropParams(const QString& tag, const NodeList& nlist); private: enum SubTitleSize { SmallSubTitle, LargeSubTitle }; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 7596825..b077074 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -923,6 +923,14 @@ FakeNode::FakeNode(InnerNode *parent, const QString& name, SubType subtype) } /*! + Returns the fake node's title. This is used for the page title. +*/ +QString FakeNode::title() const +{ + return tle; +} + +/*! Returns the fake node's full title, which is usually just title(), but for some SubType values is different from title() @@ -1427,7 +1435,10 @@ QmlClassNode::QmlClassNode(InnerNode *parent, const ClassNode* cn) : FakeNode(parent, name, QmlClass), cnode(cn) { - setTitle((qmlOnly ? "" : "QML ") + name + " Element"); + if (name.startsWith(QLatin1String("QML:"))) + setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name.mid(4) + QLatin1String(" Element")); + else + setTitle((qmlOnly ? QLatin1String("") : QLatin1String("QML ")) + name + QLatin1String(" Element")); } /*! diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index b13e113..e9f2d74 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -371,9 +371,9 @@ class FakeNode : public InnerNode void addGroupMember(Node* node) { gr.append(node); } SubType subType() const { return sub; } - QString title() const { return tle; } - QString fullTitle() const; - QString subTitle() const; + virtual QString title() const; + virtual QString fullTitle() const; + virtual QString subTitle() const; const NodeList &groupMembers() const { return gr; } virtual QString nameForLists() const { return title(); } diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index cd364ef..a187c2e 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -209,7 +209,8 @@ QString PageGenerator::fileBase(const Node *node) const */ if ((p->subType() == Node::QmlClass) || (p->subType() == Node::QmlBasicType)) { - base.prepend("qml-"); + if (!base.startsWith(QLatin1String("QML:"))) + base.prepend("qml-"); } #endif if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake) diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index 09cbc45..140b81f 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -22,43 +22,43 @@ qhp.Qt.indexTitle = Qt Reference Documentation # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/arrow-down.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - scripts/shBrushCpp.js \ - scripts/shCore.js \ - scripts/shLegacy.js \ - scripts/narrow.js \ - scripts/superfish.js \ - style/shCore.css \ - style/shThemeDefault.css \ - style/narrow.css \ - style/superfish.css \ - style/superfish_skin.css \ - style/OfflineStyle.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/arrow-down.png \ + images/spinner.gif \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + scripts/shBrushCpp.js \ + scripts/shCore.js \ + scripts/shLegacy.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/shCore.css \ + style/shThemeDefault.css \ + style/narrow.css \ + style/superfish.css \ + style/superfish_skin.css \ + style/OfflineStyle.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css @@ -141,7 +141,7 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ imagedirs = $QT_SOURCE_TREE/doc/src/images \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src/declarative/pics \ - $QT_SOURCE_TREE/doc/src/template/images + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc/html tagfile = $QT_BUILD_TREE/doc/html/qt.tags base = file:$QT_BUILD_TREE/doc/html diff --git a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf index e517b33..7701cae 100644 --- a/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf @@ -30,33 +30,43 @@ qhp.Qt.customFilters.Qt.filterAttributes = qt 4.7.0 # Files not referenced in any qdoc file (last four are needed by qtdemo) # See also extraimages.HTML qhp.Qt.extraFiles = index.html \ - images/bg_l.png \ - images/bg_l_blank.png \ - images/bg_r.png \ - images/box_bg.png \ - images/breadcrumb.png \ - images/bullet_gt.png \ - images/bullet_dn.png \ - images/bullet_sq.png \ - images/bullet_up.png \ - images/feedbackground.png \ - images/horBar.png \ - images/page.png \ - images/page_bg.png \ - images/sprites-combined.png \ - images/arrow-down.png \ - images/spinner.gif \ - images/stylesheet-coffee-plastique.png \ - images/taskmenuextension-example.png \ - images/coloreditorfactoryimage.png \ - images/dynamiclayouts-example.png \ - scripts/functions.js \ - scripts/jquery.js \ - style/OfflineStyle.css \ - style/style_ie6.css \ - style/style_ie7.css \ - style/style_ie8.css \ - style/style.css + images/bg_l.png \ + images/bg_l_blank.png \ + images/bg_r.png \ + images/box_bg.png \ + images/breadcrumb.png \ + images/bullet_gt.png \ + images/bullet_dn.png \ + images/bullet_sq.png \ + images/bullet_up.png \ + images/feedbackground.png \ + images/horBar.png \ + images/page.png \ + images/page_bg.png \ + images/sprites-combined.png \ + images/arrow-down.png \ + images/spinner.gif \ + images/stylesheet-coffee-plastique.png \ + images/taskmenuextension-example.png \ + images/coloreditorfactoryimage.png \ + images/dynamiclayouts-example.png \ + scripts/functions.js \ + scripts/jquery.js \ + scripts/shBrushCpp.js \ + scripts/shCore.js \ + scripts/shLegacy.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/shCore.css \ + style/shThemeDefault.css \ + style/narrow.css \ + style/superfish.css \ + style/superfish_skin.css \ + style/OfflineStyle.css \ + style/style_ie6.css \ + style/style_ie7.css \ + style/style_ie8.css \ + style/style.css language = Cpp @@ -102,7 +112,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ imagedirs = $QT_SOURCE_TREE/doc/src/ja_JP/images \ $QT_SOURCE_TREE/doc/src/images \ $QT_SOURCE_TREE/examples \ - $QT_SOURCE_TREE/doc/src/template/images + $QT_SOURCE_TREE/doc/src/declarative/pics \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc/html_ja_JP tagfile = $QT_BUILD_TREE/doc/html_ja_JP/qt.tags base = file:$QT_BUILD_TREE/doc/html_ja_JP diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index 909a2d4..be459d8 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -52,6 +52,17 @@ qhp.Qt.extraFiles = index.html \ images/dynamiclayouts-example.png \ scripts/functions.js \ scripts/jquery.js \ + scripts/shBrushCpp.js \ + scripts/shCore.js \ + scripts/shLegacy.js \ + scripts/narrow.js \ + scripts/superfish.js \ + style/shCore.css \ + style/shThemeDefault.css \ + style/narrow.css \ + style/superfish.css \ + style/superfish_skin.css \ + style/OfflineStyle.css \ style/style_ie6.css \ style/style_ie7.css \ style/style_ie8.css \ @@ -99,7 +110,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs imagedirs = $QT_SOURCE_TREE/doc/src/images \ $QT_SOURCE_TREE/examples \ - $QT_SOURCE_TREE/doc/src/template/images + $QT_SOURCE_TREE/doc/src/declarative/pics \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc/html_zh_CN tagfile = $QT_BUILD_TREE/doc/html_zh_CN/qt.tags base = file:$QT_BUILD_TREE/doc/html_zh_CN diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index 31bbf54..d31de4d 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -1952,9 +1952,13 @@ QString Tree::fullDocumentLocation(const Node *node) const else if (node->type() == Node::Fake) { #ifdef QDOC_QML if ((node->subType() == Node::QmlClass) || - (node->subType() == Node::QmlBasicType)) - return "qml-" + node->fileBase() + ".html"; - else + (node->subType() == Node::QmlBasicType)) { + QString fb = node->fileBase(); + if (fb.startsWith(QLatin1String("QML:"))) + return node->fileBase() + ".html"; + else + return "qml-" + node->fileBase() + ".html"; + } else #endif parentName = node->fileBase() + ".html"; } |