1 /* Hello, Emacs, this is -*-C-*-
2 * $Id: excl.trm,v 1.16 2006/07/21 02:35:46 sfeam Exp $
6 /* GNUPLOT - excl.trm */
8 /* Copyright 1992, 1998, 2004 by P. Klosowski at NIST. All Rights Reserved
10 * Permission to use, copy, and distribute this software and its
11 * documentation for any purpose with or without fee is hereby granted,
12 * provided that the above copyright notice appear in all copies and
13 * that both that copyright notice and this permission notice appear
14 * in supporting documentation.
16 * Permission to modify the software is granted, but not the right to
17 * distribute the complete modified source code. Modifications are to
18 * be distributed as patches to the released version. Permission to
19 * distribute binaries produced by compiling modified sources is granted,
21 * 1. distribute the corresponding source modifications from the
22 * released version in the form of a patch file along with the binaries,
23 * 2. add special version identification to distinguish your version
24 * in addition to the base release version number,
25 * 3. provide your name and address as the primary contact for the
26 * support of your modified version, and
27 * 4. retain our contact information in regard to use of the base
29 * Permission to distribute the released version of the source code along
30 * with corresponding source modifications in the form of a patch file is
31 * granted with same provisions 2 through 4 for binary distributions.
33 * This software is provided "as is" without express or implied warranty
34 * to the extent permitted by applicable law.
36 * This file is included by ../term.c.
39 * send your comments or suggestions to (gnuplot-info@lists.sourceforge.net).
47 QUIC driver for GNUPLOT
51 przemek - Aug 16, 1992: Created.
52 lars - Nov 30, 1998: Updated to new gnuplot copyright by
53 permission from Przemek
56 c *****************************************
57 c *****************************************
59 c ****** EXCL command definitions *****
61 c *****************************************
62 c *****************************************
66 * adapted to the new terminal layout by Stefan Bodewig (Dec. 1995)
76 TERM_PUBLIC void EXCL_init __PROTO((void));
77 TERM_PUBLIC void EXCL_graphics __PROTO((void));
78 TERM_PUBLIC void EXCL_text __PROTO((void));
79 TERM_PUBLIC void EXCL_linetype __PROTO((int linetype));
80 TERM_PUBLIC void EXCL_move __PROTO((unsigned int x, unsigned int y));
81 TERM_PUBLIC void EXCL_vector __PROTO((unsigned int x2, unsigned int y2));
82 TERM_PUBLIC void EXCL_put_text __PROTO((unsigned int x, unsigned int y, const char str[]));
83 TERM_PUBLIC void EXCL_reset __PROTO((void));
85 #define EXCL_XMAX 9000
86 #define EXCL_YMAX 6500
88 #define EXCL_XLAST (EXCL_XMAX - 1)
89 #define EXCL_YLAST (EXCL_YMAX - 1)
91 #define EXCL_VCHAR 120
95 #endif /* TERM_PROTO */
98 #ifndef TERM_PROTO_ONLY
101 /* Define ansi command headers, NUL character */
109 page numbers are given per "Talaris EXCL programmer's reference manual" M292 rev.2
110 NOTE: EXCL coordinate system places (0,0) at upper left corner of the page
112 c EXCL commands for initialization
114 c TALAMS: set ANSI (p. 162)
115 c TALMOD: set emulation *** EXCL (p. 164)
116 c TALPGO: set page orient *** landscape (p. 81)
117 c TALFCTL: set paper format *** 8.5x11 (p. 85)
118 c TALTBM: set top/bot margins ** in land mode to full pg (p. 73)
119 c TALLRM: set left/right margins (p. 75)
120 c PUM: set units ** units of measure set by TALPRM (p. 67)
121 c TALASF: Absorb cr/ff/lf/vt ** ON (p. 182)
122 c TALPOP: pop controller params (p. 168)
123 c TALPSH: push controller params (p. 167)
124 c TALPRM: set units of measure ** to 1/1000 inch (p. 64)
125 c TALGLT: set line type ** solid (p. 211)
126 c TALORG: set page absolute origin ** (0,0) UL corner (p. 78)
127 c TALPCW: set page clip window *** for landsc/full page (p. 84)
128 c TALGLP: line: **pen7x7mil*draw*smear*glyph112*font5279* (p. 208)
129 c TALGLPE: ending for TALGLP command, forcing DRAW mode
130 c TALGBB: bounding box; used only by qdrive (p. 207)
131 c TALFPO: Force page out ** clear bitmap (p. 95)
132 c TALGDW: graphical draw to hor,vert ** abs coords (p. 212)
133 c TALGMV: graphical move to hor,vert ** abs coords (p. 213)
135 #define TALAMS "\033[0*s"
136 #define TALMOD "\033[1;0r"
137 #define TALPGO "\033[1;0p"
138 #define TALFCTL "\033[0;3x"
139 #define TALTBM "\033[0;8500 v"
140 #define TALLRM "\033[0;11000v"
141 #define PUM "\033[11h"
142 #define TALASF "\033[1 z"
143 #define TALPOP "\033[*]"
144 #define TALPSH "\033[*["
145 #define TALPRM "\033[3y"
146 #define TALGLT "\033[%s*t"
147 #define TALORG "\033[0;0o"
148 #define TALCCNT "\033[1;0u"
149 #define TALPCW "\033[0;8500;11000;0*c"
150 #define TALGLP_init "\033[7;7;8;1;112;5279*w"
151 #define TALGLP "\033[%d;%d;8*w"
152 #define TALFPO "\033[0*F"
153 #define TALGDW "\033[0;%d;%d*d"
154 #define TALGMV "\033[0;%d;%d*m"
156 /* TALPYL: polyline (p. 222)
157 ** 5;0} list of 16-bit signed integers, encoded, mostly relative
158 ** 5,1} list of ASCII absolute coords (if w/o +- signs)(e.g. 315:1222;)
161 #define TALPYL "\033P5;1}"
166 fprintf(gpoutfile, "%s%s%s%s%s%s",
167 TALPSH, TALAMS, TALMOD, TALCCNT, TALFCTL, TALASF);
168 /* ^save state ^setEXCL ^PaperSize8.5x11 */
169 /* ^setANSI ^copyCount1 ^absorbCtlChar */
170 fprintf(gpoutfile, "%s%s%s%s%s%s",
171 PUM, TALPRM, TALPGO, TALPCW, TALORG, TALGLP_init);
172 fprintf(gpoutfile, TALGLT, "");
173 /* ^setUnits ^landscape ^OriginZero ^SolidLine */
174 /* ^Units1/1000" ^pageClip ^SetLine */
185 fputs(TALFPO, gpoutfile);
191 EXCL_linetype(int linetype)
193 /* excl line widths in mils: 4 is mimimum, but too thin; then
194 7,10,14,17,20,24,27...
195 exclpen=MOD(NPEN,8)*7
196 CSI exclpen; exclpen; TALGLPE
198 static char *type[2 + 9] =
200 "", "40;40", "", "42;42", "14;21",
201 /* .... ---- -- -- -- . . . */
202 "", "49;30", "14;21", "", "49;30", "14;21"
203 /* same pattern, but thicker.. and thicker */
205 static int width[2+9] = { 14, 7, 7, 7, 7, 10, 10, 10, 17, 17, 17 };
213 fprintf(gpoutfile, TALGLP, width[linetype + 2], width[linetype + 2]);
215 fprintf(gpoutfile, TALGLT, type[linetype + 2]);
221 EXCL_move(unsigned int x, unsigned int y)
223 fprintf(gpoutfile, TALGMV, 1000 + x, EXCL_YLAST + 1000 - y);
229 EXCL_vector(unsigned int x2, unsigned int y2)
231 fprintf(gpoutfile, TALGDW, 1000 + x2, EXCL_YLAST + 1000 - y2);
232 /* ^pen down vector */
237 EXCL_put_text(unsigned int x, unsigned int y, const char str[])
240 EXCL_move(x, y - EXCL_VCHAR / 3);
251 fprintf(gpoutfile, "%s%s", TALFPO, TALPOP);
256 #endif /* TERM_BODY */
260 TERM_TABLE_START(excl_driver)
261 "excl", "Talaris EXCL Laser printer (also Talaris 1590 and others)",
262 EXCL_XMAX, EXCL_YMAX, EXCL_VCHAR, EXCL_HCHAR,
263 EXCL_VTIC, EXCL_HTIC, options_null, EXCL_init, EXCL_reset,
264 EXCL_text, null_scale, EXCL_graphics, EXCL_move, EXCL_vector,
265 EXCL_linetype, EXCL_put_text, null_text_angle,
266 null_justify_text, line_and_point, do_arrow, set_font_null
267 TERM_TABLE_END(excl_driver)
269 #define LAST_TERM excl_driver
271 #endif /* TERM_TABLE */
272 #endif /* TERM_PROTO_ONLY */
277 "?commands set terminal excl",
278 "?set terminal excl",
283 " The `excl` terminal driver supports Talaris printers such as the EXCL Laser",
284 " printer and the 1590. It has no options."