Change the calling interface for text output (to the graphics driver)

to take a single character at a time, where the character is an "int" now.
The old interface (took a string) was never called with more than 1
char to print, and the "int" allows us to handle charsets cleanly.
This commit is contained in:
drochner 1998-06-20 21:52:49 +00:00
parent 35e3b6dd86
commit d3e8687b47
6 changed files with 25 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wscons_raster.h,v 1.2 1998/05/14 20:49:56 drochner Exp $ */
/* $NetBSD: wscons_raster.h,v 1.3 1998/06/20 21:52:49 drochner Exp $ */
/*
* Copyright (c) 1992, 1993
@ -85,7 +85,7 @@ void rcons_init __P((struct rcons *rc, int mrow, int mcol));
/* Console emulation interface functions. See ansicons.h for more info. */
void rcons_cursor __P((void *, int, int, int));
void rcons_invert __P((void *, int));
void rcons_putstr __P((void *, int, int, char *, int, long));
void rcons_putchar __P((void *, int, int, u_int, long));
void rcons_copycols __P((void *, int, int, int, int));
void rcons_erasecols __P((void *, int, int, int, long));
void rcons_copyrows __P((void *, int, int, int));

View File

@ -1,4 +1,4 @@
/* $NetBSD: wscons_rops.c,v 1.2 1998/05/14 20:49:57 drochner Exp $ */
/* $NetBSD: wscons_rops.c,v 1.3 1998/06/20 21:52:50 drochner Exp $ */
/*
* Copyright (c) 1991, 1993
@ -98,14 +98,15 @@ rcons_cursor(id, on, row, col)
* Actually write a string to the frame buffer.
*/
void
rcons_putstr(id, row, col, str, n, attr)
rcons_putchar(id, row, col, uc, attr)
void *id;
int row, col, n;
char *str;
int row, col;
u_int uc;
long attr;
{
struct rcons *rc = id;
register int x, y, op;
u_char help;
x = col * rc->rc_font->width + rc->rc_xorigin;
y = row * rc->rc_font->height + rc->rc_font_ascent + rc->rc_yorigin;
@ -113,7 +114,8 @@ rcons_putstr(id, row, col, str, n, attr)
op = RAS_SRC;
if ((attr != 0) ^ ((rc->rc_bits & RC_INVERT) != 0))
op = RAS_NOT(op);
raster_textn(rc->rc_sp, x, y, op, rc->rc_font, str, n);
help = uc & 0xff;
raster_textn(rc->rc_sp, x, y, op, rc->rc_font, &help, 1);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsdisplayvar.h,v 1.3 1998/06/11 22:00:05 drochner Exp $ */
/* $NetBSD: wsdisplayvar.h,v 1.4 1998/06/20 21:52:50 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -50,8 +50,8 @@ struct device;
*/
struct wsdisplay_emulops {
void (*cursor) __P((void *c, int on, int row, int col));
void (*putstr) __P((void *c, int row, int col,
char *cp, int n, long));
void (*putchar) __P((void *c, int row, int col,
u_int uc, long attr));
void (*copycols) __P((void *c, int row, int srccol, int dstcol,
int ncols));
void (*erasecols) __P((void *c, int row, int startcol,

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsemul_dumb.c,v 1.4 1998/06/20 19:11:04 drochner Exp $ */
/* $NetBSD: wsemul_dumb.c,v 1.5 1998/06/20 21:52:50 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -33,7 +33,7 @@
static const char _copyright[] __attribute__ ((unused)) =
"Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.";
static const char _rcsid[] __attribute__ ((unused)) =
"$NetBSD: wsemul_dumb.c,v 1.4 1998/06/20 19:11:04 drochner Exp $";
"$NetBSD: wsemul_dumb.c,v 1.5 1998/06/20 21:52:50 drochner Exp $";
#include <sys/param.h>
#include <sys/systm.h>
@ -177,8 +177,8 @@ wsemul_dumb_output(cookie, data, count, kernel)
break;
default:
(*edp->emulops->putstr)(edp->emulcookie, edp->crow,
edp->ccol, &c, 1, edp->defattr);
(*edp->emulops->putchar)(edp->emulcookie, edp->crow,
edp->ccol, c, edp->defattr);
edp->ccol++;
/* if cur col is still on cur line, done. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsemul_sun.c,v 1.7 1998/06/20 19:11:05 drochner Exp $ */
/* $NetBSD: wsemul_sun.c,v 1.8 1998/06/20 21:52:50 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -33,7 +33,7 @@
static const char _copyright[] __attribute__ ((unused)) =
"Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.";
static const char _rcsid[] __attribute__ ((unused)) =
"$NetBSD: wsemul_sun.c,v 1.7 1998/06/20 19:11:05 drochner Exp $";
"$NetBSD: wsemul_sun.c,v 1.8 1998/06/20 21:52:50 drochner Exp $";
/* XXX DESCRIPTION/SOURCE OF INFORMATION */
@ -284,8 +284,8 @@ wsemul_sun_output_normal(edp, c, kernel)
/* FALLTHRU */
default: /* normal character */
(*edp->emulops->putstr)(edp->emulcookie, edp->crow, edp->ccol,
&c, 1, kernel ? edp->kernattr : edp->curattr);
(*edp->emulops->putchar)(edp->emulcookie, edp->crow, edp->ccol,
c, kernel ? edp->kernattr : edp->curattr);
edp->ccol++;
/* if cur col is still on cur line, done. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsemul_vt100.c,v 1.1 1998/06/20 19:17:47 drochner Exp $ */
/* $NetBSD: wsemul_vt100.c,v 1.2 1998/06/20 21:52:50 drochner Exp $ */
/*
* Copyright (c) 1998
@ -371,9 +371,8 @@ wsemul_vt100_output_normal(edp, c, kernel)
edp->ncols - edp->ccol - 1);
}
(*edp->emulops->putstr)(edp->emulcookie, edp->crow, edp->ccol,
&c, 1,
kernel ? edp->kernattr : edp->curattr);
(*edp->emulops->putchar)(edp->emulcookie, edp->crow, edp->ccol,
c, kernel ? edp->kernattr : edp->curattr);
if (edp->ccol < edp->ncols - 1)
edp->ccol++;
@ -984,8 +983,8 @@ wsemul_vt100_output_hash(edp, c)
int i, j;
for (i = 0; i < edp->nrows; i++)
for (j = 0; j < edp->ncols; j++)
(*edp->emulops->putstr)(edp->emulcookie, i, j,
"E", 1, edp->curattr);
(*edp->emulops->putchar)(edp->emulcookie, i, j,
'E', edp->curattr);
}
edp->ccol = 0;
edp->crow = 0;