summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/drawverbatim.h
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-16 00:19:13 +0000
committerKarl Berry <karl@freefriends.org>2009-05-16 00:19:13 +0000
commitbab45528d65eaafe68a705dbb2a57075c7b7cbd8 (patch)
tree10b4ae2b5195c8dede153ab89359ec00f55f325f /Build/source/utils/asymptote/drawverbatim.h
parent8643d90372e9c31e0f461c15c596b60a545bd7d3 (diff)
asymptote 1.72 sources (not integrated into build yet)
git-svn-id: svn://tug.org/texlive/trunk@13110 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/drawverbatim.h')
-rw-r--r--Build/source/utils/asymptote/drawverbatim.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/drawverbatim.h b/Build/source/utils/asymptote/drawverbatim.h
new file mode 100644
index 00000000000..24c5be45d14
--- /dev/null
+++ b/Build/source/utils/asymptote/drawverbatim.h
@@ -0,0 +1,57 @@
+/*****
+ * drawverbatim.h
+ * John Bowman 2003/03/18
+ *
+ * Add verbatim postscript to picture.
+ *****/
+
+#ifndef DRAWVERBATIM_H
+#define DRAWVERBATIM_H
+
+#include "drawelement.h"
+
+namespace camp {
+
+enum Language {PostScript,TeX};
+
+class drawVerbatim : public drawElement {
+private:
+ Language language;
+ string text;
+ bool havebounds;
+ pair min,max;
+public:
+ drawVerbatim(Language language, const string& text) :
+ language(language), text(text), havebounds(false) {}
+
+ drawVerbatim(Language language, const string& text, pair min,
+ pair max) :
+ language(language), text(text), havebounds(true), min(min), max(max) {}
+
+ virtual ~drawVerbatim() {}
+
+ void bounds(bbox& b, iopipestream&, boxvector&, bboxlist&) {
+ if(havebounds) {
+ b += min;
+ b += max;
+ }
+ }
+
+ bool islabel() {
+ return language == TeX;
+ }
+
+ bool draw(psfile *out) {
+ if(language == PostScript) out->verbatimline(text);
+ return true;
+ }
+
+ bool write(texfile *out, const bbox&) {
+ if(language == TeX) out->verbatimline(stripblanklines(text));
+ return true;
+ }
+};
+
+}
+
+#endif