52 |
|
#define MINPIX 8 /* minimum hardware color */ |
53 |
|
|
54 |
|
#define NCOLS 512 /* maximum # columns for output */ |
55 |
< |
#define NROWS 512-COMHT /* maximum # rows for output */ |
55 |
> |
#define NROWS 483-COMHT /* maximum # rows for output */ |
56 |
|
#define COMHT 16 /* height of command line */ |
57 |
|
#define COMCW 63 /* maximum chars on command line */ |
58 |
|
|
59 |
– |
int anewcolr(); |
60 |
– |
|
59 |
|
int aed_close(), aed_clear(), aed_paintr(), |
60 |
|
aed_getcur(), aed_comout(), aed_errout(); |
61 |
|
|
62 |
|
static struct driver aed_driver = { |
63 |
|
aed_close, aed_clear, aed_paintr, aed_getcur, |
64 |
< |
aed_comout, NULL, |
65 |
< |
NCOLS, NROWS |
64 |
> |
aed_comout, NULL, NULL, |
65 |
> |
1.0, NCOLS, NROWS |
66 |
|
}; |
67 |
|
|
68 |
|
|
69 |
|
struct driver * |
70 |
< |
aed_init(name) /* open AED */ |
71 |
< |
char *name; |
70 |
> |
aed_init(name, id) /* open AED */ |
71 |
> |
char *name, *id; |
72 |
|
{ |
73 |
|
if (ttyset(&aed_driver, fileno(stdin)) < 0) { /* set tty driver */ |
74 |
< |
stderr_v("cannot access terminal\n"); |
74 |
> |
eputs("cannot access terminal\n"); |
75 |
|
return(NULL); |
76 |
|
} |
77 |
|
command(RST); /* reset AED */ |
86 |
|
byte(BLK); byte(WHT); byte(15); |
87 |
|
command(SCP); |
88 |
|
byte('+'); byte(0); byte(1); |
89 |
< |
make_cmap(GAMMA); /* make color map */ |
90 |
< |
errvec = aed_errout; /* set error vector */ |
91 |
< |
cmdvec = aed_errout; |
92 |
< |
if (wrnvec != NULL) |
93 |
< |
wrnvec = aed_errout; |
89 |
> |
make_gmap(GAMMA); /* make color map */ |
90 |
> |
erract[USER].pf = /* set error vector */ |
91 |
> |
erract[SYSTEM].pf = |
92 |
> |
erract[INTERNAL].pf = |
93 |
> |
erract[CONSISTENCY].pf = aed_errout; |
94 |
> |
erract[COMMAND].pf = aed_errout; |
95 |
> |
if (erract[WARNING].pf != NULL) |
96 |
> |
erract[WARNING].pf = aed_errout; |
97 |
|
return(&aed_driver); |
98 |
|
} |
99 |
|
|
101 |
|
static |
102 |
|
aed_close() /* close AED */ |
103 |
|
{ |
104 |
< |
errvec = stderr_v; /* reset error vector */ |
105 |
< |
cmdvec = NULL; |
106 |
< |
if (wrnvec != NULL) |
107 |
< |
wrnvec = stderr_v; |
104 |
> |
erract[USER].pf = /* reset error vector */ |
105 |
> |
erract[SYSTEM].pf = |
106 |
> |
erract[INTERNAL].pf = |
107 |
> |
erract[CONSISTENCY].pf = eputs; |
108 |
> |
erract[COMMAND].pf = NULL; |
109 |
> |
if (erract[WARNING].pf != NULL) |
110 |
> |
erract[WARNING].pf = wputs; |
111 |
|
aedsetcap(0, 0); /* go to bottom */ |
112 |
|
command(SEC); |
113 |
|
byte(WHT); /* white text */ |
123 |
|
int x, y; |
124 |
|
{ |
125 |
|
command(FFD); |
126 |
< |
new_ctab(NCOLORS, anewcolr); /* init color table */ |
126 |
> |
new_ctab(NCOLORS); /* init color table */ |
127 |
|
flush(); |
128 |
|
} |
129 |
|
|
133 |
|
COLOR col; |
134 |
|
int xmin, ymin, xmax, ymax; |
135 |
|
{ |
136 |
+ |
extern int anewcolr(); |
137 |
|
int ndx; |
138 |
|
|
139 |
< |
ndx = get_pixel(col); /* may call anewcolr() */ |
139 |
> |
ndx = get_pixel(col, anewcolr); /* calls anewcolr() */ |
140 |
|
command(SEC); /* draw rectangle */ |
141 |
|
byte(ndx+MINPIX); |
142 |
|
aedsetcap(xmin, ymin+COMHT); |