--- ray/src/rt/driver.h 1990/01/30 11:37:34 1.5 +++ ray/src/rt/driver.h 1991/11/12 17:09:21 2.1 @@ -15,6 +15,7 @@ struct driver { /* driver functions */ int (*getcur)(); /* get cursor position */ int (*comout)(); /* command line output */ int (*comin)(); /* command line input */ + int (*flush)(); /* flush output */ double pixaspect; /* pixel aspect ratio */ int xsiz, ysiz; /* device size */ int inpready; /* input ready on device */ @@ -33,7 +34,8 @@ extern struct driver *comm_init(); /* stream interfac #define COM_GETCUR 2 #define COM_COMOUT 3 #define COM_COMIN 4 -#define NREQUESTS 5 /* number of valid requests */ +#define COM_FLUSH 5 +#define NREQUESTS 6 /* number of valid requests */ extern struct device { /* interactive device */ char *name; /* device name */ @@ -41,6 +43,8 @@ extern struct device { /* interactive device */ struct driver *(*init)(); /* initialize device */ } devtable[]; /* supported devices */ +extern char dev_default[]; /* default device name */ + #define MB1 ('\n') /* mouse button 1 */ #define MB2 ('\r') /* mouse button 2 */ #define MB3 (' ') /* mouse button 3 */ @@ -75,7 +79,7 @@ extern struct device { /* interactive device */ * int xmin, ymin, xmax, ymax; * { * Paint a half-open rectangle from (xmin,ymin) to (xmax,ymax) - * with the color col. Can call repaint() if necessary. + * with the color col. * } * (*dev->getcur)(xp, yp) * int *xp, *yp; @@ -99,10 +103,17 @@ extern struct device { /* interactive device */ * assuming the in buffer is big enough. Unless prompt is NULL, * the driver may substitute its own rview command. This is * the most reliable way to repaint areas of the screen. - * If the user enters an unrecognized control character is entered, + * If the user enters an unrecognized control character, * terminate input and return the string with only that character. * The input string should not contain a newline. The routines in * editline.c may be useful. Comin must work in consort with comout. + * } + * (*dev->flush)() + * { + * Flush output to the display. This is guaranteed to be called + * frequently enough to keep the display up to date. + * This is an ideal time to check for device input. + * This function can be NULL for devices that don't need it. * } * xsiz, ysiz * The maximum allowable x and y dimensions. If any