| 15 |
|
int (*getcur)(); /* get cursor position */ |
| 16 |
|
int (*comout)(); /* command line output */ |
| 17 |
|
int (*comin)(); /* command line input */ |
| 18 |
+ |
int (*flush)(); /* flush output */ |
| 19 |
|
double pixaspect; /* pixel aspect ratio */ |
| 20 |
|
int xsiz, ysiz; /* device size */ |
| 21 |
|
int inpready; /* input ready on device */ |
| 22 |
|
}; |
| 23 |
< |
|
| 24 |
< |
extern int stderr_v(); /* error vectors */ |
| 24 |
< |
extern int (*wrnvec)(), (*errvec)(), (*cmdvec)(); |
| 25 |
< |
|
| 26 |
< |
extern struct driver *comm_init(); /* stream interface */ |
| 23 |
> |
/* stream interface */ |
| 24 |
> |
extern struct driver *comm_init(), *slave_init(); |
| 25 |
|
/* magic numbers for verification */ |
| 26 |
|
#define COM_SENDM 0x6f37 |
| 27 |
|
#define COM_RECVM 0x51da |
| 31 |
|
#define COM_GETCUR 2 |
| 32 |
|
#define COM_COMOUT 3 |
| 33 |
|
#define COM_COMIN 4 |
| 34 |
< |
#define NREQUESTS 5 /* number of valid requests */ |
| 34 |
> |
#define COM_FLUSH 5 |
| 35 |
> |
#define NREQUESTS 6 /* number of valid requests */ |
| 36 |
|
|
| 37 |
|
extern struct device { /* interactive device */ |
| 38 |
|
char *name; /* device name */ |
| 40 |
|
struct driver *(*init)(); /* initialize device */ |
| 41 |
|
} devtable[]; /* supported devices */ |
| 42 |
|
|
| 43 |
+ |
extern char dev_default[]; /* default device name */ |
| 44 |
+ |
|
| 45 |
|
#define MB1 ('\n') /* mouse button 1 */ |
| 46 |
|
#define MB2 ('\r') /* mouse button 2 */ |
| 47 |
|
#define MB3 (' ') /* mouse button 3 */ |
| 57 |
|
* The name string identifies the driver, |
| 58 |
|
* and the id string identifies the client. |
| 59 |
|
* A device can be open by at most one client. |
| 60 |
< |
* Be verbose in error reports; call stderr_v(). |
| 61 |
< |
* If device has its own error output, set errvec, |
| 61 |
< |
* cmdvec and wrnvec. |
| 60 |
> |
* Be verbose in error reports; call eputs(). |
| 61 |
> |
* If device has its own error output, set erract. |
| 62 |
|
* } |
| 63 |
|
* (*dev->close)() |
| 64 |
|
* { |
| 75 |
|
* int xmin, ymin, xmax, ymax; |
| 76 |
|
* { |
| 77 |
|
* Paint a half-open rectangle from (xmin,ymin) to (xmax,ymax) |
| 78 |
< |
* with the color col. Can call repaint() if necessary. |
| 78 |
> |
* with the color col. |
| 79 |
|
* } |
| 80 |
|
* (*dev->getcur)(xp, yp) |
| 81 |
|
* int *xp, *yp; |
| 99 |
|
* assuming the in buffer is big enough. Unless prompt is NULL, |
| 100 |
|
* the driver may substitute its own rview command. This is |
| 101 |
|
* the most reliable way to repaint areas of the screen. |
| 102 |
< |
* If the user enters an unrecognized control character is entered, |
| 102 |
> |
* If the user enters an unrecognized control character, |
| 103 |
|
* terminate input and return the string with only that character. |
| 104 |
|
* The input string should not contain a newline. The routines in |
| 105 |
|
* editline.c may be useful. Comin must work in consort with comout. |
| 106 |
+ |
* } |
| 107 |
+ |
* (*dev->flush)() |
| 108 |
+ |
* { |
| 109 |
+ |
* Flush output to the display. This is guaranteed to be called |
| 110 |
+ |
* frequently enough to keep the display up to date. |
| 111 |
+ |
* This is an ideal time to check for device input. |
| 112 |
+ |
* This function can be NULL for devices that don't need it. |
| 113 |
|
* } |
| 114 |
|
* xsiz, ysiz |
| 115 |
|
* The maximum allowable x and y dimensions. If any |