1 /* Hello, Emacs, this is -*-C-*-
2 * $Id: qms.trm,v 1.12 2006/07/21 02:35:48 sfeam Exp $
6 /* GNUPLOT - qms.trm */
9 * Copyright 1990 - 1993, 1998, 2004
11 * Permission to use, copy, and distribute this software and its
12 * documentation for any purpose with or without fee is hereby granted,
13 * provided that the above copyright notice appear in all copies and
14 * that both that copyright notice and this permission notice appear
15 * in supporting documentation.
17 * Permission to modify the software is granted, but not the right to
18 * distribute the complete modified source code. Modifications are to
19 * be distributed as patches to the released version. Permission to
20 * distribute binaries produced by compiling modified sources is granted,
22 * 1. distribute the corresponding source modifications from the
23 * released version in the form of a patch file along with the binaries,
24 * 2. add special version identification to distinguish your version
25 * in addition to the base release version number,
26 * 3. provide your name and address as the primary contact for the
27 * support of your modified version, and
28 * 4. retain our contact information in regard to use of the base
30 * Permission to distribute the released version of the source code along
31 * with corresponding source modifications in the form of a patch file is
32 * granted with same provisions 2 through 4 for binary distributions.
34 * This software is provided "as is" without express or implied warranty
35 * to the extent permitted by applicable law.
39 * This file is included by ../term.c.
41 * This terminal driver supports:
45 * Colin Kelley, Thomas Williams, Russell Lang
47 * send your comments or suggestions to (gnuplot-info@lists.sourceforge.net).
52 * adapted to the new terminal layout by Stefan Bodewig (Dec. 1995)
62 TERM_PUBLIC void QMS_init __PROTO((void));
63 TERM_PUBLIC void QMS_graphics __PROTO((void));
64 TERM_PUBLIC void QMS_text __PROTO((void));
65 TERM_PUBLIC void QMS_linetype __PROTO((int linetype));
66 TERM_PUBLIC void QMS_move __PROTO((unsigned int x, unsigned int y));
67 TERM_PUBLIC void QMS_vector __PROTO((unsigned int x2, unsigned int y2));
68 TERM_PUBLIC void QMS_put_text __PROTO((unsigned int x, unsigned int y, const char str[]));
69 TERM_PUBLIC void QMS_reset __PROTO((void));
74 #define QMS_XLAST (QMS_XMAX - 1)
75 #define QMS_YLAST (QMS_YMAX - 1)
81 #endif /* TERM_PROTO */
83 #ifndef TERM_PROTO_ONLY
85 static int qms_line = 0; /* to remember current line type */
90 /* This was just ^IOL, but at Rutgers at least we need some more stuff */
91 fputs("^PY^-\n^IOL\n^ISYNTAX00000^F^IB11000^IJ00000^IT00000\n", gpoutfile);
92 /* ^ QUIC on ^set defaults ^ set botttom,top,left margins
93 * ^landscape ^free format
96 /* set defaults are: implicit decimal point, units in inches,
97 * numbers left justified, units in 1/1000 inch, do not ignore spaces
98 * margins are in 1/1000 inch units
106 fputs("^IGV\n", gpoutfile);
107 /* ^enter graphics vector mode */
115 /* added ^-, because ^, after an ^I command doesn't actually print a page */
116 /* Did anybody try this code out? [uhh...-cdk] */
117 fputs("^IGE\n^-^,", gpoutfile);
118 /* ^exit graphics vector mode
126 QMS_linetype(int linetype)
128 static int width[2 + 9] = { 7, 3, 3, 3, 3, 5, 5, 5, 7, 7, 7 };
129 static int type[2 + 9] = { 0, 1, 0, 2, 3, 0, 2, 3, 0, 2, 3 };
131 * I don't know about Villanova, but on our printer, using ^V without
132 * previously setting up a pattern crashes the microcode.
133 * [nope, doesn't crash here. -cdk]
134 * [it generates a controller error here on dotted lines. - rjl]
136 /* Code to define patterns added by rjl
137 * According to the manual it should work - but it doesn't
143 fprintf(gpoutfile, "^PW%02d\n", width[linetype + 2]);
146 switch (type[linetype + 2]) {
147 case 1: /* short dash */
148 fputs("^PV102025^G\n^V1\n", gpoutfile);
149 /* ^PV = define pattern vector, 1 = pattern number,
150 * 02 = number of pen downs and ups, 025 = .025" length of ups/downs
153 case 2: /* medium dash */
154 fputs("^PV202050^G\n^V2\n", gpoutfile);
156 case 3: /* long dash */
157 fputs("^PV302100^G\n^V3\n", gpoutfile);
161 fputs("^V0\n", gpoutfile);
168 QMS_move(unsigned int x, unsigned int y)
170 fprintf(gpoutfile, "^U%05d:%05d\n", 1000 + x, QMS_YLAST + 1000 - y);
176 QMS_vector(unsigned int x2, unsigned int y2)
178 fprintf(gpoutfile, "^D%05d:%05d\n", 1000 + x2, QMS_YLAST + 1000 - y2);
179 /* ^pen down vector*/
184 QMS_put_text(unsigned int x, unsigned int y, const char str[])
187 QMS_move(x, y + QMS_VCHAR / 3);
188 fputs("^IGE\n", gpoutfile);
192 putc('^', gpoutfile);
196 fputs("\n^IGV\n", gpoutfile);
197 QMS_linetype(qms_line); /* restore line type */
204 fputs("^PN^-\n", gpoutfile);
208 #endif /* TERM_BODY */
211 TERM_TABLE_START(qms_driver)
212 "qms", "QMS/QUIC Laser printer (also Talaris 1200 and others)",
213 QMS_XMAX, QMS_YMAX, QMS_VCHAR, QMS_HCHAR,
214 QMS_VTIC, QMS_HTIC, options_null, QMS_init, QMS_reset,
215 QMS_text, null_scale, QMS_graphics, QMS_move, QMS_vector,
216 QMS_linetype, QMS_put_text, null_text_angle,
217 null_justify_text, line_and_point, do_arrow, set_font_null
218 TERM_TABLE_END(qms_driver)
221 #define LAST_TERM qms_driver
223 #endif /* TERM_TABLE */
224 #endif /* TERM_PROTO_ONLY */
229 "?commands set terminal qms",
235 " The `qms` terminal driver supports the QMS/QUIC Laser printer, the Talaris",
236 " 1200 and others. It has no options."