1 /****************************************************************************** |
1 /****************************************************************************** |
2 * |
2 * |
3 * |
3 * |
4 * |
4 * |
5 * |
5 * |
6 * Copyright (C) 1997-2008 by Dimitri van Heesch. |
6 * Copyright (C) 1997-2010 by Dimitri van Heesch. |
7 * |
7 * |
8 * Permission to use, copy, modify, and distribute this software and its |
8 * Permission to use, copy, modify, and distribute this software and its |
9 * documentation under the terms of the GNU General Public License is hereby |
9 * documentation under the terms of the GNU General Public License is hereby |
10 * granted. No representations are made about the suitability of this software |
10 * granted. No representations are made about the suitability of this software |
11 * for any purpose. It is provided "as is" without express or implied warranty. |
11 * for any purpose. It is provided "as is" without express or implied warranty. |
78 /* <table> */ |
78 /* <table> */ |
79 case DocNode::Kind_HtmlTable: |
79 case DocNode::Kind_HtmlTable: |
80 /* <h?> */ |
80 /* <h?> */ |
81 case DocNode::Kind_Section: |
81 case DocNode::Kind_Section: |
82 case DocNode::Kind_HtmlHeader: |
82 case DocNode::Kind_HtmlHeader: |
|
83 /* \internal */ |
|
84 case DocNode::Kind_Internal: |
83 /* <div> */ |
85 /* <div> */ |
84 case DocNode::Kind_Verbatim: |
86 case DocNode::Kind_Verbatim: |
85 case DocNode::Kind_Include: |
87 case DocNode::Kind_Include: |
86 case DocNode::Kind_Image: |
88 case DocNode::Kind_Image: |
87 case DocNode::Kind_SecRefList: |
89 case DocNode::Kind_SecRefList: |
88 /* <hr> */ |
90 /* <hr> */ |
89 case DocNode::Kind_HorRuler: |
91 case DocNode::Kind_HorRuler: |
|
92 /* CopyDoc gets paragraph markers from the wrapping DocPara node, |
|
93 * but needs to insert them for all documentation being copied to |
|
94 * preserve formatting. |
|
95 */ |
|
96 case DocNode::Kind_Copy: |
90 return TRUE; |
97 return TRUE; |
91 case DocNode::Kind_StyleChange: |
98 case DocNode::Kind_StyleChange: |
92 return ((DocStyleChange*)n)->style()==DocStyleChange::Preformatted || |
99 return ((DocStyleChange*)n)->style()==DocStyleChange::Preformatted || |
93 ((DocStyleChange*)n)->style()==DocStyleChange::Div || |
100 ((DocStyleChange*)n)->style()==DocStyleChange::Div || |
94 ((DocStyleChange*)n)->style()==DocStyleChange::Center; |
101 ((DocStyleChange*)n)->style()==DocStyleChange::Center; |
703 if (p && p->parent()) |
710 if (p && p->parent()) |
704 { |
711 { |
705 switch (p->parent()->kind()) |
712 switch (p->parent()->kind()) |
706 { |
713 { |
707 case DocNode::Kind_Section: |
714 case DocNode::Kind_Section: |
|
715 case DocNode::Kind_Internal: |
708 case DocNode::Kind_HtmlListItem: |
716 case DocNode::Kind_HtmlListItem: |
709 case DocNode::Kind_HtmlDescData: |
717 case DocNode::Kind_HtmlDescData: |
710 case DocNode::Kind_HtmlCell: |
718 case DocNode::Kind_HtmlCell: |
711 case DocNode::Kind_SimpleListItem: |
719 case DocNode::Kind_SimpleListItem: |
712 case DocNode::Kind_AutoListItem: |
720 case DocNode::Kind_AutoListItem: |
713 case DocNode::Kind_SimpleSect: |
721 case DocNode::Kind_SimpleSect: |
714 case DocNode::Kind_XRefItem: |
722 case DocNode::Kind_XRefItem: |
|
723 case DocNode::Kind_Copy: |
715 needsTag = TRUE; |
724 needsTag = TRUE; |
716 break; |
725 break; |
717 case DocNode::Kind_Root: |
726 case DocNode::Kind_Root: |
718 needsTag = !((DocRoot*)p->parent())->singleLine(); |
727 needsTag = !((DocRoot*)p->parent())->singleLine(); |
719 break; |
728 break; |
782 if (p && p->parent()) |
791 if (p && p->parent()) |
783 { |
792 { |
784 switch (p->parent()->kind()) |
793 switch (p->parent()->kind()) |
785 { |
794 { |
786 case DocNode::Kind_Section: |
795 case DocNode::Kind_Section: |
|
796 case DocNode::Kind_Internal: |
787 case DocNode::Kind_HtmlListItem: |
797 case DocNode::Kind_HtmlListItem: |
788 case DocNode::Kind_HtmlDescData: |
798 case DocNode::Kind_HtmlDescData: |
789 case DocNode::Kind_HtmlCell: |
799 case DocNode::Kind_HtmlCell: |
790 case DocNode::Kind_SimpleListItem: |
800 case DocNode::Kind_SimpleListItem: |
791 case DocNode::Kind_AutoListItem: |
801 case DocNode::Kind_AutoListItem: |
792 case DocNode::Kind_SimpleSect: |
802 case DocNode::Kind_SimpleSect: |
793 case DocNode::Kind_XRefItem: |
803 case DocNode::Kind_XRefItem: |
|
804 case DocNode::Kind_Copy: |
794 needsTag = TRUE; |
805 needsTag = TRUE; |
795 break; |
806 break; |
796 case DocNode::Kind_Root: |
807 case DocNode::Kind_Root: |
797 needsTag = !((DocRoot*)p->parent())->singleLine(); |
808 needsTag = !((DocRoot*)p->parent())->singleLine(); |
798 break; |
809 break; |
1031 } |
1042 } |
1032 |
1043 |
1033 void HtmlDocVisitor::visitPre(DocHtmlTable *t) |
1044 void HtmlDocVisitor::visitPre(DocHtmlTable *t) |
1034 { |
1045 { |
1035 if (m_hide) return; |
1046 if (m_hide) return; |
1036 //bool hasBorder = FALSE; |
|
1037 //bool hasCellSpacing = FALSE; |
|
1038 //bool hasCellPadding = FALSE; |
|
1039 |
1047 |
1040 forceEndParagraph(t); |
1048 forceEndParagraph(t); |
1041 |
1049 |
1042 //HtmlAttribListIterator li(t->attribs()); |
1050 QString attrs = htmlAttribsToString(t->attribs()); |
1043 //HtmlAttrib *att; |
1051 if (attrs.isEmpty()) |
1044 //for (li.toFirst();(att=li.current());++li) |
1052 { |
1045 //{ |
1053 m_t << "<table class=\"doxtable\">\n"; |
1046 // if (att->name=="border") hasBorder=TRUE; |
1054 } |
1047 // else if (att->name=="cellspacing") hasCellSpacing=TRUE; |
1055 else |
1048 // else if (att->name=="cellpadding") hasCellPadding=TRUE; |
1056 { |
1049 //} |
1057 m_t << "<table " << htmlAttribsToString(t->attribs()) << ">\n"; |
1050 m_t << "<table class=\"doxtable\"" << htmlAttribsToString(t->attribs()); |
1058 } |
1051 //if (!hasBorder) m_t << " border=\"1\""; |
|
1052 //if (!hasCellSpacing) m_t << " cellspacing=\"3\""; |
|
1053 //if (!hasCellPadding) m_t << " cellpadding=\"3\""; |
|
1054 m_t << ">\n"; |
|
1055 } |
1059 } |
1056 |
1060 |
1057 void HtmlDocVisitor::visitPost(DocHtmlTable *t) |
1061 void HtmlDocVisitor::visitPost(DocHtmlTable *t) |
1058 { |
1062 { |
1059 if (m_hide) return; |
1063 if (m_hide) return; |
1111 { |
1115 { |
1112 if (m_hide) return; |
1116 if (m_hide) return; |
1113 m_t << "</caption>\n"; |
1117 m_t << "</caption>\n"; |
1114 } |
1118 } |
1115 |
1119 |
1116 void HtmlDocVisitor::visitPre(DocInternal *) |
1120 void HtmlDocVisitor::visitPre(DocInternal *i) |
1117 { |
1121 { |
1118 if (m_hide) return; |
1122 if (m_hide) return; |
|
1123 forceEndParagraph(i); |
1119 m_t << "<p><b>" << theTranslator->trForInternalUseOnly() << "</b></p>" << endl; |
1124 m_t << "<p><b>" << theTranslator->trForInternalUseOnly() << "</b></p>" << endl; |
1120 m_t << "<p>" << endl; |
1125 } |
1121 } |
1126 |
1122 |
1127 void HtmlDocVisitor::visitPost(DocInternal *i) |
1123 void HtmlDocVisitor::visitPost(DocInternal *) |
1128 { |
1124 { |
1129 if (m_hide) return; |
1125 if (m_hide) return; |
1130 forceStartParagraph(i); |
1126 m_t << "</p>" << endl; |
|
1127 } |
1131 } |
1128 |
1132 |
1129 void HtmlDocVisitor::visitPre(DocHRef *href) |
1133 void HtmlDocVisitor::visitPre(DocHRef *href) |
1130 { |
1134 { |
1131 if (m_hide) return; |
1135 if (m_hide) return; |
1562 QString mapName = baseName+".map"; |
1566 QString mapName = baseName+".map"; |
1563 QString mapFile = fileName+".map"; |
1567 QString mapFile = fileName+".map"; |
1564 m_t << "<img src=\"" << relPath << baseName << "." |
1568 m_t << "<img src=\"" << relPath << baseName << "." |
1565 << Config_getEnum("DOT_IMAGE_FORMAT") << "\" alt=\"" |
1569 << Config_getEnum("DOT_IMAGE_FORMAT") << "\" alt=\"" |
1566 << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\">" << endl; |
1570 << baseName << "\" border=\"0\" usemap=\"#" << mapName << "\">" << endl; |
1567 QString imap = getDotImageMapFromFile(fileName,outDir,relPath.data(),context); |
1571 QString imap = getDotImageMapFromFile(baseName,outDir,relPath.data(),context); |
1568 m_t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">" << imap << "</map>" << endl; |
1572 m_t << "<map name=\"" << mapName << "\" id=\"" << mapName << "\">" << imap << "</map>" << endl; |
1569 } |
1573 } |
1570 |
1574 |
1571 void HtmlDocVisitor::writeMscFile(const QString &fileName,const QString &relPath, |
1575 void HtmlDocVisitor::writeMscFile(const QString &fileName,const QString &relPath, |
1572 const QString &context) |
1576 const QString &context) |