Home | History | Annotate | Download | only in script_api

Lines Matching refs:file

5  * you may not use this file except in compliance with the License.
35 static void writeHeader(GeneratedFile* file, const string& title,
38 *file
49 *file << " <meta name=\"description\" content=\"";
54 if (i) *file << " ";
55 *file << desc[i];
57 *file << "?\">\n";
59 *file << "</head>\n\n"
61 *file << "<div class='renderscript'>\n";
64 static void writeFooter(GeneratedFile* file) {
65 *file << "</div>\n";
66 *file << "\n\n</body>\n";
67 *file << "</html>\n";
203 static bool generateHtmlParagraphs(GeneratedFile* file, const vector<string>& description) {
209 *file << "</p>\n";
214 *file << "<p> ";
221 *file << s << "\n";
224 *file << "</p>\n";
229 static void writeSummaryTableStart(GeneratedFile* file, const string& label, bool labelIsHeading) {
231 *file << "<h2 style='margin-bottom: 0px;'>" << label << "</h2>\n";
233 *file << "<table class='jd-sumtable'><tbody>\n";
235 *file << " <tr><th colspan='2'>" << label << "</th></tr>\n";
239 static void writeSummaryTableEnd(GeneratedFile* file) {
240 *file << "</tbody></table>\n";
275 static void writeSummaryTable(GeneratedFile* file, const ostringstream* entries, const char* name,
283 writeSummaryTableStart(file, prefix + name, labelAsHeader);
284 *file << s;
285 writeSummaryTableEnd(file);
289 static void writeSummaryTables(GeneratedFile* file, const map<string, Constant*>& constants,
297 writeSummaryTable(file, &constantStream, "Constants", deprecatedSelector, labelAsHeader);
303 writeSummaryTable(file, &typeStream, "Types", deprecatedSelector, labelAsHeader);
309 writeSummaryTable(file, &functionStream, "Functions", deprecatedSelector, labelAsHeader);
312 static void writeHtmlVersionTag(GeneratedFile* file, VersionInfo info,
347 *file << (addSpacing ? " " : "") << s << "\n";
351 static void writeDetailedTypeSpecification(GeneratedFile* file, const TypeSpecification* spec) {
355 *file << "<p>A typedef of: " << spec->getSimpleType()
359 writeHtmlVersionTag(file, spec->getVersionInfo(), false);
360 *file << "</p>\n";
364 *file << "<p>";
365 writeHtmlVersionTag(file, spec->getVersionInfo(), false);
366 *file << "</p>\n";
370 *file << "<p>An enum with the following values:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n";
371 writeHtmlVersionTag(file, spec->getVersionInfo(), false);
372 *file << "</p>\n";
374 *file << " <table class='jd-tagtable'><tbody>\n";
378 *file << " <tr><th>" << values[i] << "</th><td>";
380 *file << valueComments[i];
382 *file << "</td></tr>\n";
384 *file << " </tbody></table><br/>\n";
388 *file << "<p>A structure with the following fields:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
389 writeHtmlVersionTag(file, spec->getVersionInfo(), false);
390 *file << "</p>\n";
392 *file << " <table class='jd-tagtable'><tbody>\n";
396 *file << " <tr><th>" << fields[i] << "</th><td>";
398 *file << fieldComments[i];
400 *file << "</td></tr>\n";
402 *file << " </tbody></table><br/>\n";
408 static void writeDetailedConstantSpecification(GeneratedFile* file, ConstantSpecification* c) {
409 *file << " <tr><td>";
410 *file << "Value: " << c->getValue() << "\n";
411 writeHtmlVersionTag(file, c->getVersionInfo(), true);
412 *file << " </td></tr>\n";
413 *file << "<br/>\n";
416 static bool writeOverviewForFile(GeneratedFile* file, const SpecFile& specFile) {
418 *file << "<h2>" << specFile.getBriefDescription() << "</h2>\n";
419 if (!generateHtmlParagraphs(file, specFile.getFullDescription())) {
424 // file << "<h2>Summary</h2>\n";
425 writeSummaryTables(file, specFile.getDocumentedConstants(), specFile.getDocumentedTypes(),
432 GeneratedFile file;
433 if (!file.start(directory, OVERVIEW_HTML_FILE_NAME)) {
438 // Take the description from the first spec file (rs_core.spec, based on how
440 writeHeader(&file, "Runtime API Reference",
444 if (!writeOverviewForFile(&file, *specFile)) {
449 writeFooter(&file);
450 file.close();
455 GeneratedFile file;
456 if (!file.start(directory, INDEX_HTML_FILE_NAME)) {
459 writeHeader(&file, "Index", SpecFile(""));
461 writeSummaryTables(&file, systemSpecification.getConstants(), systemSpecification.getTypes(),
464 writeSummaryTables(&file, systemSpecification.getConstants(), systemSpecification.getTypes(),
467 writeFooter(&file);
468 file.close();
472 static void writeDeprecatedWarning(GeneratedFile* file, Definition* definition) {
474 file << " <p><b>Deprecated.</b> ";
478 *file << s;
480 *file << "Do not use.";
482 *file << "</p>\n";
486 static bool writeDetailedConstant(GeneratedFile* file, Constant* constant) {
492 *file << "<a name='android_rs:" << name << "'></a>\n";
493 *file << "<div class='jd-details'>\n";
494 *file << " <h4 class='jd-details-title'>\n";
495 *file << " <span class='sympad'>" << name << "</span>\n";
496 *file << " <span class='normal'>: " << constant->getSummary() << "</span>\n";
497 *file << " </h4>\n";
499 *file << " <div class='jd-details-descr'>\n";
500 *file << " <table class='jd-tagtable'><tbody>\n";
505 *file << " <h5 class='jd-tagtitle'>Variant:</h5>\n";
507 writeDetailedConstantSpecification(file, spec);
509 *file << " </tbody></table>\n";
510 *file << " </div>\n";
512 *file << " <div class='jd-tagdata jd-tagdescr'>\n";
514 writeDeprecatedWarning(file, constant);
515 if (!generateHtmlParagraphs(file, constant->getDescription())) {
518 *file << " </div>\n";
520 *file << "</div>\n";
521 *file << "\n";
525 static bool writeDetailedType(GeneratedFile* file, Type* type) {
531 *file << "<a name='android_rs:" << name << "'></a>\n";
532 *file << "<div class='jd-details'>\n";
533 *file << " <h4 class='jd-details-title'>\n";
534 *file << " <span class='sympad'>" << name << "</span>\n";
535 *file << " <span class='normal'>: " << type->getSummary() << "</span>\n";
536 *file << " </h4>\n";
538 *file << " <div class='jd-details-descr'>\n";
540 writeDetailedTypeSpecification(file, spec);
543 writeDeprecatedWarning(file, type);
544 if (!generateHtmlParagraphs(file, type->getDescription())) {
548 *file << " </div>\n";
549 *file << "</div>\n";
550 *file << "\n";
554 static bool writeDetailedFunction(GeneratedFile* file, Function* function) {
560 *file << "<a name='android_rs:" << name << "'></a>\n";
561 *file << "<div class='jd-details'>\n";
562 *file << " <h4 class='jd-details-title'>\n";
563 *file << " <span class='sympad'>" << name << "</span>\n";
564 *file << " <span class='normal'>: " << function->getSummary() << "</span>\n";
565 *file << " </h4>\n";
567 *file << " <div class='jd-details-descr'>\n";
572 *file << " <table class='jd-tagtable'><tbody>\n";
574 *file << " <tr>\n";
575 *file << " <td>" << i.second.htmlDeclaration << "</td>\n";
576 *file << " <td>";
577 writeHtmlVersionTag(file, i.second.info, true);
578 *file << " </td>\n";
579 *file << " </tr>\n";
581 *file << " </tbody></table>\n";
582 *file << " </div>\n";
585 *file << " <div class='jd-tagdata'>";
586 *file << " <h5 class='jd-tagtitle'>Parameters</h5>\n";
587 *file << " <table class='jd-tagtable'><tbody>\n";
589 *file << " <tr><th>" << p->name << "</th><td>" << p->documentation << "</td></tr>\n";
591 *file << " </tbody></table>\n";
592 *file << " </div>\n";
597 *file << " <div class='jd-tagdata'>";
598 *file << " <h5 class='jd-tagtitle'>Returns</h5>\n";
599 *file << " <table class='jd-tagtable'><tbody>\n";
600 *file << " <tr><td>" << ret << "</td></tr>\n";
601 *file << " </tbody></table>\n";
602 *file << " </div>\n";
605 *file << " <div class='jd-tagdata jd-tagdescr'>\n";
606 writeDeprecatedWarning(file, function);
607 if (!generateHtmlParagraphs(file, function->getDescription())) {
610 *file << " </div>\n";
612 *file << "</div>\n";
613 *file << "\n";
624 GeneratedFile file;
627 if (!file.start(directory, fileName)) {
633 writeHeader(&file, title, specFile);
635 file << "<h2>Overview</h2>\n";
636 if (!generateHtmlParagraphs(&file, specFile.getFullDescription())) {
641 file << "<h2>Summary</h2>\n";
646 writeSummaryTables(&file, constants, types, functions, NON_DEPRECATED_ONLY, false);
647 writeSummaryTables(&file, constants, types, functions, DEPRECATED_ONLY, false);
651 file << "<h2>Constants</h2>\n";
653 if (!writeDetailedConstant(&file, i.second)) {
659 file << "<h2>Types</h2>\n";
661 if (!writeDetailedType(&file, i.second)) {
667 file << "<h2>Functions</h2>\n";
669 if (!writeDetailedFunction(&file, i.second)) {
675 writeFooter(&file);
676 file.close();
679 // If in error, write a final message to make it easier to figure out which file failed.
685 static void generateSnippet(GeneratedFile* file, const string& fileName, const string& title) {
687 *file << offset << "<li><a href=\"<?cs var:toroot ?>guide/topics/renderscript/reference/"
689 *file << offset << " <span class=\"en\">" << title << "</span>\n";
690 *file << offset << "</a></li>\n";
693 /* Generate a partial file of links that should be cut & pasted into the proper section of the
694 * guide_toc.cs file.
697 GeneratedFile file;
698 if (!file.start(directory, "guide_toc.cs")) {
701 file << "<!-- Copy and paste the following lines into the RenderScript section of\n";
702 file << " platform/frameworks/base/docs/html/guide/guide_toc.cs\n\n";
705 file << offset << "<li class=\"nav-section\">\n";
706 file << offset << " <div class=\"nav-section-header\">\n";
707 file << offset << " <a href=\"<?cs var:toroot ?>guide/topics/renderscript/reference/" <<
709 file << offset << " <span class=\"en\">Runtime API Reference</span>\n";
710 file << offset << " </a></div>\n";
711 file << offset << " <ul>\n";
716 generateSnippet(&file, fileName, specFile->getBriefDescription());
719 generateSnippet(&file, INDEX_HTML_FILE_NAME, "Index");
721 file << offset << " </ul>\n";
722 file << offset << "</li>\n";