From 8f3e9dc22c5d4d72984473139d2c9a382c79b963 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 18 Oct 2010 14:35:04 +0200 Subject: qdoc: Added extraneous enum Definition File elements Removed bread crumb generator from DITA XML generator. --- tools/qdoc3/ditaxmlgenerator.cpp | 168 +++++---------------------------------- tools/qdoc3/ditaxmlgenerator.h | 3 - 2 files changed, 21 insertions(+), 150 deletions(-) diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 9108d7b..b69f511 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -2022,60 +2022,6 @@ void DitaXmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker xmlWriter().writeEndElement(); // } -#if 0 -zzz - /* - Generate the TOC for the new doc format. - Don't generate a TOC for the home page. - */ - if (fake->name() != QString("index.html")) - generateTableOfContents(fake,marker,0); - - generateTitle(fullTitle, - Text() << fake->subTitle(), - subTitleSize, - fake, - marker); - - -#endif - -#if 0 -zzz - sections = marker->sections(fake, CodeMarker::Summary, CodeMarker::Okay); - s = sections.begin(); - while (s != sections.end()) { - out() << "\n"; - out() << "

" << protectEnc((*s).name) << "

\n"; - generateSection(s->members, fake, marker, CodeMarker::Summary); - generateSectionInheritedList(*s, relative, marker, name_alignment); - ++s; - } - - Text brief = fake->doc().briefText(); - if (fake->subType() == Node::Module && !brief.isEmpty()) { - out() << "\n"; - out() << "
\n"; // QTBUG-9504 - out() << "

" << "Detailed Description" << "

\n"; - } - else - out() << "
\n"; // QTBUG-9504 - - sections = marker->sections(fake, CodeMarker::Detailed, CodeMarker::Okay); - s = sections.begin(); - while (s != sections.end()) { - out() << "
\n"; - out() << "

" << protectEnc((*s).name) << "

\n"; - - NodeList::ConstIterator m = (*s).members.begin(); - while (m != (*s).members.end()) { - generateDetailedMember(*m, fake, marker); - ++m; - } - ++s; - } -#endif - /*! Returns "xml" for this subclass of class Generator. */ @@ -2085,95 +2031,6 @@ QString DitaXmlGenerator::fileExtension(const Node * /* node */) const } /*! - zzz - Output breadcrumb list in the html file. - */ -void DitaXmlGenerator::generateBreadCrumbs(const QString& title, - const Node *node, - CodeMarker *marker) -{ - Text breadcrumb; - if (node->type() == Node::Class) { - const ClassNode* cn = static_cast(node); - QString name = node->moduleName(); - out() << "
  • All Modules
  • "; - if (!name.isEmpty()) { - out() << "
  • "; - breadcrumb << Atom(Atom::AutoLink,name); - generateText(breadcrumb, node, marker); - out() << "
  • \n"; - } - breadcrumb.clear(); - if (!cn->name().isEmpty()) { - out() << "
  • "; - breadcrumb << Atom(Atom::AutoLink,cn->name()); - generateText(breadcrumb, 0, marker); - out() << "
  • \n"; - } - } - else if (node->type() == Node::Fake) { - const FakeNode* fn = static_cast(node); - if (node->subType() == Node::Module) { - out() << "
  • All Modules
  • "; - QString name = node->name(); - if (!name.isEmpty()) { - out() << "
  • "; - breadcrumb << Atom(Atom::AutoLink,name); - generateText(breadcrumb, 0, marker); - out() << "
  • \n"; - } - } - else if (node->subType() == Node::Group) { - if (fn->name() == QString("modules")) - out() << "
  • All Modules
  • "; - else { - out() << "
  • name() << "\">" << title - << "
  • "; - } - } - else if (node->subType() == Node::Page) { - if (fn->name() == QString("examples.html")) { - out() << "
  • Examples
  • "; - } - else if (fn->name().startsWith("examples-")) { - out() << "
  • Examples
  • "; - out() << "
  • name() << "\">" << title - << "
  • "; - } - else if (fn->name() == QString("namespaces.html")) { - out() << "
  • All Namespaces
  • "; - } - else { - out() << "
  • name() << "\">" << title - << "
  • "; - } - } - else if (node->subType() == Node::QmlClass) { - out() << "
  • QML Elements
  • "; - out() << "
  • name() << "\">" << title - << "
  • "; - } - else if (node->subType() == Node::Example) { - out() << "
  • Examples
  • "; - QStringList sl = fn->name().split('/'); - QString name = "examples-" + sl.at(0) + ".html"; - QString t = CodeParser::titleFromName(name); - out() << "
  • " - << t << "
  • "; - out() << "
  • " - << title << "
  • "; - } - } - else if (node->type() == Node::Namespace) { - const NamespaceNode* nsn = static_cast(node); - out() << "
  • All Namespaces
  • "; - out() << "
  • " << title - << "
  • "; - } -} - -/*! Writes an XML file header to the current XML stream. This depends on which kind of DITA XML file is being generated, which is determined by the \a node type and subtype and the @@ -4683,7 +4540,7 @@ void DitaXmlGenerator::writeDerivations(const ClassNode* cn, CodeMarker* marker) */ void DitaXmlGenerator::writeLocation(const Node* n) { - QString s1, s2, s3; + QString s1, s2, s3, s4, s5, s6; if (n->type() == Node::Class || n->type() == Node::Namespace) { s1 = CXXCLASSAPIITEMLOCATION; s2 = CXXCLASSDECLARATIONFILE; @@ -4698,6 +4555,9 @@ void DitaXmlGenerator::writeLocation(const Node* n) s1 = CXXENUMERATIONAPIITEMLOCATION; s2 = CXXENUMERATIONDECLARATIONFILE; s3 = CXXENUMERATIONDECLARATIONFILELINE; + s4 = CXXENUMERATIONDEFINITIONFILE; + s5 = CXXENUMERATIONDEFINITIONFILELINESTART; + s6 = CXXENUMERATIONDEFINITIONFILELINEEND; } else if (n->type() == Node::Typedef) { s1 = CXXTYPEDEFAPIITEMLOCATION; @@ -4720,9 +4580,23 @@ void DitaXmlGenerator::writeLocation(const Node* n) QString lineNr; xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo())); xmlWriter().writeEndElement(); // DeclarationFileLine> - - // not included: , , - // and + if (!s4.isEmpty()) { // zzz This stuff is temporary, I think. + xmlWriter().writeStartElement(s4); + xmlWriter().writeAttribute("name","filePath"); + xmlWriter().writeAttribute("value",n->location().filePath()); + xmlWriter().writeEndElement(); // DefinitionFile> + xmlWriter().writeStartElement(s5); + xmlWriter().writeAttribute("name","lineNumber"); + xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo())); + xmlWriter().writeEndElement(); // DefinitionFileLineStart> + xmlWriter().writeStartElement(s6); + xmlWriter().writeAttribute("name","lineNumber"); + xmlWriter().writeAttribute("value",lineNr.setNum(n->location().lineNo())); + xmlWriter().writeEndElement(); // DefinitionFileLineEnd> + } + + // not included: , , + // and xmlWriter().writeEndElement(); // ApiItemLocation> } diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index e564f58..30c398b 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -133,9 +133,6 @@ class DitaXmlGenerator : public PageGenerator const Node* relative, CodeMarker* marker, const Atom* atom = 0); - void generateBreadCrumbs(const QString& title, - const Node* node, - CodeMarker* marker); void generateHeader(const Node* node, const QString& name, bool subpage = false); -- cgit v0.12