summaryrefslogtreecommitdiffstats
path: root/tools/qdoc3
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qdoc3')
-rw-r--r--tools/qdoc3/htmlgenerator.cpp197
-rw-r--r--tools/qdoc3/qdoc3.pro15
-rw-r--r--tools/qdoc3/test/assistant.qdocconf1
-rw-r--r--tools/qdoc3/test/designer.qdocconf1
-rw-r--r--tools/qdoc3/test/linguist.qdocconf1
-rw-r--r--tools/qdoc3/test/qdeclarative.qdocconf1
-rw-r--r--tools/qdoc3/test/qmake.qdocconf1
-rw-r--r--tools/qdoc3/test/qt-build-docs.qdocconf1
-rw-r--r--tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf1
-rw-r--r--tools/qdoc3/test/qt-defines.qdocconf1
-rw-r--r--tools/qdoc3/test/qt-html-templates.qdocconf18
-rw-r--r--tools/qdoc3/test/qt.qdocconf1
-rw-r--r--tools/qdoc3/test/qt_zh_CN.qdocconf1
13 files changed, 106 insertions, 134 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp
index dda2cf3..16df0c0 100644
--- a/tools/qdoc3/htmlgenerator.cpp
+++ b/tools/qdoc3/htmlgenerator.cpp
@@ -434,6 +434,9 @@ void HtmlGenerator::startText(const Node * /* relative */,
sectionNumber.clear();
}
+/*!
+ Generate html from an instance of Atom.
+ */
int HtmlGenerator::generateAtom(const Atom *atom,
const Node *relative,
CodeMarker *marker)
@@ -1217,6 +1220,9 @@ int HtmlGenerator::generateAtom(const Atom *atom,
return skipAhead;
}
+/*!
+ Generate a reference page for a C++ class.
+ */
void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
CodeMarker *marker)
{
@@ -1466,6 +1472,10 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner,
appendDcfSubSection(&dcfClassesRoot, classSection);
}
+/*!
+ Generate the html page for a qdoc file that doesn't map
+ to an underlying c++ file.
+ */
void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
{
SubTitleSize subTitleSize = LargeSubTitle;
@@ -1682,6 +1692,9 @@ void HtmlGenerator::generateFakeNode(const FakeNode *fake, CodeMarker *marker)
}
}
+/*!
+ Returns "html" for this subclass of Generator.
+ */
QString HtmlGenerator::fileExtension(const Node * /* node */) const
{
return "html";
@@ -1735,10 +1748,10 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title,
}
else if (node->subType() == Node::Page) {
if (fn->name() == QString("examples.html")) {
- out() << " <li><a href=\"examples.html\">All Examples</a></li>";
+ out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
}
else if (fn->name().startsWith("examples-")) {
- out() << " <li><a href=\"examples.html\">All Examples</a></li>";
+ out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
out() << " <li><a href=\"" << fn->name() << "\">" << title
<< "</a></li>";
}
@@ -1756,7 +1769,7 @@ void HtmlGenerator::generateBreadCrumbs(const QString& title,
<< "</a></li>";
}
else if (node->subType() == Node::Example) {
- out() << " <li><a href=\"examples.html\">All Examples</a></li>";
+ out() << " <li><a href=\"all-examples.html\">Examples</a></li>";
QStringList sl = fn->name().split('/');
QString name = "examples-" + sl.at(0) + ".html";
QString t = CodeParser::titleFromName(name);
@@ -1781,7 +1794,7 @@ void HtmlGenerator::generateHeader(const QString& title,
{
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() << QString("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"%1\" lang=\"%1\">\n").arg(naturalLanguage);
out() << "<head>\n";
out() << " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
QString shortVersion;
@@ -2332,7 +2345,6 @@ void HtmlGenerator::generateCompactList(const Node *relative,
QString commonPrefix)
{
const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_'
- const int NumColumns = 3; // number of columns in the result
if (classMap.isEmpty())
return;
@@ -2415,18 +2427,18 @@ void HtmlGenerator::generateCompactList(const Node *relative,
else
key = pieces.last().toLower();
- int paragraphNo = NumParagraphs - 1;
+ int paragraphNr = NumParagraphs - 1;
if (key[0].digitValue() != -1) {
- paragraphNo = key[0].digitValue();
+ paragraphNr = key[0].digitValue();
}
else if (key[0] >= QLatin1Char('a') && key[0] <= QLatin1Char('z')) {
- paragraphNo = 10 + key[0].unicode() - 'a';
+ paragraphNr = 10 + key[0].unicode() - 'a';
}
- paragraphName[paragraphNo] = key[0].toUpper();
+ paragraphName[paragraphNr] = key[0].toUpper();
usedParagraphNames.insert(key[0].toLower().cell());
- paragraph[paragraphNo].insert(key, c.value());
+ paragraph[paragraphNr].insert(key, c.value());
++c;
}
@@ -2439,36 +2451,16 @@ void HtmlGenerator::generateCompactList(const Node *relative,
start at offsets 0, 3, 4, 8, 9, 14, 23.
*/
int paragraphOffset[NumParagraphs + 1]; // 37 + 1
- int i, j, k;
-
paragraphOffset[0] = 0;
- for (j = 0; j < NumParagraphs; j++) // j = 0..36
- paragraphOffset[j + 1] = paragraphOffset[j] + paragraph[j].count();
-
- int firstOffset[NumColumns + 1];
- int currentOffset[NumColumns];
- int currentParagraphNo[NumColumns];
- int currentOffsetInParagraph[NumColumns];
-
- int numRows = (classMap.count() + NumColumns - 1) / NumColumns;
- int curParagNo = 0;
+ for (int i=0; i<NumParagraphs; i++) // i = 0..36
+ paragraphOffset[i+1] = paragraphOffset[i] + paragraph[i].count();
- for (i = 0; i < NumColumns; i++) {
- firstOffset[i] = qMin(i * numRows, classMap.size());
- currentOffset[i] = firstOffset[i];
-
- for (j = curParagNo; j < NumParagraphs; j++) {
- if (paragraphOffset[j] > firstOffset[i])
- break;
- if (paragraphOffset[j] <= firstOffset[i])
- curParagNo = j;
- }
- currentParagraphNo[i] = curParagNo;
- currentOffsetInParagraph[i] = firstOffset[i] -
- paragraphOffset[curParagNo];
- }
- firstOffset[NumColumns] = classMap.count();
+ int curParNr = 0;
+ int curParOffset = 0;
+ /*
+ Output the alphabet as a row of links.
+ */
if (includeAlphabet) {
out() << "<p class=\"centerAlign functionIndex\"><b>";
for (int i = 0; i < 26; i++) {
@@ -2479,81 +2471,74 @@ void HtmlGenerator::generateCompactList(const Node *relative,
out() << "</b></p>\n";
}
- out() << "<table class=\"generic\">\n";
- for (k = 0; k < numRows; k++) {
- if (++numTableRows % 2 == 1)
- out() << "<tr class=\"odd topAlign\">";
- else
- out() << "<tr class=\"even topAlign\">";
- //break;
+ /*
+ Output a <div> element to contain all the <dl> elements.
+ */
+ out() << "<div class=\"flowListDiv\">\n";
-// out() << "<tr>\n";
- for (i = 0; i < NumColumns; i++) {
- if (currentOffset[i] >= firstOffset[i + 1]) {
- // this column is finished
- out() << "<td>\n</td>\n"; // check why?
- }
- else {
- while ((currentParagraphNo[i] < NumParagraphs) &&
- (currentOffsetInParagraph[i] == paragraph[currentParagraphNo[i]].count())) {
- ++currentParagraphNo[i];
- currentOffsetInParagraph[i] = 0;
- }
-#if 0
- if (currentParagraphNo[i] >= NumParagraphs) {
- qDebug() << "### Internal error ###" << __FILE__ << __LINE__
- << currentParagraphNo[i] << NumParagraphs;
- currentParagraphNo[i] = NumParagraphs - 1;
- }
-#endif
- out() << "<th class=\"rightAlign alphaChar\"><p>";
- if (currentOffsetInParagraph[i] == 0) {
- // start a new paragraph
- if (includeAlphabet) {
- QChar c = paragraphName[currentParagraphNo[i]][0].toLower();
- out() << QString("<a name=\"%1\"></a>").arg(c);
- }
- out() << "<b>"
- << paragraphName[currentParagraphNo[i]]
- << "</b>";
- }
- out() << "</p></th>\n";
+ for (int i=0; i<classMap.count()-1; i++) {
+ while ((curParNr < NumParagraphs) &&
+ (curParOffset == paragraph[curParNr].count())) {
+ ++curParNr;
+ curParOffset = 0;
+ }
- out() << "<td><p>";
- if ((currentParagraphNo[i] < NumParagraphs) &&
- !paragraphName[currentParagraphNo[i]].isEmpty()) {
- NodeMap::Iterator it;
- it = paragraph[currentParagraphNo[i]].begin();
- for (j = 0; j < currentOffsetInParagraph[i]; j++)
- ++it;
-
- // Previously, we used generateFullName() for this, but we
- // require some special formatting.
- out() << "<a href=\""
- << linkForNode(it.value(), relative)
- << "\">";
- QStringList pieces;
- if (it.value()->subType() == Node::QmlClass)
- pieces << it.value()->name();
- else
- pieces = fullName(it.value(), relative, marker).split("::");
- out() << protectEnc(pieces.last());
- out() << "</a>";
- if (pieces.size() > 1) {
- out() << " (";
- generateFullName(it.value()->parent(), relative, marker);
- out() << ")";
- }
- }
- out() << "</p></td>\n";
+ /*
+ Starting a new paragraph means starting a new <dl>.
+ */
+ if (curParOffset == 0) {
+ if (i > 0)
+ out() << "</dl>\n";
+ if (++numTableRows % 2 == 1)
+ out() << "<dl class=\"flowList odd\">";
+ else
+ out() << "<dl class=\"flowList even\">";
+ out() << "<dt class=\"alphaChar\">";
+ if (includeAlphabet) {
+ QChar c = paragraphName[curParNr][0].toLower();
+ out() << QString("<a name=\"%1\"></a>").arg(c);
+ }
+ out() << "<b>"
+ << paragraphName[curParNr]
+ << "</b>";
+ out() << "</dt>\n";
+ }
- currentOffset[i]++;
- currentOffsetInParagraph[i]++;
+ /*
+ Output a <dd> for the current offset in the current paragraph.
+ */
+ out() << "<dd>";
+ if ((curParNr < NumParagraphs) &&
+ !paragraphName[curParNr].isEmpty()) {
+ NodeMap::Iterator it;
+ it = paragraph[curParNr].begin();
+ for (int i=0; i<curParOffset; i++)
+ ++it;
+
+ /*
+ Previously, we used generateFullName() for this, but we
+ require some special formatting.
+ */
+ out() << "<a href=\"" << linkForNode(it.value(), relative) << "\">";
+
+ QStringList pieces;
+ if (it.value()->subType() == Node::QmlClass)
+ pieces << it.value()->name();
+ else
+ pieces = fullName(it.value(), relative, marker).split("::");
+ out() << protectEnc(pieces.last());
+ out() << "</a>";
+ if (pieces.size() > 1) {
+ out() << " (";
+ generateFullName(it.value()->parent(), relative, marker);
+ out() << ")";
}
}
- out() << "</tr>\n";
+ out() << "</dd>\n";
+ curParOffset++;
}
- out() << "</table>\n";
+ out() << "</dl>\n";
+ out() << "</div>\n";
}
void HtmlGenerator::generateFunctionIndex(const Node *relative,
diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro
index e394799..81ff93a 100644
--- a/tools/qdoc3/qdoc3.pro
+++ b/tools/qdoc3/qdoc3.pro
@@ -115,20 +115,7 @@ SOURCES += apigenerator.cpp \
### Documentation for qdoc3 ###
-win32:!win32-g++ {
- unixstyle = false
-} else :win32-g++:isEmpty(QMAKE_SH) {
- unixstyle = false
-} else {
- unixstyle = true
-}
-
-$$unixstyle {
- QDOC = cd $$PWD/doc && $$[QT_INSTALL_BINS]/qdoc3
-} else {
- QDOC = cd $$PWD/doc && $$[QT_INSTALL_BINS]/qdoc3.exe
- QDOC = $$replace(QDOC, "/", "\\")
-}
+qtPrepareTool(QDOC, qdoc3)
docs.commands = $$QDOC qdoc-manual.qdocconf
diff --git a/tools/qdoc3/test/assistant.qdocconf b/tools/qdoc3/test/assistant.qdocconf
index 3711ec4..167bb19 100644
--- a/tools/qdoc3/test/assistant.qdocconf
+++ b/tools/qdoc3/test/assistant.qdocconf
@@ -30,6 +30,7 @@ qhp.Assistant.extraFiles = images/bg_l.png \
images/page.png \
images/page_bg.png \
images/sprites-combined.png \
+ images/spinner.gif \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \
diff --git a/tools/qdoc3/test/designer.qdocconf b/tools/qdoc3/test/designer.qdocconf
index 39da68b..48e3ea1 100644
--- a/tools/qdoc3/test/designer.qdocconf
+++ b/tools/qdoc3/test/designer.qdocconf
@@ -30,6 +30,7 @@ qhp.Designer.extraFiles = images/bg_l.png \
images/page.png \
images/page_bg.png \
images/sprites-combined.png \
+ images/spinner.gif \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \
diff --git a/tools/qdoc3/test/linguist.qdocconf b/tools/qdoc3/test/linguist.qdocconf
index dba4fb5..8974bd7 100644
--- a/tools/qdoc3/test/linguist.qdocconf
+++ b/tools/qdoc3/test/linguist.qdocconf
@@ -30,6 +30,7 @@ qhp.Linguist.extraFiles = images/bg_l.png \
images/page.png \
images/page_bg.png \
images/sprites-combined.png \
+ images/spinner.gif \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \
diff --git a/tools/qdoc3/test/qdeclarative.qdocconf b/tools/qdoc3/test/qdeclarative.qdocconf
index f744879..0f2e381 100644
--- a/tools/qdoc3/test/qdeclarative.qdocconf
+++ b/tools/qdoc3/test/qdeclarative.qdocconf
@@ -41,6 +41,7 @@ qhp.Qml.extraFiles = images/bg_l.png \
images/page.png \
images/page_bg.png \
images/sprites-combined.png \
+ images/spinner.png \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \
diff --git a/tools/qdoc3/test/qmake.qdocconf b/tools/qdoc3/test/qmake.qdocconf
index b7f4115..ea58059 100644
--- a/tools/qdoc3/test/qmake.qdocconf
+++ b/tools/qdoc3/test/qmake.qdocconf
@@ -30,6 +30,7 @@ qhp.qmake.extraFiles = images/bg_l.png \
images/page.png \
images/page_bg.png \
images/sprites-combined.png \
+ images/spinner.gif \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \
diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf
index d3c855f..bd363a6 100644
--- a/tools/qdoc3/test/qt-build-docs.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs.qdocconf
@@ -36,6 +36,7 @@ qhp.Qt.extraFiles = index.html \
images/page.png \
images/page_bg.png \
images/sprites-combined.png \
+ images/spinner.gif \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \
diff --git a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
index e9bc00c..caf5f73 100644
--- a/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
+++ b/tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf
@@ -44,6 +44,7 @@ qhp.Qt.extraFiles = index.html \
images/page.png \
images/page_bg.png \
images/sprites-combined.png \
+ images/spinner.gif \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \
diff --git a/tools/qdoc3/test/qt-defines.qdocconf b/tools/qdoc3/test/qt-defines.qdocconf
index f3291df..3e71d07 100644
--- a/tools/qdoc3/test/qt-defines.qdocconf
+++ b/tools/qdoc3/test/qt-defines.qdocconf
@@ -34,6 +34,7 @@ extraimages.HTML = qt-logo \
page.png \
page_bg.png \
sprites-combined.png \
+ spinner.gif \
taskmenuextension-example.png \
coloreditorfactoryimage.png \
dynamiclayouts-example.png \
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index e83e666..b72a1eb 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -54,8 +54,6 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" <li class=\"defaultLink\"><a href=\"qdeclarativeelements.html\">QML elements</a></li>\n" \
" </ul> \n" \
" </div>\n" \
- " <div id=\"live001\" class=\"live\">\n" \
- " </div>\n" \
" </div>\n" \
" <div class=\"box bottombar\" id=\"topics\">\n" \
" <h2><span></span>\n" \
@@ -68,8 +66,6 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" <li class=\"defaultLink\"><a href=\"platform-specific.html\">Platform-specific info</a></li>\n" \
" </ul> \n" \
" </div>\n" \
- " <div id=\"live002\" class=\"live\">\n" \
- " </div>\n" \
" </div>\n" \
" <div class=\"box\" id=\"examples\">\n" \
" <h2><span></span>\n" \
@@ -83,8 +79,6 @@ HTML.postheader = " <div class=\"header\" id=\"qtdocheader\">\n" \
" <li class=\"defaultLink\"><a href=\"qdeclarativeexamples.html#Demos\">QML Demos</a></li>\n" \
" </ul> \n" \
" </div>\n" \
- " <div id=\"live003\" class=\"live\">\n" \
- " </div>\n" \
" </div>\n" \
" </div>\n" \
" <div class=\"wrap\">\n" \
@@ -109,7 +103,7 @@ HTML.postpostheader = " </ul>\n" \
" <div class=\"content\">\n"
HTML.footer = " <!-- /div -->\n" \
- " <div class=\"feedback t_button\" onclick=\"\$(\'.bd\').hide();\$(\'.hd\').hide();\$(\'.footer\').hide();\$(\'#feedbackBox\').show();\$(\'#blurpage\').show()\">\n" \
+ " <div class=\"feedback t_button\">\n" \
" [+] Documentation Feedback</div>\n" \
" </div>\n" \
" </div>\n" \
@@ -127,14 +121,10 @@ HTML.footer = " <!-- /div -->\n" \
" href=\"http://qt.nokia.com/about/privacy-policy\">Privacy Policy</a></p>\n" \
" </div>\n" \
" <div id=\"feedbackBox\">\n" \
- " <div id=\"feedcloseX\">\n" \
- " <a href=\"#\" onclick=\"\$(\'.bd\').show();\$(\'.hd\').show();\$(\'.footer\').show();\$(\'#feedbackBox\').hide();\$(\'#blurpage\').hide()\">X</a>\n" \
- " </div>\n" \
- " <form id=\"feedform\" action=\"feedback.php\" method=\"get\">\n" \
+ " <div id=\"feedcloseX\" class=\"feedclose t_button\">X</div>\n" \
+ " <form id=\"feedform\" action=\"http://doc.qt.nokia.com/docFeedbck/feedback.php\" method=\"get\">\n" \
" <p><textarea id=\"feedbox\" name=\"feedText\" rows=\"5\" cols=\"40\">Please submit you feedback...</textarea></p>\n" \
- " <input id=\"page\" name=\"pageVal\" value=\"\$(\'title\').html();\" style=\"display:none;\">\n" \
- " <p><input id=\"feedsubmit\" type=\"submit\" onclick=\"\$(\'.bd\').show();\$(\'.hd\').show();\$(\'.footer\').show();\$(\'#feedbackBox\').hide();\$(\'#blurpage\').hide()\"\n" \
- " name=\"feedback\" /></p>\n" \
+ " <p><input id=\"feedsubmit\" class=\"feedclose\" type=\"submit\" name=\"feedback\" /></p>\n" \
" </form>\n" \
" </div>\n" \
" <div id=\"blurpage\">\n" \
diff --git a/tools/qdoc3/test/qt.qdocconf b/tools/qdoc3/test/qt.qdocconf
index 83a35a9..267d536 100644
--- a/tools/qdoc3/test/qt.qdocconf
+++ b/tools/qdoc3/test/qt.qdocconf
@@ -40,6 +40,7 @@ qhp.Qt.extraFiles = index.html \
images/page.png \
images/page_bg.png \
images/sprites-combined.png \
+ images/spinner.gif \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \
diff --git a/tools/qdoc3/test/qt_zh_CN.qdocconf b/tools/qdoc3/test/qt_zh_CN.qdocconf
index 9275b5c..db02478 100644
--- a/tools/qdoc3/test/qt_zh_CN.qdocconf
+++ b/tools/qdoc3/test/qt_zh_CN.qdocconf
@@ -46,6 +46,7 @@ qhp.Qt.extraFiles = index.html \
images/page.png \
images/page_bg.png \
images/sprites-combined.png \
+ images/spinner.gif \
images/stylesheet-coffee-plastique.png \
images/taskmenuextension-example.png \
images/coloreditorfactoryimage.png \