diff options
Diffstat (limited to 'tools')
28 files changed, 491 insertions, 95 deletions
diff --git a/tools/assistant/lib/qhelpprojectdata.cpp b/tools/assistant/lib/qhelpprojectdata.cpp index 83491a0..b0faf0c 100644 --- a/tools/assistant/lib/qhelpprojectdata.cpp +++ b/tools/assistant/lib/qhelpprojectdata.cpp @@ -47,6 +47,7 @@ #include <QtCore/QStack> #include <QtCore/QMap> #include <QtCore/QRegExp> +#include <QtCore/QUrl> #include <QtCore/QVariant> #include <QtXml/QXmlStreamReader> @@ -77,6 +78,7 @@ private: void readFiles(); void raiseUnknownTokenError(); void addMatchingFiles(const QString &pattern); + bool hasValidSyntax(const QString &nameSpace, const QString &vFolder) const; QMap<QString, QStringList> dirEntriesCache; }; @@ -115,16 +117,14 @@ void QHelpProjectDataPrivate::readProject() if (isStartElement()) { if (name() == QLatin1String("virtualFolder")) { virtualFolder = readElementText(); - if (virtualFolder.contains(QLatin1String("/"))) + if (!hasValidSyntax(QLatin1String("test"), virtualFolder)) raiseError(QCoreApplication::translate("QHelpProject", - "A virtual folder must not contain " - "a \'/\' character!")); + "Virtual folder has invalid syntax.")); } else if (name() == QLatin1String("namespace")) { namespaceName = readElementText(); - if (namespaceName.contains(QLatin1String("/"))) + if (!hasValidSyntax(namespaceName, QLatin1String("test"))) raiseError(QCoreApplication::translate("QHelpProject", - "A namespace must not contain a " - "\'/\' character!")); + "Namespace has invalid syntax.")); } else if (name() == QLatin1String("customFilter")) { readCustomFilter(); } else if (name() == QLatin1String("filterSection")) { @@ -318,6 +318,22 @@ void QHelpProjectDataPrivate::addMatchingFiles(const QString &pattern) filterSectionList.last().addFile(pattern); } +bool QHelpProjectDataPrivate::hasValidSyntax(const QString &nameSpace, + const QString &vFolder) const +{ + const QLatin1Char slash('/'); + if (nameSpace.contains(slash) || vFolder.contains(slash)) + return false; + QUrl url; + const QLatin1String scheme("qthelp"); + url.setScheme(scheme); + url.setHost(nameSpace); + url.setPath(vFolder); + + const QString expectedUrl(scheme + QLatin1String("://") + nameSpace + slash + vFolder); + return url.isValid() && url.toString() == expectedUrl; +} + /*! \internal \class QHelpProjectData diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp index 9b06400..0c51a02 100644 --- a/tools/assistant/tools/assistant/helpviewer.cpp +++ b/tools/assistant/tools/assistant/helpviewer.cpp @@ -63,6 +63,45 @@ QString AbstractHelpViewer::PageNotFoundMessage = "align=\"center\"><br><br><h1>The page could not be found</h1><br><h3>'%1'" "</h3></div>"); +struct ExtensionMap { + const char *extension; + const char *mimeType; +} extensionMap[] = { + { ".bmp", "image/bmp" }, + { ".css", "text/css" }, + { ".gif", "image/gif" }, + { ".html", "text/html" }, + { ".htm", "text/html" }, + { ".ico", "image/x-icon" }, + { ".jpeg", "image/jpeg" }, + { ".jpg", "image/jpeg" }, + { ".js", "application/x-javascript" }, + { ".mng", "video/x-mng" }, + { ".pbm", "image/x-portable-bitmap" }, + { ".pgm", "image/x-portable-graymap" }, + { ".pdf", "application/pdf" }, + { ".png", "image/png" }, + { ".ppm", "image/x-portable-pixmap" }, + { ".rss", "application/rss+xml" }, + { ".svg", "image/svg+xml" }, + { ".svgz", "image/svg+xml" }, + { ".text", "text/plain" }, + { ".tif", "image/tiff" }, + { ".tiff", "image/tiff" }, + { ".txt", "text/plain" }, + { ".xbm", "image/x-xbitmap" }, + { ".xml", "text/xml" }, + { ".xpm", "image/x-xpm" }, + { ".xsl", "text/xsl" }, + { ".xhtml", "application/xhtml+xml" }, + { ".wml", "text/vnd.wap.wml" }, + { ".wmlc", "application/vnd.wap.wmlc" }, + { "about:blank", 0 }, + { 0, 0 } +}; + +// -- AbstractHelpViewer + AbstractHelpViewer::AbstractHelpViewer() { } @@ -86,9 +125,22 @@ bool AbstractHelpViewer::isLocalUrl(const QUrl &url) bool AbstractHelpViewer::canOpenPage(const QString &url) { TRACE_OBJ - return url.endsWith(QLatin1String(".html"), Qt::CaseInsensitive) - || url.endsWith(QLatin1String(".htm"), Qt::CaseInsensitive) - || url == QLatin1String("about:blank"); + return !mimeFromUrl(url).isEmpty(); +} + +QString AbstractHelpViewer::mimeFromUrl(const QString &url) +{ + TRACE_OBJ + const int index = url.lastIndexOf(QLatin1Char('.')); + const QByteArray &ext = url.mid(index).toUtf8().toLower(); + + const ExtensionMap *e = extensionMap; + while (e->extension) { + if (ext == e->extension) + return QLatin1String(e->mimeType); + ++e; + } + return QLatin1String(""); } bool AbstractHelpViewer::launchWithExternalApp(const QUrl &url) diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h index 9e8f5f4..246700f 100644 --- a/tools/assistant/tools/assistant/helpviewer.h +++ b/tools/assistant/tools/assistant/helpviewer.h @@ -70,6 +70,7 @@ public: static bool isLocalUrl(const QUrl &url); static bool canOpenPage(const QString &url); + static QString mimeFromUrl(const QString &url); static bool launchWithExternalApp(const QUrl &url); }; diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp index 582d013..18046a7 100644 --- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp +++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp @@ -129,26 +129,15 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, const QNetworkRequest &request, QIODevice* /*outgoingData*/) { TRACE_OBJ - const QUrl& url = request.url(); - QString mimeType = url.toString(); - if (mimeType.endsWith(QLatin1String(".svg")) - || mimeType.endsWith(QLatin1String(".svgz"))) { - mimeType = QLatin1String("image/svg+xml"); - } else if (mimeType.endsWith(QLatin1String(".css"))) { - mimeType = QLatin1String("text/css"); - } else if (mimeType.endsWith(QLatin1String(".js"))) { - mimeType = QLatin1String("text/javascript"); - } else if (mimeType.endsWith(QLatin1String(".txt"))) { - mimeType = QLatin1String("text/plain"); - } else { - mimeType = QLatin1String("text/html"); - } - + const QUrl &url = request.url(); + const QString &mimeType = AbstractHelpViewer::mimeFromUrl(url.toString()); + HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance(); const QByteArray &data = helpEngine.findFile(url).isValid() ? helpEngine.fileData(url) : AbstractHelpViewer::PageNotFoundMessage.arg(url.toString()).toUtf8(); - return new HelpNetworkReply(request, data, mimeType); + return new HelpNetworkReply(request, data, mimeType.isEmpty() + ? QLatin1String("application/octet-stream") : mimeType); } class HelpPage : public QWebPage diff --git a/tools/linguist/linguist.pro b/tools/linguist/linguist.pro index 85ecd5a..248c89e 100644 --- a/tools/linguist/linguist.pro +++ b/tools/linguist/linguist.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs SUBDIRS = \ - linguist \ lrelease \ lupdate \ lconvert +!no-png:!contains(QT_CONFIG, no-gui):SUBDIRS += linguist diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp index 465355d..c86a9dd 100644 --- a/tools/linguist/shared/translator.cpp +++ b/tools/linguist/shared/translator.cpp @@ -45,8 +45,13 @@ #include <stdio.h> #ifdef Q_OS_WIN -#include <io.h> // required for _setmode, to avoid _O_TEXT streams... -#include <fcntl.h> // for _O_BINARY +// required for _setmode, to avoid _O_TEXT streams... +# ifdef Q_OS_WINCE +# include <stdlib.h> +# else +# include <io.h> // for _setmode +# include <fcntl.h> // for _O_BINARY +# endif #endif #include <QtCore/QDebug> @@ -213,7 +218,11 @@ bool Translator::load(const QString &filename, ConversionData &cd, const QString if (filename.isEmpty() || filename == QLatin1String("-")) { #ifdef Q_OS_WIN // QFile is broken for text files +# ifdef Q_OS_WINCE + ::_setmode(stdin, _O_BINARY); +# else ::_setmode(0, _O_BINARY); +# endif #endif if (!file.open(stdin, QIODevice::ReadOnly)) { cd.appendError(QString::fromLatin1("Cannot open stdin!? (%1)") @@ -253,7 +262,11 @@ bool Translator::save(const QString &filename, ConversionData &cd, const QString if (filename.isEmpty() || filename == QLatin1String("-")) { #ifdef Q_OS_WIN // QFile is broken for text files +# ifdef Q_OS_WINCE + ::_setmode(stdout, _O_BINARY); +# else ::_setmode(1, _O_BINARY); +# endif #endif if (!file.open(stdout, QIODevice::WriteOnly)) { cd.appendError(QString::fromLatin1("Cannot open stdout!? (%1)") diff --git a/tools/qdbus/qdbus.pro b/tools/qdbus/qdbus.pro index 01cd246..a264882 100644 --- a/tools/qdbus/qdbus.pro +++ b/tools/qdbus/qdbus.pro @@ -1,2 +1,3 @@ TEMPLATE = subdirs -SUBDIRS = qdbus qdbusxml2cpp qdbuscpp2xml qdbusviewer +SUBDIRS = qdbus qdbusxml2cpp qdbuscpp2xml +!contains(QT_CONFIG, no-gui): SUBDIRS += qdbusviewer diff --git a/tools/qdoc3/config.cpp b/tools/qdoc3/config.cpp index 3150f28..4d1c378 100644 --- a/tools/qdoc3/config.cpp +++ b/tools/qdoc3/config.cpp @@ -528,8 +528,11 @@ QString Config::findFile(const Location& location, { QStringList::ConstIterator e = fileExtensions.begin(); while (e != fileExtensions.end()) { - QString filePath = findFile(location, files, dirs, fileBase + "." + *e, - userFriendlyFilePath); + QString filePath = findFile(location, + files, + dirs, + fileBase + "." + *e, + userFriendlyFilePath); if (!filePath.isEmpty()) return filePath; ++e; diff --git a/tools/qdoc3/config.h b/tools/qdoc3/config.h index 6f23469..980d1fb 100644 --- a/tools/qdoc3/config.h +++ b/tools/qdoc3/config.h @@ -149,12 +149,16 @@ class Config #define CONFIG_PROJECT "project" #define CONFIG_QHP "qhp" #define CONFIG_QUOTINGINFORMATION "quotinginformation" +#define CONFIG_SCRIPTDIRS "scriptdirs" +#define CONFIG_SCRIPTS "scripts" #define CONFIG_SLOW "slow" #define CONFIG_SHOWINTERNAL "showinternal" #define CONFIG_SOURCEDIRS "sourcedirs" #define CONFIG_SOURCEENCODING "sourceencoding" #define CONFIG_SOURCES "sources" #define CONFIG_SPURIOUS "spurious" +#define CONFIG_STYLEDIRS "styledirs" +#define CONFIG_STYLES "styles" #define CONFIG_STYLESHEETS "stylesheets" #define CONFIG_TABSIZE "tabsize" #define CONFIG_TAGFILE "tagfile" diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index 3f955bf..24219a1 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -66,6 +66,10 @@ QStringList Generator::imageFiles; QStringList Generator::imageDirs; QStringList Generator::exampleDirs; QStringList Generator::exampleImgExts; +QStringList Generator::scriptFiles; +QStringList Generator::scriptDirs; +QStringList Generator::styleFiles; +QStringList Generator::styleDirs; QString Generator::outDir; QString Generator::project; @@ -124,10 +128,20 @@ void Generator::initialize(const Config &config) if (!dirInfo.mkdir(outDir + "/images/used-in-examples")) config.lastLocation().fatal(tr("Cannot create output directory '%1'") .arg(outDir + "/images/used-in-examples")); + if (!dirInfo.mkdir(outDir + "/scripts")) + config.lastLocation().fatal(tr("Cannot create output directory '%1'") + .arg(outDir + "/scripts")); + if (!dirInfo.mkdir(outDir + "/style")) + config.lastLocation().fatal(tr("Cannot create output directory '%1'") + .arg(outDir + "/style")); } imageFiles = config.getStringList(CONFIG_IMAGES); imageDirs = config.getStringList(CONFIG_IMAGEDIRS); + scriptFiles = config.getStringList(CONFIG_SCRIPTS); + scriptDirs = config.getStringList(CONFIG_SCRIPTDIRS); + styleFiles = config.getStringList(CONFIG_STYLES); + styleDirs = config.getStringList(CONFIG_STYLEDIRS); exampleDirs = config.getStringList(CONFIG_EXAMPLEDIRS); exampleImgExts = config.getStringList(CONFIG_EXAMPLES + Config::dot + CONFIG_IMAGEEXTENSIONS); @@ -165,6 +179,47 @@ void Generator::initialize(const Config &config) "/images"); ++e; } + + QStringList noExts; + QStringList scripts = + config.getStringList(CONFIG_SCRIPTS+Config::dot+(*g)->format()); + e = scripts.begin(); + while (e != scripts.end()) { + QString userFriendlyFilePath; + QString filePath = Config::findFile(config.lastLocation(), + scriptFiles, + scriptDirs, + *e, + noExts, + userFriendlyFilePath); + if (!filePath.isEmpty()) + Config::copyFile(config.lastLocation(), + filePath, + userFriendlyFilePath, + (*g)->outputDir() + + "/scripts"); + ++e; + } + + QStringList styles = + config.getStringList(CONFIG_STYLES+Config::dot+(*g)->format()); + e = styles.begin(); + while (e != styles.end()) { + QString userFriendlyFilePath; + QString filePath = Config::findFile(config.lastLocation(), + styleFiles, + styleDirs, + *e, + noExts, + userFriendlyFilePath); + if (!filePath.isEmpty()) + Config::copyFile(config.lastLocation(), + filePath, + userFriendlyFilePath, + (*g)->outputDir() + + "/style"); + ++e; + } } ++g; } diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h index 30d9af4..326a247 100644 --- a/tools/qdoc3/generator.h +++ b/tools/qdoc3/generator.h @@ -191,6 +191,10 @@ class Generator static QStringList imageDirs; static QStringList exampleDirs; static QStringList exampleImgExts; + static QStringList scriptFiles; + static QStringList scriptDirs; + static QStringList styleFiles; + static QStringList styleDirs; static QString outDir; static QString project; }; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index fb9fa95..ad678a9 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -333,6 +333,7 @@ QString HtmlGenerator::format() */ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) { +#if 0 // Copy the stylesheets from the directory containing the qdocconf file. // ### This should be changed to use a special directory in doc/src. QStringList::ConstIterator styleIter = stylesheets.begin(); @@ -342,7 +343,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) Config::copyFile(Location(), filePath, filePath, outputDir()); ++styleIter; } - +#endif myTree = tree; nonCompatClasses.clear(); mainClasses.clear(); @@ -1356,10 +1357,10 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, if (!inner->doc().isEmpty()) { out() << "<hr />\n" - << "<div class=\"descr\"/>\n" + << "<div class=\"descr\"/>\n" // QTBUG-9504 << "<h2>" << "Detailed Description" << "</h2>\n"; generateBody(inner, marker); - out() << "</div>\n"; + out() << "</div>\n"; // QTBUG-9504 generateAlsoList(inner, marker); } @@ -1368,7 +1369,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, while (s != sections.end()) { out() << "<hr />\n"; if (!(*s).divClass.isEmpty()) - out() << "<div class=\"" << (*s).divClass << "\"/>\n"; + out() << "<div class=\"" << (*s).divClass << "\"/>\n"; // QTBUG-9504 out() << "<h2>" << protectEnc((*s).name) << "</h2>\n"; NodeList::ConstIterator m = (*s).members.begin(); @@ -1419,7 +1420,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, ++m; } if (!(*s).divClass.isEmpty()) - out() << "</div>\n"; + out() << "</div>\n"; // QTBUG-9504 ++s; } generateFooter(inner); @@ -1591,10 +1592,14 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker) Text brief = fake->doc().briefText(); if (fake->subType() == Node::Module && !brief.isEmpty()) { out() << "<a name=\"" << registerRef("details") << "\"></a>\n"; + out() << "<div class=\"descr\"/>\n"; // QTBUG-9504 out() << "<h2>" << "Detailed Description" << "</h2>\n"; } + else + out() << "<div class=\"descr\"/>\n"; // QTBUG-9504 generateBody(fake, marker); + out() << "</div>\n"; // QTBUG-9504 generateAlsoList(fake, marker); if (!fake->groupMembers().isEmpty()) { @@ -1653,13 +1658,79 @@ QString HtmlGenerator::fileExtension(const Node * /* node */) const return "html"; } +#if 0 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>Qt Reference Documentation</title> + <link rel="stylesheet" type="text/css" href="style/style.css" /> + <!--[if IE]> + <meta name="MSSmartTagsPreventParsing" content="true"> + <meta http-equiv="imagetoolbar" content="no"> + <![endif]--> + <!--[if lt IE 7]> + <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> + <![endif]--> + <!--[if IE 7]> + <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> + <![endif]--> + <!--[if IE 8]> + <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> + <![endif]--> + + <script src="scripts/jquery.js" type="text/javascript"></script> + +</head> +#endif + void HtmlGenerator::generateHeader(const QString& title, const Node *node, CodeMarker *marker, bool mainPage) { out() << QString("<?xml version=\"1.0\" encoding=\"%1\"?>\n").arg(outputEncoding); - + out() << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"; + out() << "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n"; + out() << "<head>\n"; + out() << " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n"; + QString shortVersion; + shortVersion = project + " " + shortVersion + ": "; + if (node && !node->doc().location().isEmpty()) + out() << "<!-- " << node->doc().location().fileName() << " -->\n"; + + shortVersion = myTree->version(); + if (shortVersion.count(QChar('.')) == 2) + shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); + if (!shortVersion.isEmpty()) { + if (project == "QSA") + shortVersion = "QSA " + shortVersion + ": "; + else + shortVersion = "Qt " + shortVersion + ": "; + } + + out() << " <title>" << shortVersion << protectEnc(title) << "</title>\n"; + + //out() << " <title>Qt Reference Documentation</title>"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\" />\n"; + out() << " <!--[if IE]>\n"; + out() << " <meta name=\"MSSmartTagsPreventParsing\" content=\"true\">\n"; + out() << " <meta http-equiv=\"imagetoolbar\" content=\"no\">\n"; + out() << " <![endif]-->\n"; + out() << " <!--[if lt IE 7]>\n"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie6.css\">\n"; + out() << " <![endif]-->\n"; + out() << " <!--[if IE 7]>\n"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie7.css\">\n"; + out() << " <![endif]-->\n"; + out() << " <!--[if IE 8]>\n"; + out() << " <link rel=\"stylesheet\" type=\"text/css\" href=\"style/style_ie8.css\">\n"; + out() << " <![endif]-->\n"; + out() << " <script src=\"scripts/jquery.js\" type=\"text/javascript\"></script>\n"; + out() << " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n"; + out() << "</head>\n"; + +#if 0 out() << "<!DOCTYPE html\n" " PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"DTD/xhtml1-strict.dtd\">\n"; out() << QString("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"%1\" lang=\"%1\">\n").arg(naturalLanguage); @@ -1791,14 +1862,16 @@ void HtmlGenerator::generateHeader(const QString& title, } out() << "</head>\n" - "<body>\n"; + #endif + out() << "<body class=\"\">\n"; if (mainPage) generateMacRef(node, marker); out() << QString(postHeader).replace("\\" + COMMAND_VERSION, myTree->version()); - +#if 0 if (node && !node->links().empty()) out() << "<p>\n" << navigationLinks << "</p>\n"; +#endif } void HtmlGenerator::generateTitle(const QString& title, @@ -1857,6 +1930,9 @@ void HtmlGenerator::generateIncludes(const InnerNode *inner, CodeMarker *marker) } } +/*! + Generates a table of contents begining at \a node. + */ void HtmlGenerator::generateTableOfContents(const Node *node, CodeMarker *marker, Doc::SectioningUnit sectioningUnit, @@ -2172,7 +2248,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, QString commonPrefix) { const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' - const int NumColumns = 4; // number of columns in the result + const int NumColumns = 2; // number of columns in the result if (classMap.isEmpty()) return; diff --git a/tools/qdoc3/location.cpp b/tools/qdoc3/location.cpp index 19625da..dee87d1 100644 --- a/tools/qdoc3/location.cpp +++ b/tools/qdoc3/location.cpp @@ -265,6 +265,8 @@ void Location::error(const QString& message, const QString& details) const void Location::fatal(const QString& message, const QString& details) const { emitMessage(Error, message, details); + information(message); + information(details); information("Aborting"); exit(EXIT_FAILURE); } diff --git a/tools/qdoc3/pagegenerator.cpp b/tools/qdoc3/pagegenerator.cpp index f0f14fe..b701565 100644 --- a/tools/qdoc3/pagegenerator.cpp +++ b/tools/qdoc3/pagegenerator.cpp @@ -217,6 +217,8 @@ void PageGenerator::generateInnerNode(const InnerNode *node, if (node->parent() != 0) { beginSubPage(node->location(), fileName(node)); + // <!--Put all your content here--> + //generateTableOfContents(node,marker,Doc::Section4,1,relative); if (node->type() == Node::Namespace || node->type() == Node::Class) { generateClassLikeNode(node, marker); } diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf index 63455f1..5308afd 100644 --- a/tools/qdoc3/test/assistant.qdocconf +++ b/tools/qdoc3/test/assistant.qdocconf @@ -40,6 +40,7 @@ exampledirs = $QT_SOURCE_TREE \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src -imagedirs = $QT_SOURCE_TREE/doc/src/images +imagedirs = $QT_SOURCE_TREE/doc/src/images \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc-build/html-assistant base = file:$QT_BUILD_TREE/doc-build/html-assistant diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf index b0c88f1..2eb3d96 100644 --- a/tools/qdoc3/test/designer.qdocconf +++ b/tools/qdoc3/test/designer.qdocconf @@ -46,6 +46,7 @@ exampledirs = $QT_SOURCE_TREE \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src -imagedirs = $QT_SOURCE_TREE/doc/src/images +imagedirs = $QT_SOURCE_TREE/doc/src/images \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc-build/html-designer base = file:$QT_BUILD_TREE/doc-build/html-designer diff --git a/tools/qdoc3/test/jambi.qdocconf b/tools/qdoc3/test/jambi.qdocconf index 04bb51b..aa87826 100644 --- a/tools/qdoc3/test/jambi.qdocconf +++ b/tools/qdoc3/test/jambi.qdocconf @@ -16,7 +16,8 @@ outputdir = $JAMBI/doc/html/com/trolltech/qt imagedirs = $QTDIR/doc/src/images \ $QTDIR/examples \ $JAMBI/doc/src/images \ - ../doc/src/images + ../doc/src/images \ + $QTDIR/doc/src/template/images extraimages.javadoc = qt-logo \ qt-logo.png diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf index 6acd2c6..ac536be 100644 --- a/tools/qdoc3/test/linguist.qdocconf +++ b/tools/qdoc3/test/linguist.qdocconf @@ -42,6 +42,7 @@ exampledirs = $QT_SOURCE_TREE \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src -imagedirs = $QT_SOURCE_TREE/doc/src/images +imagedirs = $QT_SOURCE_TREE/doc/src/images \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc-build/html-linguist base = file:$QT_BUILD_TREE/doc-build/html-linguist diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf index e5b883a..03514c1 100644 --- a/tools/qdoc3/test/qdeclarative.qdocconf +++ b/tools/qdoc3/test/qdeclarative.qdocconf @@ -58,7 +58,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/declarative/pics + $QT_SOURCE_TREE/doc/src/declarative/pics \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc-build/html-qml tagfile = $QT_BUILD_TREE/doc-build/html-qml/qt.tags base = file:$QT_BUILD_TREE/doc/html-qml diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf index 76e7012..bd47028 100644 --- a/tools/qdoc3/test/qmake.qdocconf +++ b/tools/qdoc3/test/qmake.qdocconf @@ -35,6 +35,7 @@ exampledirs = $QT_SOURCE_TREE \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src -imagedirs = $QT_SOURCE_TREE/doc/src/images +imagedirs = $QT_SOURCE_TREE/doc/src/images \ + $QT_SOURCE_TREE/doc/src/template/images outputdir = $QT_BUILD_TREE/doc-build/html-qmake base = file:$QT_BUILD_TREE/doc-build/html-qmake diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index fb2c3c1..c9392c0 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -106,7 +106,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/declarative/pics + $QT_SOURCE_TREE/doc/src/declarative/pics \ + $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_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf index 7a77f54..19db8a9 100644 --- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf @@ -76,7 +76,8 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ $QT_SOURCE_TREE/qmake/examples \ $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs imagedirs = $QT_SOURCE_TREE/doc/src/images \ - $QT_SOURCE_TREE/examples + $QT_SOURCE_TREE/examples \ + $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/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf index b22727f..e1a008e 100644 --- a/tools/qdoc3/test/qt-defines.qdocconf +++ b/tools/qdoc3/test/qt-defines.qdocconf @@ -19,8 +19,48 @@ codeindent = 1 # See also qhp.Qt.extraFiles extraimages.HTML = qt-logo \ trolltech-logo \ + api_examples.png \ + bg_ll.png \ + bg_ul_blank.png \ + bullet_gt.png \ + horBar.png \ + qt_ref_doc.png \ + api_lookup.png \ + bg_ll_blank.png \ + bg_ur.png \ + bullet_sq.png \ + page_bg.png \ + qt_tools.png \ + api_topics.png \ + bg_lr.png \ + bg_ur_blank.png \ + content_bg.png \ + print.png \ + sep.png \ + bg_l.png \ + bg_r.png \ + box_bg.png \ + feedbackground.png \ + qt_guide.png \ + sprites-combined.png \ + bg_l_blank.png \ + bg_ul.png \ + breadcrumb.png \ + form_bg.png \ + qt_icon.png \ taskmenuextension-example.png \ coloreditorfactoryimage.png \ dynamiclayouts-example.png \ stylesheet-coffee-plastique.png -
\ No newline at end of file + +# This stuff is used by the new doc format. +scriptdirs = $QTDIR/doc/src/template/scripts +styledirs = $QTDIR/doc/src/template/style + +scripts.HTML = functions.js \ + jquery.js + +styles.HTML = style.css \ + style_ie6.css \ + style_ie7.css \ + style_ie8.css diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index 60d6b61..5bb4382 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -1,25 +1,145 @@ -HTML.stylesheets = classic.css -HTML.postheader = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n" \ - "<tr>\n" \ - "<td align=\"left\" valign=\"top\" width=\"32\">" \ - "<a href=\"http://qt.nokia.com/\"><img src=\"images/qt-logo.png\" align=\"left\" border=\"0\" /></a>" \ - "</td>\n" \ - "<td width=\"1\"> </td>" \ - "<td class=\"postheader\" valign=\"center\">" \ - "<a href=\"index.html\">" \ - "<font color=\"#004faf\">Home</font></a> ·" \ - " <a href=\"classes.html\">" \ - "<font color=\"#004faf\">All Classes</font></a> ·" \ - " <a href=\"functions.html\">" \ - "<font color=\"#004faf\">All Functions</font></a> ·" \ - " <a href=\"overviews.html\">" \ - "<font color=\"#004faf\">Overviews</font></a>" \ - "</td>" \ - "</tr></table>" +HTML.stylesheets = style/style.css +HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \ + " <div id=\"nav-logo\">\n" \ + " <a href=\"index.html\">Home</a></div>\n" \ + " <a href=\"#\" class=\"qtref\"><span>Qt Reference Documentation</span></a>\n" \ + " <div id=\"nav-topright\">\n" \ + " <ul>\n" \ + " <li class=\"nav-topright-home\"><a href=\"http://qt.nokia.com/\">Qt HOME</a></li>\n" \ + " <li class=\"nav-topright-dev\"><a href=\"http://qt.nokia.com/developer\">DEV</a></li>\n" \ + " <li class=\"nav-topright-labs\"><a href=\"http://labs.qt.nokia.com/blogs/\">LABS</a></li>\n" \ + " <li class=\"nav-topright-doc nav-topright-doc-active\"><a href=\"http://doc.qt.nokia.com/\">\n" \ + " DOC</a></li>\n" \ + " <li class=\"nav-topright-blog\"><a href=\"http://blog.qt.nokia.com/\">BLOG</a></li>\n" \ + " <li class=\"nav-topright-shop\"><a title=\"SHOP\" href=\"http://shop.qt.nokia.com\">SHOP</a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div id=\"shortCut\">\n" \ + " <ul>\n" \ + " <li class=\"shortCut-topleft-inactive\"><span><a href=\"index.html\">VERSION 4.7</a></span></li>\n" \ + " <li class=\"shortCut-topleft-active\"><a href=\"http://qt.nokia.com/doc/\">ALL QT VERSIONS" \ + " </a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"wrapper\">\n" \ + " <div class=\"hd\">\n" \ + " <span></span>\n" \ + " </div>\n" \ + " <div class=\"bd group\">\n" \ + " <div class=\"sidebar\">\n" \ + " <div class=\"searchlabel\">\n" \ + " Search index:</div>\n" \ + " <div class=\"search\">\n" \ + " <form id=\"qtdocsearch\" action=\"#\">\n" \ + " <fieldset>\n" \ + " <input type=\"text\" name=\"searchstring\" id=\"searchstring\" value=\"\" onkeyup=\"doSearch(this.value);\" />\n" \ + " </fieldset>\n" \ + " </form>\n" \ + " </div>\n" \ + " <div class=\"box first bottombar\" id=\"lookup\">\n" \ + " <h2>\n" \ + " API Lookup</h2>\n" \ + " <div class=\"list\">\n" \ + " <ul>\n" \ + " <li><a href=\"modules.html\">All modules</a></li>\n" \ + " <li><a href=\"classes.html\">All classes</a></li>\n" \ + " <li><a href=\"functions.html\">All functions</a></li>\n" \ + " <li><a href=\"platform-specific.html\">Platform specifics</a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div class=\"live\">\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"box bottombar\" id=\"topics\">\n" \ + " <h2>\n" \ + " API Topics</h2>\n" \ + " <div class=\"list\">\n" \ + " <ul>\n" \ + " <li><a href=\"object.html\">QObject model</a></li>\n" \ + " <li><a href=\"eventsandfilters.html\">Events, signals & slots</a></li>\n" \ + " <li><a href=\"paintsystem.html\">Graphics & Paint system</a></li>\n" \ + " <li><a href=\"declarativeui.html\">Qt Quick</a></li>\n" \ + " <li><a href=\"widgets-and-layouts.html\">Widget style & layout</a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div class=\"live\">\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"box\" id=\"examples\">\n" \ + " <h2>\n" \ + " API Examples</h2>\n" \ + " <div class=\"list\">\n" \ + " <ul>\n" \ + " <li><a href=\"examples.html\">All examples</a></li>\n" \ + " <li><a href=\"tutorials.html\">All tutorials</a></li>\n" \ + " <li><a href=\"#\">Qt Quick examples</a></li>\n" \ + " <li><a href=\"#\">Desktop examples</a></li>\n" \ + " <li><a href=\"#\">Device examples</a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div class=\"live\">\n" \ + " </div>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"wrap\">\n" \ + " <div class=\"toolbar\">\n" \ + " <div class=\"breadcrumb toolblock\">\n" \ + " <ul>\n" \ + " <li class=\"first\"><a href=\"index.html\">Home</a></li>\n" \ + " <!-- Bread crumbs goes here -->\n" \ + " </ul>\n" \ + " </div>\n" \ + " <div class=\"toolbuttons toolblock\">\n" \ + " <ul>\n" \ + " <li id=\"smallA\" class=\"t_button\">A</li>\n" \ + " <li id=\"medA\" class=\"t_button active\">A</li>\n" \ + " <li id=\"bigA\" class=\"t_button\">A</li>\n" \ + " <li id=\"print\" class=\"t_button\"><a href=\"javascript:this.print();\">\n" \ + " <img src=\"images/sep.png\" /><img id=\"printIcon\" src=\"images/print.png\" alt=\"Print this page\" /></a></li>\n" \ + " </ul>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"content\">\n" -HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \ - "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \ - "<td width=\"40%\" align=\"left\">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \ - "<td width=\"20%\" align=\"center\"><a href=\"trademarks.html\">Trademarks</a></td>\n" \ - "<td width=\"40%\" align=\"right\"><div align=\"right\">Qt \\version</div></td>\n" \ - "</tr></table></div></address>" +HTML.footer = " </div>\n" \ + " <div class=\"feedback t_button\" onclick=\"$(\'#feedbackBox\').show();$(\'#blurpage\').show()\">\n" \ + " [+] Documentation Feedback</div>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"ft\">\n" \ + " <span></span>\n" \ + " </div>\n" \ + " </div>\n" \ + " <div class=\"footer\">\n" \ + " <p>\n" \ + " <acronym title=\"Copyright\">©</acronym> 2008-2010 Nokia Corporation and/or its>\n" \ + " subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation>\n" \ + " in Finland and/or other countries worldwide.</p>\n" \ + " <p>\n" \ + " All other trademarks are property of their respective owners. <a title=\"Privacy Policy\">\n" \ + " href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy</a></p>\n" \ + " </div>\n" \ + " <div id=\"feedbackBox\">\n" \ + " <form action=\"#\">\n" \ + " <div id=\"feedcloseX\">\n" \ + " <a href=\"#\" onclick=\"$(\'#feedbackBox\').hide();$(\'#blurpage\').hide()\">X</a>\n" \ + " </div>\n" \ + " <textarea id=\"feedbox\" rows=\"5\" cols=\"40\">Please submit you feedback...</textarea>\n" \ + " <input id=\"feedsubmit\" type=\"submit\" onclick=\"$(\'#feedbackBox\').hide();$(\'#blurpage\').hide()\">\n" \ + " name=\"feedback\" />\n" \ + " </form>\n" \ + " </div>\n" \ + " <div id=\"blurpage\">\n" \ + " </div>\n" \ + " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n" \ + "<script type=\"text/javascript\">\n" \ + " var _gaq = _gaq || [];>\n" \ + " _gaq.push([\'_setAccount\', \'UA-4457116-5\']);>\n" \ + " _gaq.push([\'_trackPageview\']);>\n" \ + " (function() {>\n" \ + " var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;>\n" \ + " ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';>\n" \ + " var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);>\n" \ + " })();>\n" \ + "</script>\n" diff --git a/tools/qdoc3/test/qt-webxml.qdocconf b/tools/qdoc3/test/qt-webxml.qdocconf index 3ad0457..80ced42 100644 --- a/tools/qdoc3/test/qt-webxml.qdocconf +++ b/tools/qdoc3/test/qt-webxml.qdocconf @@ -2,7 +2,8 @@ include(qt.qdocconf) quotinginformation = true imagedirs = $QTDIR/doc/src/images \ - $QTDIR/examples + $QTDIR/examples \ + $QTDIR/doc/src/template/images outputdir = $QTDIR/doc/webxml outputformats = WebXML diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf index d8b9136..29b49e2 100644 --- a/tools/qdoc3/test/qt.qdocconf +++ b/tools/qdoc3/test/qt.qdocconf @@ -108,7 +108,8 @@ exampledirs = $QTDIR/doc/src \ $QTDIR/src/3rdparty/webkit/WebKit/qt/docs imagedirs = $QTDIR/doc/src/images \ $QTDIR/examples \ - $QTDIR/doc/src/declarative/pics + $QTDIR/doc/src/declarative/pics \ + $QTDIR/doc/src/template/images outputdir = $QTDIR/doc/html tagfile = $QTDIR/doc/html/qt.tags base = file:$QTDIR/doc/html diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf index 8c7e64a..980c542 100644 --- a/tools/qdoc3/test/qt_zh_CN.qdocconf +++ b/tools/qdoc3/test/qt_zh_CN.qdocconf @@ -78,7 +78,8 @@ exampledirs = $QTDIR/doc/src \ $QTDIR/qmake/examples \ $QTDIR/src/3rdparty/webkit/WebKit/qt/docs imagedirs = $QTDIR/doc/src/images \ - $QTDIR/examples + $QTDIR/examples \ + $QTDIR/doc/src/template/images outputdir = $QTDIR/doc/html_zh_CN tagfile = $QTDIR/doc/html_zh_CN/qt.tags base = file:$QTDIR/doc/html_zh_CN diff --git a/tools/tools.pro b/tools/tools.pro index 3ed07b1..7598962 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -1,32 +1,39 @@ TEMPLATE = subdirs -no-png { - message("Some graphics-related tools are unavailable without PNG support") -} else { - SUBDIRS += assistant \ - pixeltool \ - porting \ - qtestlib \ - qttracereplay - contains(QT_EDITION, Console) { - SUBDIRS += designer/src/uitools # Linguist depends on this - } else { - SUBDIRS += designer - } - SUBDIRS += linguist - symbian: SUBDIRS = designer - wince*: SUBDIRS = qtestlib designer - unix:!mac:!embedded:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig - win32:!wince*:SUBDIRS += activeqt +!contains(QT_CONFIG, no-gui) { + no-png { + message("Some graphics-related tools are unavailable without PNG support") + } else { + symbian { + SUBDIRS = designer + } else:wince* { + SUBDIRS = qtestlib designer + } else { + SUBDIRS = assistant \ + pixeltool \ + porting \ + qtestlib \ + qttracereplay + contains(QT_EDITION, Console) { + SUBDIRS += designer/src/uitools # Linguist depends on this + } else { + SUBDIRS += designer + } + } + unix:!mac:!embedded:contains(QT_CONFIG, qt3support):SUBDIRS += qtconfig + win32:!wince*:SUBDIRS += activeqt + } + contains(QT_CONFIG, declarative):SUBDIRS += qml } +!wince*:!symbian:SUBDIRS += linguist + mac { SUBDIRS += macdeployqt } embedded:SUBDIRS += kmap2qmap -contains(QT_CONFIG, declarative):SUBDIRS += qml contains(QT_CONFIG, dbus):SUBDIRS += qdbus !wince*:contains(QT_CONFIG, xmlpatterns): SUBDIRS += xmlpatterns xmlpatternsvalidator embedded: SUBDIRS += makeqpf |