FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
gnuplot-old/term/regis.trm at origin · gnuplot/gnuplot-old · GitHub
gnuplot
gnuplot-old
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
gnuplot-old
/
term
/
regis.trm
Copy path
More file actions
More file actions
Latest commit
History
History
History
275 lines (230 loc) · 7.09 KB
Breadcrumbs
gnuplot-old
/
term
/
regis.trm
Copy path
File metadata and controls
275 lines (230 loc) · 7.09 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
/* Hello, Emacs, this is -*-C-*-
* $Id: regis.trm,v 1.16 2017-05-18 21:19:16 sfeam Exp $
*
*/
/* GNUPLOT - regis.trm */
/*[
* Copyright 1990 - 1993, 1998, 2004
*
* 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 complete modified source code. Modifications are to
* be distributed as patches to the released version. Permission to
* distribute binaries produced by compiling modified sources is granted,
* provided you
* 1. distribute the corresponding source modifications from the
* released version in the form of a patch file along with the binaries,
* 2. add special version identification to distinguish your version
* in addition to the base release version number,
* 3. provide your name and address as the primary contact for the
* support of your modified version, and
* 4. retain our contact information in regard to use of the base
* software.
* Permission to distribute the released version of the source code along
* with corresponding source modifications in the form of a patch file is
* granted with same provisions 2 through 4 for binary distributions.
*
* This software is provided "as is" without express or implied warranty
* to the extent permitted by applicable law.
]*/
/*
* This file is included by ../term.c.
*
* This terminal driver supports:
* REGIS devices
*
* AUTHORS
* Colin Kelley, Thomas Williams
*
* send your comments or suggestions to (gnuplot-info@lists.sourceforge.net).
*
*/
#include
"driver.h"
#ifdef
TERM_REGISTER
register_term
(
regis
)
#endif
#ifdef
TERM_PROTO
TERM_PUBLIC
void
REGIS_init
__PROTO
((
void
));
TERM_PUBLIC
void
REGIS_graphics
__PROTO
((
void
));
TERM_PUBLIC
void
REGIS_init
__PROTO
((
void
));
TERM_PUBLIC
void
REGIS_graphics
__PROTO
((
void
));
TERM_PUBLIC
void
REGIS_text
__PROTO
((
void
));
TERM_PUBLIC
void
REGIS_linetype
__PROTO
((
int
linetype
));
TERM_PUBLIC
void
REGIS_move
__PROTO
((
unsigned
int
x
,
unsigned
int
y
));
TERM_PUBLIC
void
REGIS_vector
__PROTO
((
unsigned
int
x
,
unsigned
int
y
));
TERM_PUBLIC
void
REGIS_put_text
__PROTO
((
unsigned
int
x
,
unsigned
int
y
,
const
char
*
str
));
TERM_PUBLIC
int
REGIS_text_angle
__PROTO
((
int
ang
));
TERM_PUBLIC
void
REGIS_reset
__PROTO
((
void
));
TERM_PUBLIC
void
REGIS_options
__PROTO
((
void
));
#define
REGISXMAX
800
#define
REGISYMAX
440
#define
REGISXLAST
(REGISXMAX - 1)
#define
REGISYLAST
(REGISYMAX - 1)
#define
REGISVCHAR
20
#define
REGISHCHAR
9
#define
REGISVTIC
8
#define
REGISHTIC
6
/* is defined in plot.h
#define TRUE 1
#define FALSE 0
*/
#endif
#ifndef
TERM_PROTO_ONLY
#ifdef
TERM_BODY
static
int
REGIS16color
=
FALSE;
static
int
REGISang
=
0
;
TERM_PUBLIC
void
REGIS_init
()
{
fputs
(
"\033[r\033[24;1H"
,
gpoutfile
);
/* 1 2
* 1. reset scrolling region
* 2. locate cursor on bottom line
*/
}
/* thanks to calmasd!dko (Dan O'Neill) for adding S(E) for vt125s */
TERM_PUBLIC
void
REGIS_graphics
()
{
fputs
(
"\033[2J\033P1pS(C0)S(E)T(A0)\n"
,
gpoutfile
);
/* 1 2 3 4 5
* 1. clear screen
* 2. enter ReGIS graphics
* 3. turn off graphics diamond cursor
* 4. clear graphics screen
* 5. character set option.
*/
(
void
)
REGIS_text_angle
(
0
);
/* select text size and angle */
}
TERM_PUBLIC
void
REGIS_text
()
{
fputs
(
"\033\\\033[24;1H"
,
gpoutfile
);
/* 1 2
* 1. Leave ReGIS graphics mode
* 2. locate cursor on last line of screen
*/
}
TERM_PUBLIC
void
REGIS_linetype
(
int
linetype
)
{
/* This will change color in order G,R,B,G-dot,R-dot,B-dot */
static
int
in_16_map
[
15
+
2
]
=
{
7
,
7
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
};
static
int
lt_16_map
[
15
+
2
]
=
{
1
,
4
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
};
static
int
in_map
[
9
+
2
]
=
{
2
,
2
,
3
,
2
,
1
,
3
,
2
,
1
,
3
,
2
,
1
};
static
int
lt_map
[
9
+
2
]
=
{
1
,
4
,
1
,
1
,
1
,
4
,
4
,
4
,
6
,
6
,
6
};
if
(
linetype
<
-2
)
linetype
=
LT_BLACK
;
if
(!
REGIS16color
) {
if
(
linetype
>=
9
)
linetype
%=
9
;
fprintf
(
gpoutfile
,
"W(I%d)\n"
,
in_map
[
linetype
+
2
]);
fprintf
(
gpoutfile
,
"W(P%d)\n"
,
lt_map
[
linetype
+
2
]);
}
else
{
if
(
linetype
>=
15
)
linetype
%=
15
;
fprintf
(
gpoutfile
,
"W(I%d)\n"
,
in_16_map
[
linetype
+
2
]);
fprintf
(
gpoutfile
,
"W(P%d)\n"
,
lt_16_map
[
linetype
+
2
]);
}
}
/*
** The \n was added in the functions below (and above) in order to not cause
** a buffer overflow in devices that can't deal with long line lengths.
** The DEC vt-340 doesn't need this, but Reflection 4, a vt-340 emulator
** for PC's under MS-DOS and Microsoft Windows does need it.
** Also needed for DECterm, a vt-340 emulator for use with Motif 1.0
** on Open/VMS.
** NGB 9/13/93
*/
TERM_PUBLIC
void
REGIS_move
(
unsigned
int
x
,
unsigned
int
y
)
{
fprintf
(
gpoutfile
,
"P[%d,%d]\n"
,
x
,
REGISYLAST
-
y
);
}
TERM_PUBLIC
void
REGIS_vector
(
unsigned
int
x
,
unsigned
int
y
)
{
fprintf
(
gpoutfile
,
"v[]v[%d,%d]\n"
,
x
,
REGISYLAST
-
y
);
/* the initial v[] is needed to get the first pixel plotted */
}
/* put_text and text_angle by rjl */
TERM_PUBLIC
void
REGIS_put_text
(
unsigned
int
x
,
unsigned
int
y
,
const
char
*
str
)
{
if
(
REGISang
==
1
)
REGIS_move
(
x
-
REGISVCHAR
/
2
-
1
,
y
);
else
REGIS_move
(
x
,
y
+
REGISVCHAR
/
2
-
1
);
(
void
)
putc
(
'T'
,
gpoutfile
);
(
void
)
putc
(
'\''
,
gpoutfile
);
while
(
*
str
) {
(
void
)
putc
(
*
str
,
gpoutfile
);
if
(
*
str
==
'\''
)
(
void
)
putc
(
'\''
,
gpoutfile
);
/* send out another one */
str
++
;
}
(
void
)
putc
(
'\''
,
gpoutfile
);
(
void
)
putc
(
'\n'
,
gpoutfile
);
}
TERM_PUBLIC
int
REGIS_text_angle
(
int
ang
)
{
REGISang
=
(
ang
?
1
:
0
);
if
(
REGISang
==
1
)
fputs
(
"T(D90,S1)\n"
,
gpoutfile
);
else
fputs
(
"T(D0,S1)\n"
,
gpoutfile
);
return
TRUE;
}
TERM_PUBLIC
void
REGIS_reset
()
{
fputs
(
"\033[2J\033[24;1H"
,
gpoutfile
);
}
TERM_PUBLIC
void
REGIS_options
()
{
int
i
=
0
;
struct
value
a
;
if
(!
END_OF_COMMAND
) {
i
=
(
int
)
real
(
const_express
(
&
a
));
}
REGIS16color
=
(
i
==
16
);
sprintf
(
term_options
,
"%s"
,
REGIS16color
?
"16"
:
"4"
);
}
#endif
#ifdef
TERM_TABLE
TERM_TABLE_START
(
regis_driver
)
"regis"
,
"REGIS graphics language"
,
REGISXMAX
,
REGISYMAX
,
REGISVCHAR
,
REGISHCHAR
,
REGISVTIC
,
REGISHTIC
,
REGIS_options
,
REGIS_init
,
REGIS_reset
,
REGIS_text
,
null_scale
,
REGIS_graphics
,
REGIS_move
,
REGIS_vector
,
REGIS_linetype
,
REGIS_put_text
,
REGIS_text_angle
,
null_justify_text
,
line_and_point
,
do_arrow
,
set_font_null
TERM_TABLE_END
(
regis_driver
)
#undef
LAST_TERM
#define
LAST_TERM
regis_driver
#endif
#endif
/* TERM_PROTO_ONLY */
#ifdef
TERM_HELP
START_HELP
(
regis
)
"1 regis"
,
"?commands set terminal regis"
,
"?set terminal regis"
,
"?set term regis"
,
"?terminal regis"
,
"?term regis"
,
"?regis"
,
" Note: legacy terminal."
,
" The `regis` terminal device generates output in the REGIS graphics language."
,
" It has the option of using 4 (the default) or 16 colors."
,
""
,
" Syntax:"
,
" set terminal regis {4 | 16}"
END_HELP
(
regis
)
#endif
Back
|
FazBrowse Home
|
New Git URL