File: excl.trm

package info (click to toggle)
gnuplot 3.5beta6.340-5
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 4,792 kB
  • ctags: 4,205
  • sloc: ansic: 41,878; asm: 539; makefile: 498; objc: 379; csh: 297; sh: 277; pascal: 194; perl: 138; lisp: 88
file content (260 lines) | stat: -rw-r--r-- 7,902 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
/*
 * $Id: excl.trm,v 1.8 1996/12/08 13:11:16 drd Exp $
 *
 */

/* Copyright (c) 1992 by P. Klosowski at NIST.  All Rights Reserved 
 *
 * Permission to use, copy, and distribute this software and its
 * documentation for any purpose with or without fee is hereby granted, 
 * provided that the above copyright notice appear in all copies and 
 * that both that copyright notice and this permission notice appear 
 * in supporting documentation.
 *
 * Permission to modify the software is granted, but not the right to
 * distribute the modified code.  Modifications are to be distributed 
 * as patches to released version.
 *  
 * This software  is provided "as is" without express or implied warranty.
 * 
 * This file is included by ../term.c.
 *
 * 
 * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
 *
 ***     $Id: excl.trm,v 1.8 1996/12/08 13:11:16 drd Exp $
     
  NAME
     quic
   PURPOSE
     QUIC driver for GNUPLOT
   NOTES
     
   HISTORY
     przemek - Aug 16, 1992: Created.
***/
/*
c               *****************************************
c               *****************************************
c               ******                              *****
c               ******   EXCL command definitions   *****
c               ******                              *****
c               *****************************************
c               *****************************************
*/

/*
 * adapted to the new terminal layout by Stefan Bodewig (Dec. 1995)
 */

#ifndef GOT_DRIVER_H
#include "driver.h"
#endif

#ifdef TERM_REGISTER
register_term(excl)
#endif

#ifdef TERM_PROTO
TERM_PUBLIC void EXCL_init __PROTO((void));
TERM_PUBLIC void EXCL_graphics __PROTO((void));
TERM_PUBLIC void EXCL_text __PROTO((void));
TERM_PUBLIC void EXCL_linetype __PROTO((int linetype));
TERM_PUBLIC void EXCL_move __PROTO((unsigned int x, unsigned int y));
TERM_PUBLIC void EXCL_vector __PROTO((unsigned int x2, unsigned int y2));
TERM_PUBLIC void EXCL_put_text __PROTO((unsigned int x, unsigned int y, char str[]));
TERM_PUBLIC void EXCL_reset __PROTO((void));

#define EXCL_XMAX 9000
#define EXCL_YMAX 6500

#define EXCL_XLAST (EXCL_XMAX - 1)
#define EXCL_YLAST (EXCL_YMAX - 1)

#define EXCL_VCHAR		120
#define EXCL_HCHAR		70
#define EXCL_VTIC		70
#define EXCL_HTIC		70
#endif /* TERM_PROTO */


#ifndef TERM_PROTO_ONLY
#ifdef TERM_BODY

/*  Define ansi command headers, NUL character */
#define ESC "\033"
#define GS  "\035"
#define CSI "\033["
#define DCS "\033P"
#define ST  "\033\\"

/*
page numbers are given per "Talaris EXCL programmer's reference manual" M292 rev.2
NOTE: EXCL coordinate system places (0,0) at upper left corner of the page

c EXCL commands for initialization

c     TALAMS: set ANSI                                        (p. 162)
c     TALMOD: set emulation *** EXCL                          (p. 164)
c     TALPGO: set page orient *** landscape                   (p.  81)
c     TALFCTL: set paper format *** 8.5x11                    (p.  85)
c     TALTBM: set top/bot margins  ** in land mode to full pg (p.  73)
c     TALLRM: set left/right margins                          (p.  75)
c     PUM:    set units ** units of measure set by TALPRM     (p.  67)
c     TALASF: Absorb cr/ff/lf/vt   ** ON                      (p. 182)
c     TALPOP: pop controller params                           (p. 168)
c     TALPSH: push controller params                          (p. 167)
c     TALPRM: set units of measure ** to 1/1000 inch          (p.  64)
c     TALGLT: set line type ** solid                          (p. 211)
c     TALORG: set page absolute origin ** (0,0) UL corner     (p.  78) 
c     TALPCW: set page clip window *** for landsc/full page   (p.  84)
c     TALGLP: line: **pen7x7mil*draw*smear*glyph112*font5279* (p. 208)
c     TALGLPE: ending for TALGLP command, forcing DRAW mode
c     TALGBB: bounding box; used only by qdrive               (p. 207)
c     TALFPO: Force page out  ** clear bitmap                 (p.  95)
c     TALGDW: graphical draw to hor,vert ** abs  coords       (p. 212)
c     TALGMV: graphical move to hor,vert ** abs  coords       (p. 213)
*/
#define TALAMS  "\033[0*s"
#define TALMOD  "\033[1;0r"
#define TALPGO  "\033[1;0p"
#define TALFCTL "\033[0;3x"
#define TALTBM  "\033[0;8500 v"
#define TALLRM  "\033[0;11000v"
#define PUM     "\033[11h"
#define TALASF  "\033[1 z"
#define TALPOP  "\033[*]"
#define TALPSH  "\033[*["
#define TALPRM  "\033[3y"
#define TALGLT  "\033[%s*t"
#define TALORG  "\033[0;0o"
#define TALCCNT "\033[1;0u"
#define TALPCW  "\033[0;8500;11000;0*c"
#define TALGLP_init  "\033[7;7;8;1;112;5279*w"
#define TALGLP  "\033[%d;%d;8*w"
#define TALFPO  "\033[0*F"
#define TALGDW "\033[0;%d;%d*d"
#define TALGMV "\033[0;%d;%d*m"

/*  TALPYL: polyline                                        (p. 222)
**        5;0} list of 16-bit signed integers, encoded, mostly relative
**        5,1} list of ASCII  absolute coords (if w/o +- signs)(e.g. 315:1222;)
*/

#define TALPYL  "\033P5;1}"

TERM_PUBLIC void EXCL_init()
{
  fprintf(outfile,"%s%s%s%s%s%s",
  	          TALPSH,TALAMS,TALMOD,TALCCNT,TALFCTL,TALASF);
/*                ^save state   ^setEXCL       ^PaperSize8.5x11       */
/*                       ^setANSI      ^copyCount1     ^absorbCtlChar */
  fprintf(outfile, "%s%s%s%s%s%s",
		  PUM,TALPRM,TALPGO,TALPCW,TALORG,TALGLP_init);
  fprintf(outfile,                                            TALGLT,"");
/*                ^setUnits  ^landscape    ^OriginZero        ^SolidLine   */
/*                    ^Units1/1000" ^pageClip     ^SetLine            */
}

TERM_PUBLIC void EXCL_graphics()
{
}

TERM_PUBLIC void EXCL_text()
{
	fprintf(outfile,TALFPO );
	/*              ^pageout  */
}


TERM_PUBLIC void EXCL_linetype(linetype)
int linetype;
{
/* excl line widths in mils: 4 is mimimum, but too thin; then 
   7,10,14,17,20,24,27...
   exclpen=MOD(NPEN,8)*7
   CSI  exclpen; exclpen; TALGLPE
*/
  static char *type[2+9]={ 
    "", "40;40", "",  "42;42",  "14;21",
    /*   ....   ----  -- -- --   . . .   */
     "",  "49;30",  "14;21",         "",  "49;30",  "14;21"
    /*  same pattern, but thicker..  and thicker       */
    };
  static int width[2+9] = {14, 7,    7, 7, 7, 10, 10, 10, 17, 17, 17};
  if (linetype >= 9)
    linetype %= 9;
  fprintf(outfile,TALGLP,width[linetype+2],width[linetype+2]); 
  /*	          ^width in dots */
  fprintf(outfile,TALGLT,type[linetype+2]);
  /*              ^line type     */
}


TERM_PUBLIC void EXCL_move(x,y)
unsigned int x,y;
{
	fprintf(outfile,TALGMV, 1000 + x, EXCL_YLAST + 1000 - y);
/*	                 ^pen up vector*/
}


TERM_PUBLIC void EXCL_vector(x2,y2)
unsigned int x2,y2;
{
	fprintf(outfile,TALGDW, 1000 + x2, EXCL_YLAST + 1000 - y2);
/*	                 ^pen down vector*/
}


TERM_PUBLIC void EXCL_put_text(x,y,str)
unsigned int x,y;
char str[];
{
char ch;
	EXCL_move(x,y - EXCL_VCHAR/3);
	ch = *str++;
	while(ch!='\0') {
		putc(ch,outfile);
		ch = *str++;
	}
}

TERM_PUBLIC void EXCL_reset()
{
	fprintf(outfile,"%s%s", TALFPO, TALPOP);
	/*                      ^pageout ^pop  */
}


#endif /* TERM_BODY */

#ifdef TERM_TABLE

TERM_TABLE_START(excl_driver)
    "excl", "Talaris EXCL Laser printer (also Talaris 1590 and others)",
	   EXCL_XMAX,EXCL_YMAX, EXCL_VCHAR, EXCL_HCHAR, 
	   EXCL_VTIC, EXCL_HTIC, options_null, EXCL_init,EXCL_reset, 
	   EXCL_text, null_scale, EXCL_graphics, EXCL_move, EXCL_vector,
	   EXCL_linetype,EXCL_put_text, null_text_angle, 
	   null_justify_text, line_and_point, do_arrow, set_font_null
TERM_TABLE_END(excl_driver)

#undef LAST_TERM
#define LAST_TERM excl_driver

#endif /* TERM_TABLE */
#endif /* TERM_PROTO_ONLY */

#ifdef TERM_HELP
START_HELP(excl)
"1 excl",
"?set terminal excl",
"?set term excl",
"?terminal excl",
"?term excl",
"?excl",
" The `excl` terminal driver supports Talaris printers such as the EXCL Laser",
" printer and the 1590.  It has no options."
END_HELP(excl)
#endif