| 38 |
|
|
| 39 |
|
#define ourscreen DefaultScreen(ourdisplay) |
| 40 |
|
#define ourroot RootWindow(ourdisplay,ourscreen) |
| 41 |
– |
#define ourwhite WhitePixel(ourdisplay,ourscreen) |
| 42 |
– |
#define ourblack BlackPixel(ourdisplay,ourscreen) |
| 41 |
|
|
| 42 |
|
#define levptr(etype) ((etype *)¤tevent) |
| 43 |
|
|
| 45 |
|
|
| 46 |
|
static int ncolors = 0; /* color table size */ |
| 47 |
|
static unsigned long *pixval = NULL; /* allocated pixels */ |
| 48 |
+ |
static unsigned long ourblack=0, ourwhite=1; |
| 49 |
|
|
| 50 |
|
static Display *ourdisplay = NULL; /* our display */ |
| 51 |
|
|
| 97 |
|
if ( !XMatchVisualInfo(ourdisplay,ourscreen, |
| 98 |
|
24,TrueColor,&ourvinfo) && |
| 99 |
|
!XMatchVisualInfo(ourdisplay,ourscreen, |
| 100 |
< |
24,DirectColor,&ourvinfo) ) |
| 100 |
> |
24,DirectColor,&ourvinfo) ) { |
| 101 |
|
if (nplanes < 4) { |
| 102 |
|
stderr_v("not enough colors\n"); |
| 103 |
|
return(NULL); |
| 108 |
|
stderr_v("unsupported visual type\n"); |
| 109 |
|
return(NULL); |
| 110 |
|
} |
| 111 |
+ |
ourblack = BlackPixel(ourdisplay,ourscreen); |
| 112 |
+ |
ourwhite = WhitePixel(ourdisplay,ourscreen); |
| 113 |
+ |
} else { |
| 114 |
+ |
ourblack = 0; |
| 115 |
+ |
ourwhite = ~0; |
| 116 |
+ |
} |
| 117 |
|
make_gmap(GAMMA); |
| 118 |
|
/* open window */ |
| 119 |
|
ourwinattr.background_pixel = ourblack; |
| 210 |
|
/* get new command line */ |
| 211 |
|
if (comline != NULL) |
| 212 |
|
xt_close(comline); |
| 213 |
< |
comline = xt_open(ourdisplay, |
| 214 |
< |
DefaultGC(ourdisplay,ourscreen), |
| 210 |
< |
gwind, 0, gheight, gwidth, COMHEIGHT, 0, COMFN); |
| 213 |
> |
comline = xt_open(ourdisplay, gwind, 0, gheight, |
| 214 |
> |
gwidth, COMHEIGHT, 0, ourblack, ourwhite, COMFN); |
| 215 |
|
if (comline == NULL) { |
| 216 |
|
stderr_v("Cannot open command line window\n"); |
| 217 |
|
quit(1); |