define a "clear screen" command to the emulator and complete the
emulation's "reset" implementations as far as useful
This commit is contained in:
parent
3e7448240b
commit
b69b2fd8f4
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wsemul_dumb.c,v 1.5 1998/06/20 21:52:50 drochner Exp $ */
|
||||
/* $NetBSD: wsemul_dumb.c,v 1.6 1999/01/17 15:44:57 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.5 1998/06/20 21:52:50 drochner Exp $";
|
||||
"$NetBSD: wsemul_dumb.c,v 1.6 1999/01/17 15:44:57 drochner Exp $";
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -54,6 +54,7 @@ void wsemul_dumb_output __P((void *cookie, const u_char *data, u_int count,
|
|||
int));
|
||||
int wsemul_dumb_translate __P((void *cookie, keysym_t, char **));
|
||||
void wsemul_dumb_detach __P((void *cookie, u_int *crowp, u_int *ccolp));
|
||||
void wsemul_dumb_resetop __P((void *, enum wsemul_resetops));
|
||||
|
||||
const struct wsemul_ops wsemul_dumb_ops = {
|
||||
"dumb",
|
||||
|
@ -62,6 +63,7 @@ const struct wsemul_ops wsemul_dumb_ops = {
|
|||
wsemul_dumb_output,
|
||||
wsemul_dumb_translate,
|
||||
wsemul_dumb_detach,
|
||||
wsemul_dumb_resetop
|
||||
};
|
||||
|
||||
struct wsemul_dumb_emuldata {
|
||||
|
@ -230,3 +232,22 @@ wsemul_dumb_detach(cookie, crowp, ccolp)
|
|||
if (edp != &wsemul_dumb_console_emuldata)
|
||||
free(edp, M_DEVBUF);
|
||||
}
|
||||
|
||||
void
|
||||
wsemul_dumb_resetop(cookie, op)
|
||||
void *cookie;
|
||||
enum wsemul_resetops op;
|
||||
{
|
||||
struct wsemul_dumb_emuldata *edp = cookie;
|
||||
|
||||
switch (op) {
|
||||
case WSEMUL_CLEARSCREEN:
|
||||
(*edp->emulops->eraserows)(edp->emulcookie, 0, edp->nrows,
|
||||
edp->defattr);
|
||||
edp->ccol = edp->crow = 0;
|
||||
(*edp->emulops->cursor)(edp->emulcookie, 1, 0, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wsemul_sun.c,v 1.9 1999/01/10 00:28:21 augustss Exp $ */
|
||||
/* $NetBSD: wsemul_sun.c,v 1.10 1999/01/17 15:44:57 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.9 1999/01/10 00:28:21 augustss Exp $";
|
||||
"$NetBSD: wsemul_sun.c,v 1.10 1999/01/17 15:44:57 drochner Exp $";
|
||||
|
||||
/* XXX DESCRIPTION/SOURCE OF INFORMATION */
|
||||
|
||||
|
@ -59,6 +59,7 @@ void wsemul_sun_output __P((void *cookie, const u_char *data, u_int count,
|
|||
int));
|
||||
int wsemul_sun_translate __P((void *cookie, keysym_t, char **));
|
||||
void wsemul_sun_detach __P((void *cookie, u_int *crowp, u_int *ccolp));
|
||||
void wsemul_sun_resetop __P((void *, enum wsemul_resetops));
|
||||
|
||||
const struct wsemul_ops wsemul_sun_ops = {
|
||||
"sun",
|
||||
|
@ -67,6 +68,7 @@ const struct wsemul_ops wsemul_sun_ops = {
|
|||
wsemul_sun_output,
|
||||
wsemul_sun_translate,
|
||||
wsemul_sun_detach,
|
||||
wsemul_sun_resetop
|
||||
};
|
||||
|
||||
#define SUN_EMUL_STATE_NORMAL 0 /* normal processing */
|
||||
|
@ -639,3 +641,28 @@ wsemul_sun_detach(cookie, crowp, ccolp)
|
|||
if (edp != &wsemul_sun_console_emuldata)
|
||||
free(edp, M_DEVBUF);
|
||||
}
|
||||
|
||||
void
|
||||
wsemul_sun_resetop(cookie, op)
|
||||
void *cookie;
|
||||
enum wsemul_resetops op;
|
||||
{
|
||||
struct wsemul_sun_emuldata *edp = cookie;
|
||||
|
||||
switch (op) {
|
||||
case WSEMUL_RESET:
|
||||
edp->state = SUN_EMUL_STATE_NORMAL;
|
||||
edp->scrolldist = 1;
|
||||
edp->rendflags = 0;
|
||||
edp->curattr = edp->defattr;
|
||||
break;
|
||||
case WSEMUL_CLEARSCREEN:
|
||||
(*edp->emulops->eraserows)(edp->emulcookie, 0, edp->nrows,
|
||||
edp->defattr);
|
||||
edp->ccol = edp->crow = 0;
|
||||
(*edp->emulops->cursor)(edp->emulcookie, 1, 0, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wsemul_vt100.c,v 1.9 1999/01/13 15:38:30 drochner Exp $ */
|
||||
/* $NetBSD: wsemul_vt100.c,v 1.10 1999/01/17 15:44:57 drochner Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998
|
||||
|
@ -269,6 +269,14 @@ wsemul_vt100_resetop(cookie, op)
|
|||
case WSEMUL_SYNCFONT:
|
||||
vt100_initchartables(edp);
|
||||
break;
|
||||
case WSEMUL_CLEARSCREEN:
|
||||
wsemul_vt100_ed(edp, 2);
|
||||
edp->ccol = edp->crow = 0;
|
||||
(*edp->emulops->cursor)(edp->emulcookie,
|
||||
edp->flags & VTFL_CURSORON, 0, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: wsemulvar.h,v 1.5 1999/01/13 15:30:59 drochner Exp $ */
|
||||
/* $NetBSD: wsemulvar.h,v 1.6 1999/01/17 15:46:15 drochner Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
|
||||
|
@ -35,7 +35,8 @@ struct wsdisplay_emulops;
|
|||
|
||||
enum wsemul_resetops {
|
||||
WSEMUL_RESET,
|
||||
WSEMUL_SYNCFONT
|
||||
WSEMUL_SYNCFONT,
|
||||
WSEMUL_CLEARSCREEN
|
||||
};
|
||||
|
||||
struct wsemul_ops {
|
||||
|
|
Loading…
Reference in New Issue