67 |
|
|
68 |
|
static Colormap ourmap = 0; /* our color map */ |
69 |
|
|
70 |
< |
extern char *malloc(); |
70 |
> |
extern char *malloc(), *getcombuf(); |
71 |
|
|
72 |
< |
int x11_close(), x11_clear(), x11_paintr(), x11_errout(), |
72 |
> |
static int x11_close(), x11_clear(), x11_paintr(), x11_errout(), |
73 |
|
x11_getcur(), x11_comout(), x11_comin(), x11_flush(); |
74 |
|
|
75 |
|
static struct driver x11_driver = { |
175 |
|
x11_clear(xres, yres) /* clear our display */ |
176 |
|
int xres, yres; |
177 |
|
{ |
178 |
– |
/* destroy command line */ |
179 |
– |
if (comline != NULL) |
180 |
– |
xt_close(comline); |
178 |
|
/* check limits */ |
179 |
|
if (xres < MINWIDTH) |
180 |
|
xres = MINWIDTH; |
190 |
|
sleep(2); /* wait for window manager */ |
191 |
|
XSync(ourdisplay, 1); /* discard input */ |
192 |
|
} |
193 |
+ |
XClearWindow(ourdisplay, gwind); |
194 |
+ |
/* reinitialize color table */ |
195 |
+ |
if (ourvisual->class == PseudoColor) |
196 |
+ |
if (getpixels() == 0) |
197 |
+ |
stderr_v("cannot allocate colors\n"); |
198 |
+ |
else |
199 |
+ |
new_ctab(ncolors); |
200 |
|
/* get new command line */ |
201 |
+ |
if (comline != NULL) |
202 |
+ |
xt_close(comline); |
203 |
|
comline = xt_open(ourdisplay, |
204 |
|
DefaultGC(ourdisplay,ourscreen), |
205 |
|
gwind, 0, gheight, gwidth, COMHEIGHT, 0, COMFN); |
208 |
|
quit(1); |
209 |
|
} |
210 |
|
XSelectInput(ourdisplay, comline->w, ExposureMask); |
205 |
– |
/* clear graphics window */ |
206 |
– |
XClearWindow(ourdisplay, gwind); |
207 |
– |
/* reinitialize color table */ |
208 |
– |
if (ourvisual->class == PseudoColor) |
209 |
– |
if (getpixels() == 0) |
210 |
– |
stderr_v("cannot allocate colors\n"); |
211 |
– |
else |
212 |
– |
new_ctab(ncolors); |
211 |
|
/* remove earmuffs */ |
212 |
|
XSelectInput(ourdisplay, gwind, |
213 |
|
StructureNotifyMask|ExposureMask|KeyPressMask|ButtonPressMask); |
248 |
|
x11_comin(inp, prompt) /* read in a command line */ |
249 |
|
char *inp, *prompt; |
250 |
|
{ |
251 |
< |
int x11_getc(), x11_comout(); |
251 |
> |
extern int x11_getc(); |
252 |
|
|
253 |
|
if (prompt != NULL) |
254 |
|
if (fromcombuf(inp, &x11_driver)) |