| 5 |
|
/* Copyright (c) 1989 Regents of the University of California */ |
| 6 |
|
|
| 7 |
|
/* |
| 8 |
< |
* x11.c - driver for X-windows version 11R4 |
| 8 |
> |
* x11.c - driver for X-windows version 10.4 |
| 9 |
|
* |
| 10 |
|
* 1989 |
| 11 |
|
*/ |
| 17 |
|
#include <X11/Xlib.h> |
| 18 |
|
#include <X11/cursorfont.h> |
| 19 |
|
#include <X11/Xutil.h> |
| 20 |
– |
#ifdef notdef |
| 21 |
– |
#include "bcross.cursor" |
| 22 |
– |
#include "bcross_mask.cu" |
| 23 |
– |
#endif |
| 20 |
|
|
| 21 |
|
#include "color.h" |
| 26 |
– |
|
| 22 |
|
#include "driver.h" |
| 28 |
– |
|
| 23 |
|
#include "x11twind.h" |
| 24 |
|
|
| 25 |
|
#define GAMMA 2.2 /* exponent for color correction */ |
| 26 |
|
|
| 27 |
|
#define BORWIDTH 5 /* border width */ |
| 34 |
– |
#define BARHEIGHT 25 /* menu bar size */ |
| 28 |
|
#define COMHEIGHT (COMLH*COMCH) /* command line height (pixels) */ |
| 29 |
|
|
| 30 |
|
#define COMFN "8x13" /* command line font name */ |
| 73 |
|
|
| 74 |
|
static struct driver x11_driver = { |
| 75 |
|
x11_close, x11_clear, x11_paintr, x11_getcur, |
| 76 |
< |
x11_comout, x11_comin, |
| 84 |
< |
MAXRES, MAXRES |
| 76 |
> |
x11_comout, x11_comin, 1.0 |
| 77 |
|
}; |
| 78 |
|
|
| 79 |
|
|
| 116 |
|
pickcursor = XCreateFontCursor (ourdisplay, XC_diamond_cross); |
| 117 |
|
/* new */ |
| 118 |
|
clientname = id; |
| 119 |
+ |
x11_driver.xsiz = DisplayWidth(ourdisplay,DefaultScreen(ourdisplay)) |
| 120 |
+ |
- 2*BORWIDTH; |
| 121 |
+ |
x11_driver.ysiz = DisplayHeight(ourdisplay,DefaultScreen(ourdisplay)) |
| 122 |
+ |
- (COMHEIGHT + 2*BORWIDTH); |
| 123 |
|
x11_driver.inpready = 0; |
| 124 |
|
cmdvec = x11_comout; /* set error vectors */ |
| 125 |
|
if (wrnvec != NULL) |
| 196 |
|
goto fail; |
| 197 |
|
gwidth = xres; |
| 198 |
|
gheight = yres; |
| 203 |
– |
XFlush(ourdisplay); |
| 204 |
– |
sleep(10); |
| 199 |
|
} else /* just clear */ |
| 200 |
|
XClearWindow(ourdisplay, gwind); |
| 201 |
|
/* reinitialize color table */ |
| 236 |
|
|
| 237 |
|
|
| 238 |
|
static |
| 239 |
< |
x11_comin(inp) /* read in a command line */ |
| 240 |
< |
char *inp; |
| 239 |
> |
x11_comin(inp, prompt) /* read in a command line */ |
| 240 |
> |
char *inp, *prompt; |
| 241 |
|
{ |
| 242 |
|
int x11_getc(), x11_comout(); |
| 243 |
|
|
| 244 |
+ |
if (prompt != NULL) |
| 245 |
+ |
xt_puts(prompt, comline); |
| 246 |
|
xt_cursor(comline, TBLKCURS); |
| 247 |
|
editline(inp, x11_getc, x11_comout); |
| 248 |
|
xt_cursor(comline, TNOCURS); |