summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3/ditaxmlgenerator.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-21 23:21:52 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-21 23:21:52 (GMT)
commit8b059a78b2632e31492fa25cfaae99b111a041a6 (patch)
treee30c11849ffc99ceee0c52a3951aa732db715ec0 /tools/qdoc3/ditaxmlgenerator.cpp
parent7f3d9a76e9d956d9e7e4398ac20785070e214958 (diff)
parentc3eeb227360343ccb34365e384e085b358d81f21 (diff)
downloadQt-8b059a78b2632e31492fa25cfaae99b111a041a6.zip
Qt-8b059a78b2632e31492fa25cfaae99b111a041a6.tar.gz
Qt-8b059a78b2632e31492fa25cfaae99b111a041a6.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (26 commits) Fix incorrect usage of _HB_OPEN_Free_Device() in CaretValue cleanup Fix null HB_Device** dereference on exit in Harfbuzz GPOS code Doc: Relicensed the documentation under the GNU FDL version 1.3. doc: Added more DITA output to the XML generator Designer: Prevent QButtonGroup from being added for Q3ButtonGroup. Fix for a leak in the mac style. Doc: Fixing bugs to style and script doc: Added more DITA output to the XML generator Make sure that <br/> is seen as a valid tag in Qt::mightBeRichText() Fix compiler warnings in QtGui (text,painting). Allow Unix to generate unique UUIDs if /dev/urandom exists. Allow GNU Free Documentation license header. Add missing license header. Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to ab9a897b688e991a8405cf938dea9d6a2f1ac072 Fix example compile and runtime warnings, webkit examples not built. qgl_cl_p.h is no longer existent Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to 5699175f55acbdfa4ac95ab6c727ebd4a201f3a2 Doc: Fixed documentation errors. doc: Added more DITA output to the XML generator doc: Fixed type of Package::name ...
Diffstat (limited to 'tools/qdoc3/ditaxmlgenerator.cpp')
-rw-r--r--tools/qdoc3/ditaxmlgenerator.cpp125
1 files changed, 111 insertions, 14 deletions
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp
index 5f10885..e5481a0 100644
--- a/tools/qdoc3/ditaxmlgenerator.cpp
+++ b/tools/qdoc3/ditaxmlgenerator.cpp
@@ -1402,20 +1402,20 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
QList<Section> sections;
QList<Section>::ConstIterator s;
- const ClassNode* cn = 0;
- const NamespaceNode *namespasse = 0;
+ ClassNode* cn = 0;
+ NamespaceNode* namespasse = 0;
QString title;
QString rawTitle;
QString fullTitle;
if (inner->type() == Node::Namespace) {
- namespasse = static_cast<const NamespaceNode *>(inner);
+ namespasse = static_cast<const NamespaceNode*>(inner);
rawTitle = marker->plainName(inner);
fullTitle = marker->plainFullName(inner);
title = rawTitle + " Namespace";
}
else if (inner->type() == Node::Class) {
- cn = static_cast<const ClassNode *>(inner);
+ cn = static_cast<const ClassNode*>(inner);
rawTitle = marker->plainName(inner);
fullTitle = marker->plainFullName(inner);
title = rawTitle + " Class Reference";
@@ -1423,7 +1423,7 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark
generateHeader(inner);
writer.writeStartElement(CXXCLASS);
- writeGuidAttribute(fullTitle);
+ writer.writeAttribute("id",cn->guid());
writer.writeStartElement(APINAME);
writer.writeCharacters(fullTitle);
writer.writeEndElement(); // </apiName>
@@ -4540,10 +4540,8 @@ void DitaXmlGenerator::writeDerivations(const ClassNode* cn, CodeMarker* marker)
writer.writeAttribute("value",(*r).accessString());
writer.writeEndElement(); // </cxxClassDerivationAccessSpecifier>
writer.writeStartElement(CXXCLASSBASECLASS);
- QString fullTitle = marker->plainFullName((*r).node);
- QString guid = lookupGuid(fullTitle);
- writer.writeAttribute("href",guid);
- writer.writeCharacters(fullTitle);
+ writer.writeAttribute("href",(*r).node->ditaXmlHref());
+ writer.writeCharacters(marker->plainFullName((*r).node));
writer.writeEndElement(); // </cxxClassBaseClass>
writer.writeEndElement(); // </cxxClassDerivation>
++r;
@@ -4565,6 +4563,11 @@ void DitaXmlGenerator::writeLocation(const Node* n, CodeMarker* marker)
s2 = CXXFUNCTIONDECLARATIONFILE;
s3 = CXXFUNCTIONDECLARATIONFILELINE;
}
+ else if (n->type() == Node::Enum) {
+ s1 = CXXENUMERATIONAPIITEMLOCATION;
+ s2 = CXXENUMERATIONDECLARATIONFILE;
+ s3 = CXXENUMERATIONDECLARATIONFILELINE;
+ }
writer.writeStartElement(s1);
writer.writeStartElement(s2);
writer.writeAttribute("name","filePath");
@@ -4585,12 +4588,11 @@ void DitaXmlGenerator::writeFunctions(const Section& s,
NodeList::ConstIterator m = s.members.begin();
while (m != s.members.end()) {
if ((*m)->type() == Node::Function) {
- const FunctionNode* fn = reinterpret_cast<const FunctionNode*>(*m);
- QString name = fn->name();
+ FunctionNode* fn = static_cast<const FunctionNode*>(*m);
writer.writeStartElement(CXXFUNCTION);
- writeGuidAttribute(name);
+ writer.writeAttribute("id",fn->guid());
writer.writeStartElement(APINAME);
- writer.writeCharacters(name);
+ writer.writeCharacters(fn->name());
writer.writeEndElement(); // </apiName>
generateBrief(fn,marker);
writer.writeStartElement(CXXFUNCTIONDETAIL);
@@ -4663,7 +4665,15 @@ void DitaXmlGenerator::writeFunctions(const Section& s,
writer.writeStartElement(CXXFUNCTIONNAMELOOKUP);
writer.writeCharacters(fnl);
writer.writeEndElement(); // <cxxFunctionNameLookup>
-
+
+ if (fn->isReimp() && fn->reimplementedFrom() != 0) {
+ FunctionNode* rfn = (FunctionNode*)fn->reimplementedFrom();
+ writer.writeStartElement(CXXFUNCTIONREIMPLEMENTED);
+ writer.writeAttribute("href",rfn->ditaXmlHref());
+ writer.writeCharacters(marker->plainFullName(rfn));
+ writer.writeEndElement(); // </cxxFunctionReimplemented>
+ }
+ writeParameters(fn,marker);
writeLocation(fn, marker);
writer.writeEndElement(); // <cxxFunctionDefinition>
writer.writeStartElement(APIDESC);
@@ -4686,6 +4696,32 @@ void DitaXmlGenerator::writeFunctions(const Section& s,
}
}
+void DitaXmlGenerator::writeParameters(FunctionNode* fn, CodeMarker* marker)
+{
+ const QList<Parameter>& parameters = fn->parameters();
+ if (!parameters.isEmpty()) {
+ writer.writeStartElement(CXXFUNCTIONPARAMETERS);
+ QList<Parameter>::ConstIterator p = parameters.begin();
+ while (p != parameters.end()) {
+ writer.writeStartElement(CXXFUNCTIONPARAMETER);
+ writer.writeStartElement(CXXFUNCTIONPARAMETERDECLAREDTYPE);
+ writer.writeCharacters((*p).leftType());
+ writer.writeEndElement(); // <cxxFunctionParameterDeclaredType>
+ writer.writeStartElement(CXXFUNCTIONPARAMETERDECLARATIONNAME);
+ writer.writeCharacters((*p).name());
+ writer.writeEndElement(); // <cxxFunctionParameterDeclarationName>
+ if (!(*p).defaultValue().isEmpty()) {
+ writer.writeStartElement(CXXFUNCTIONPARAMETERDEFAULTVALUE);
+ writer.writeCharacters((*p).defaultValue());
+ writer.writeEndElement(); // <cxxFunctionParameterDefaultValue>
+ }
+ writer.writeEndElement(); // <cxxFunctionParameter>
+ ++p;
+ }
+ writer.writeEndElement(); // <cxxFunctionParameters>
+ }
+}
+
void DitaXmlGenerator::writeNestedClasses(const Section& s,
const ClassNode* cn,
CodeMarker* marker)
@@ -4696,6 +4732,67 @@ void DitaXmlGenerator::writeEnumerations(const Section& s,
const ClassNode* cn,
CodeMarker* marker)
{
+ NodeList::ConstIterator m = s.members.begin();
+ while (m != s.members.end()) {
+ if ((*m)->type() == Node::Enum) {
+ EnumNode* en = static_cast<const EnumNode*>(*m);
+ writer.writeStartElement(CXXENUMERATION);
+ writer.writeAttribute("id",en->guid());
+ writer.writeStartElement(APINAME);
+ writer.writeCharacters(en->name());
+ writer.writeEndElement(); // </apiName>
+ generateBrief(en,marker);
+ writer.writeStartElement(CXXENUMERATIONDETAIL);
+ writer.writeStartElement(CXXENUMERATIONDEFINITION);
+ writer.writeStartElement(CXXENUMERATIONACCESSSPECIFIER);
+ writer.writeAttribute("value",en->accessString());
+ writer.writeEndElement(); // <cxxEnumerationAccessSpecifier>
+
+ QString fq = fullQualification(en);
+ if (!fq.isEmpty()) {
+ writer.writeStartElement(CXXENUMERATIONSCOPEDNAME);
+ writer.writeCharacters(fq);
+ writer.writeEndElement(); // <cxxEnumerationScopedName>
+ }
+ const QList<EnumItem>& items = en->items();
+ if (!items.isEmpty()) {
+ writer.writeStartElement(CXXENUMERATIONPROTOTYPE);
+ writer.writeCharacters(en->name());
+ writer.writeCharacters(" = { ");
+ QList<EnumItem>::ConstIterator i = items.begin();
+ while (i != items.end()) {
+ writer.writeCharacters((*i).name());
+ if (!(*i).value().isEmpty()) {
+ writer.writeCharacters(" = ");
+ writer.writeCharacters((*i).value());
+ }
+ ++i;
+ if (i != items.end())
+ writer.writeCharacters(", ");
+ }
+ writer.writeCharacters(" }");
+ writer.writeEndElement(); // <cxxEnumerationPrototype>
+ }
+
+ writer.writeStartElement(CXXENUMERATIONNAMELOOKUP);
+ writer.writeCharacters(en->parent()->name() + "::" + en->name());
+ writer.writeEndElement(); // <cxxEnumerationNameLookup>
+
+ writeLocation(en, marker);
+ writer.writeEndElement(); // <cxxEnumerationDefinition>
+ writer.writeStartElement(APIDESC);
+
+ if (!en->doc().isEmpty()) {
+ generateBody(en, marker);
+ // generateAlsoList(inner, marker);
+ }
+
+ writer.writeEndElement(); // </apiDesc>
+ writer.writeEndElement(); // </cxxEnumerationDetail>
+ writer.writeEndElement(); // </cxxEnumeration>
+ }
+ ++m;
+ }
}
void DitaXmlGenerator::writeTypedefs(const Section& s,