diff options
Diffstat (limited to 'src/printdocvisitor.h')
-rw-r--r-- | src/printdocvisitor.h | 229 |
1 files changed, 116 insertions, 113 deletions
diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h index 1138e8b..dc28d26 100644 --- a/src/printdocvisitor.h +++ b/src/printdocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2012 by Dimitri van Heesch. + * Copyright (C) 1997-2013 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -19,6 +19,7 @@ #ifndef _PRINTDOCVISITOR_H #define _PRINTDOCVISITOR_H +#include <qglobal.h> #include "docvisitor.h" /*! Concrete visitor implementation for pretty printing */ @@ -57,104 +58,104 @@ class PrintDocVisitor : public DocVisitor indent_leaf(); switch(s->symbol()) { - case DocSymbol::BSlash: printf("\\"); break; - case DocSymbol::At: printf("@"); break; - case DocSymbol::Less: printf("<"); break; - case DocSymbol::Greater: printf(">"); break; - case DocSymbol::Amp: printf("&"); break; - case DocSymbol::Dollar: printf("$"); break; - case DocSymbol::Hash: printf("#"); break; - case DocSymbol::Percent: printf("%%"); break; - case DocSymbol::Pipe: printf("|"); break; - case DocSymbol::Copy: printf("©"); break; - case DocSymbol::Apos: printf("'"); break; - case DocSymbol::Quot: printf("\""); break; + case DocSymbol::BSlash: printf("\\"); break; + case DocSymbol::At: printf("@"); break; + case DocSymbol::Less: printf("<"); break; + case DocSymbol::Greater: printf(">"); break; + case DocSymbol::Amp: printf("&"); break; + case DocSymbol::Dollar: printf("$"); break; + case DocSymbol::Hash: printf("#"); break; + case DocSymbol::Percent: printf("%%"); break; + case DocSymbol::Pipe: printf("|"); break; + case DocSymbol::Copy: printf("©"); break; + case DocSymbol::Apos: printf("'"); break; + case DocSymbol::Quot: printf("\""); break; case DocSymbol::Lsquo: printf("‘"); break; case DocSymbol::Rsquo: printf("’"); break; case DocSymbol::Ldquo: printf("“"); break; case DocSymbol::Rdquo: printf("”"); break; case DocSymbol::Ndash: printf("–"); break; case DocSymbol::Mdash: printf("—"); break; - case DocSymbol::Uml: printf("&%cuml;",s->letter()); break; - case DocSymbol::Acute: printf("&%cacute;",s->letter()); break; - case DocSymbol::Grave: printf("&%cgrave;",s->letter()); break; - case DocSymbol::Circ: printf("&%ccirc;",s->letter()); break; - case DocSymbol::Tilde: printf("&%ctilde;",s->letter()); break; - case DocSymbol::Szlig: printf("ß"); break; - case DocSymbol::Cedil: printf("&%ccedul;",s->letter()); break; - case DocSymbol::Ring: printf("&%cring;",s->letter()); break; - case DocSymbol::Nbsp: printf(" "); break; - case DocSymbol::Aelig: printf("æ"); break; - case DocSymbol::AElig: printf("Æ"); break; - case DocSymbol::GrkGamma: printf("Γ"); break; - case DocSymbol::GrkDelta: printf("Δ"); break; - case DocSymbol::GrkTheta: printf("Θ"); break; - case DocSymbol::GrkLambda: printf("Λ"); break; - case DocSymbol::GrkXi: printf("Ξ"); break; - case DocSymbol::GrkPi: printf("Π"); break; - case DocSymbol::GrkSigma: printf("Σ"); break; - case DocSymbol::GrkUpsilon: printf("Υ"); break; - case DocSymbol::GrkPhi: printf("Φ"); break; - case DocSymbol::GrkPsi: printf("Ψ"); break; - case DocSymbol::GrkOmega: printf("Ω"); break; - case DocSymbol::Grkalpha: printf("α"); break; - case DocSymbol::Grkbeta: printf("β"); break; - case DocSymbol::Grkgamma: printf("γ"); break; - case DocSymbol::Grkdelta: printf("δ"); break; - case DocSymbol::Grkepsilon: printf("ε"); break; - case DocSymbol::Grkzeta: printf("ζ"); break; - case DocSymbol::Grketa: printf("η"); break; - case DocSymbol::Grktheta: printf("θ"); break; - case DocSymbol::Grkiota: printf("ι"); break; - case DocSymbol::Grkkappa: printf("κ"); break; - case DocSymbol::Grklambda: printf("λ"); break; - case DocSymbol::Grkmu: printf("μ"); break; - case DocSymbol::Grknu: printf("ν"); break; - case DocSymbol::Grkxi: printf("ξ"); break; - case DocSymbol::Grkpi: printf("π"); break; - case DocSymbol::Grkrho: printf("ρ"); break; - case DocSymbol::Grksigma: printf("σ"); break; - case DocSymbol::Grktau: printf("τ"); break; - case DocSymbol::Grkupsilon: printf("υ"); break; - case DocSymbol::Grkphi: printf("φ"); break; - case DocSymbol::Grkchi: printf("χ"); break; - case DocSymbol::Grkpsi: printf("ψ"); break; - case DocSymbol::Grkomega: printf("ω"); break; - case DocSymbol::Grkvarsigma: printf("ς"); break; - case DocSymbol::Section: printf("§"); break; - case DocSymbol::Degree: printf("°"); break; - case DocSymbol::Prime: printf("′"); break; - case DocSymbol::DoublePrime: printf("″"); break; - case DocSymbol::Infinity: printf("∞"); break; - case DocSymbol::EmptySet: printf("∅"); break; - case DocSymbol::PlusMinus: printf("±"); break; - case DocSymbol::Times: printf("×"); break; - case DocSymbol::Minus: printf("−"); break; - case DocSymbol::CenterDot: printf("⋅"); break; - case DocSymbol::Partial: printf("∂"); break; - case DocSymbol::Nabla: printf("∇"); break; - case DocSymbol::SquareRoot: printf("√"); break; - case DocSymbol::Perpendicular: printf("⊥"); break; - case DocSymbol::Sum: printf("∑"); break; - case DocSymbol::Integral: printf("∫"); break; - case DocSymbol::Product: printf("∏"); break; - case DocSymbol::Similar: printf("∼"); break; - case DocSymbol::Approx: printf("≈"); break; - case DocSymbol::NotEqual: printf("≠"); break; - case DocSymbol::Equivalent: printf("≡"); break; - case DocSymbol::Proportional: printf("∝"); break; - case DocSymbol::LessEqual: printf("≤"); break; - case DocSymbol::GreaterEqual: printf("≥"); break; - case DocSymbol::LeftArrow: printf("←"); break; - case DocSymbol::RightArrow: printf("→"); break; - case DocSymbol::SetIn: printf("∈"); break; - case DocSymbol::SetNotIn: printf("∉"); break; - case DocSymbol::LeftCeil: printf("⌈"); break; - case DocSymbol::RightCeil: printf("⌉"); break; - case DocSymbol::LeftFloor: printf("⌊"); break; - case DocSymbol::RightFloor: printf("⌋"); break; - default: - printf("Error: unknown symbol found\n"); + case DocSymbol::Uml: printf("&%cuml;",s->letter()); break; + case DocSymbol::Acute: printf("&%cacute;",s->letter()); break; + case DocSymbol::Grave: printf("&%cgrave;",s->letter()); break; + case DocSymbol::Circ: printf("&%ccirc;",s->letter()); break; + case DocSymbol::Tilde: printf("&%ctilde;",s->letter()); break; + case DocSymbol::Szlig: printf("ß"); break; + case DocSymbol::Cedil: printf("&%ccedul;",s->letter()); break; + case DocSymbol::Ring: printf("&%cring;",s->letter()); break; + case DocSymbol::Nbsp: printf(" "); break; + case DocSymbol::Aelig: printf("æ"); break; + case DocSymbol::AElig: printf("Æ"); break; + case DocSymbol::GrkGamma: printf("Γ"); break; + case DocSymbol::GrkDelta: printf("Δ"); break; + case DocSymbol::GrkTheta: printf("Θ"); break; + case DocSymbol::GrkLambda: printf("Λ"); break; + case DocSymbol::GrkXi: printf("Ξ"); break; + case DocSymbol::GrkPi: printf("Π"); break; + case DocSymbol::GrkSigma: printf("Σ"); break; + case DocSymbol::GrkUpsilon: printf("Υ"); break; + case DocSymbol::GrkPhi: printf("Φ"); break; + case DocSymbol::GrkPsi: printf("Ψ"); break; + case DocSymbol::GrkOmega: printf("Ω"); break; + case DocSymbol::Grkalpha: printf("α"); break; + case DocSymbol::Grkbeta: printf("β"); break; + case DocSymbol::Grkgamma: printf("γ"); break; + case DocSymbol::Grkdelta: printf("δ"); break; + case DocSymbol::Grkepsilon: printf("ε"); break; + case DocSymbol::Grkzeta: printf("ζ"); break; + case DocSymbol::Grketa: printf("η"); break; + case DocSymbol::Grktheta: printf("θ"); break; + case DocSymbol::Grkiota: printf("ι"); break; + case DocSymbol::Grkkappa: printf("κ"); break; + case DocSymbol::Grklambda: printf("λ"); break; + case DocSymbol::Grkmu: printf("μ"); break; + case DocSymbol::Grknu: printf("ν"); break; + case DocSymbol::Grkxi: printf("ξ"); break; + case DocSymbol::Grkpi: printf("π"); break; + case DocSymbol::Grkrho: printf("ρ"); break; + case DocSymbol::Grksigma: printf("σ"); break; + case DocSymbol::Grktau: printf("τ"); break; + case DocSymbol::Grkupsilon: printf("υ"); break; + case DocSymbol::Grkphi: printf("φ"); break; + case DocSymbol::Grkchi: printf("χ"); break; + case DocSymbol::Grkpsi: printf("ψ"); break; + case DocSymbol::Grkomega: printf("ω"); break; + case DocSymbol::Grkvarsigma: printf("ς"); break; + case DocSymbol::Section: printf("§"); break; + case DocSymbol::Degree: printf("°"); break; + case DocSymbol::Prime: printf("′"); break; + case DocSymbol::DoublePrime: printf("″"); break; + case DocSymbol::Infinity: printf("∞"); break; + case DocSymbol::EmptySet: printf("∅"); break; + case DocSymbol::PlusMinus: printf("±"); break; + case DocSymbol::Times: printf("×"); break; + case DocSymbol::Minus: printf("−"); break; + case DocSymbol::CenterDot: printf("⋅"); break; + case DocSymbol::Partial: printf("∂"); break; + case DocSymbol::Nabla: printf("∇"); break; + case DocSymbol::SquareRoot: printf("√"); break; + case DocSymbol::Perpendicular: printf("⊥"); break; + case DocSymbol::Sum: printf("∑"); break; + case DocSymbol::Integral: printf("∫"); break; + case DocSymbol::Product: printf("∏"); break; + case DocSymbol::Similar: printf("∼"); break; + case DocSymbol::Approx: printf("≈"); break; + case DocSymbol::NotEqual: printf("≠"); break; + case DocSymbol::Equivalent: printf("≡"); break; + case DocSymbol::Proportional: printf("∝"); break; + case DocSymbol::LessEqual: printf("≤"); break; + case DocSymbol::GreaterEqual: printf("≥"); break; + case DocSymbol::LeftArrow: printf("←"); break; + case DocSymbol::RightArrow: printf("→"); break; + case DocSymbol::SetIn: printf("∈"); break; + case DocSymbol::SetNotIn: printf("∉"); break; + case DocSymbol::LeftCeil: printf("⌈"); break; + case DocSymbol::RightCeil: printf("⌉"); break; + case DocSymbol::LeftFloor: printf("⌊"); break; + case DocSymbol::RightFloor: printf("⌋"); break; + default: + printf("unknown symbol found\n"); } } void visit(DocURL *u) @@ -178,35 +179,35 @@ class PrintDocVisitor : public DocVisitor switch (s->style()) { case DocStyleChange::Bold: - if (s->enable()) printf("<bold>"); else printf("</bold>"); - break; + if (s->enable()) printf("<bold>"); else printf("</bold>"); + break; case DocStyleChange::Italic: - if (s->enable()) printf("<italic>"); else printf("</italic>"); - break; + if (s->enable()) printf("<italic>"); else printf("</italic>"); + break; case DocStyleChange::Code: - if (s->enable()) printf("<code>"); else printf("</code>"); - break; + if (s->enable()) printf("<code>"); else printf("</code>"); + break; case DocStyleChange::Subscript: - if (s->enable()) printf("<sub>"); else printf("</sub>"); - break; + if (s->enable()) printf("<sub>"); else printf("</sub>"); + break; case DocStyleChange::Superscript: - if (s->enable()) printf("<sup>"); else printf("</sup>"); - break; + if (s->enable()) printf("<sup>"); else printf("</sup>"); + break; case DocStyleChange::Center: - if (s->enable()) printf("<center>"); else printf("</center>"); - break; + if (s->enable()) printf("<center>"); else printf("</center>"); + break; case DocStyleChange::Small: - if (s->enable()) printf("<small>"); else printf("</small>"); - break; + if (s->enable()) printf("<small>"); else printf("</small>"); + break; case DocStyleChange::Preformatted: - if (s->enable()) printf("<pre>"); else printf("</pre>"); - break; + if (s->enable()) printf("<pre>"); else printf("</pre>"); + break; case DocStyleChange::Div: - if (s->enable()) printf("<div>"); else printf("</div>"); - break; + if (s->enable()) printf("<div>"); else printf("</div>"); + break; case DocStyleChange::Span: - if (s->enable()) printf("<span>"); else printf("</span>"); - break; + if (s->enable()) printf("<span>"); else printf("</span>"); + break; } } void visit(DocVerbatim *s) @@ -221,6 +222,7 @@ class PrintDocVisitor : public DocVisitor case DocVerbatim::ManOnly: printf("<manonly>"); break; case DocVerbatim::LatexOnly: printf("<latexonly>"); break; case DocVerbatim::XmlOnly: printf("<xmlonly>"); break; + case DocVerbatim::DocbookOnly: printf("<docbookonly>"); break; case DocVerbatim::Dot: printf("<dot>"); break; case DocVerbatim::Msc: printf("<msc>"); break; } @@ -234,6 +236,7 @@ class PrintDocVisitor : public DocVisitor case DocVerbatim::ManOnly: printf("</manonly>"); break; case DocVerbatim::LatexOnly: printf("</latexonly>"); break; case DocVerbatim::XmlOnly: printf("</xmlonly>"); break; + case DocVerbatim::DocbookOnly: printf("</docbookonly>"); break; case DocVerbatim::Dot: printf("</dot>"); break; case DocVerbatim::Msc: printf("</msc>"); break; } |