A structure used to specify the display emulation functions. All displays intending to provide terminal emulation must provide this structure and pass it to the
wsdisplay(4) child device. It has the following members:
void (*cursor)(void *c, int on, int row, int col);
int (*mapchar)(void *, int, unsigned int *);
void (*putchar)(void *c, int row, int col,
u_int uc, long attr);
void (*copycols)(void *c, int row, int srccol,
int dstcol, int ncols);
void (*erasecols)(void *c, int row, int startcol,
int ncols, long);
void (*copyrows)(void *c, int srcrow, int dstrow,
int nrows);
void (*eraserows)(void *c, int row, int nrows, long);
int (*allocattr)(void *c, int fg, int bg, int flags,
long *);
void (*replaceattr)(void *c, long oldattr,
long newattr);
The
cursor member defines a function for painting (or unpainting, depending on the
on parameter) the cursor at the specified position. The
mapchar member defines a function for changing the character mapped at a given position in the character table. The
putchar member defines a function for writing a character on the screen, given its position and attribute. The
copycols member defines a function for copying a set of columns within the same line. The
erasecols member defines a function for clearing a set of columns in a line, filling the space with the given attribute. The
copyrows member defines a function for copying a set of complete rows. The
eraserows member defines a function for clearing a set of complete rows, filling the space with the given attribute. The
allocattr member defines a function for converting an attribute specification given by its foreground color, background color and flags, to the internal representation used by the underlying graphics driver. The
replaceattr member defines a function for replacing an attribute by another one across the whole visible part of the screen; this function is optional.
There is a
void * cookie provided by the display driver associated with these functions, which is passed to them when they are invoked.