Fix dependencies between kernel options:
- When both SC_PIXEL_MODE and SC_NO_FONT_LOADING are defined, quietly drop SC_NO_FONT_LOADING, because the pixel(raster) console requires font. - When SC_NO_FONT_LOADING is defined, force SC_ALT_MOUSE_IMAGE. Without font, the arrow-shaped mouse cursor cannot be drawn. - Fiddle and simplify some internal macros. MFC after: 2 weeks
This commit is contained in:
parent
d193eadbdf
commit
44b37d9627
@ -325,6 +325,7 @@ static void
|
||||
draw_txtmouse(scr_stat *scp, int x, int y)
|
||||
{
|
||||
#ifndef SC_ALT_MOUSE_IMAGE
|
||||
if (ISMOUSEAVAIL(scp->sc->adp->va_flags)) {
|
||||
u_char font_buf[128];
|
||||
u_short cursor[32];
|
||||
u_char c;
|
||||
@ -384,7 +385,9 @@ draw_txtmouse(scr_stat *scp, int x, int y)
|
||||
sc_vtb_putc(&scp->scr, pos + scp->xsize + 1, c + 3,
|
||||
sc_vtb_geta(&scp->scr, pos + scp->xsize + 1));
|
||||
}
|
||||
#else /* SC_ALT_MOUSE_IMAGE */
|
||||
} else
|
||||
#endif /* SC_ALT_MOUSE_IMAGE */
|
||||
{
|
||||
/* Red, magenta and brown are mapped to green to to keep it readable */
|
||||
static const int col_conv[16] = {
|
||||
6, 6, 6, 6, 2, 2, 2, 6, 14, 14, 14, 14, 10, 10, 10, 14
|
||||
@ -401,7 +404,7 @@ draw_txtmouse(scr_stat *scp, int x, int y)
|
||||
else
|
||||
color = ((a & 0xf000) >> 4) | ((a & 0x0f00) << 4);
|
||||
sc_vtb_putc(&scp->scr, pos, sc_vtb_getc(&scp->scr, pos), color);
|
||||
#endif /* SC_ALT_MOUSE_IMAGE */
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -669,8 +669,6 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
|
||||
return 0;
|
||||
|
||||
case MOUSE_SHOW:
|
||||
if (!ISMOUSEAVAIL(scp->sc->adp->va_flags))
|
||||
return EINVAL;
|
||||
s = spltty();
|
||||
if (!(scp->sc->flags & SC_MOUSE_ENABLED)) {
|
||||
scp->sc->flags |= SC_MOUSE_ENABLED;
|
||||
|
@ -325,6 +325,7 @@ static void
|
||||
draw_txtmouse(scr_stat *scp, int x, int y)
|
||||
{
|
||||
#ifndef SC_ALT_MOUSE_IMAGE
|
||||
if (ISMOUSEAVAIL(scp->sc->adp->va_flags)) {
|
||||
u_char font_buf[128];
|
||||
u_short cursor[32];
|
||||
u_char c;
|
||||
@ -384,7 +385,9 @@ draw_txtmouse(scr_stat *scp, int x, int y)
|
||||
sc_vtb_putc(&scp->scr, pos + scp->xsize + 1, c + 3,
|
||||
sc_vtb_geta(&scp->scr, pos + scp->xsize + 1));
|
||||
}
|
||||
#else /* SC_ALT_MOUSE_IMAGE */
|
||||
} else
|
||||
#endif /* SC_ALT_MOUSE_IMAGE */
|
||||
{
|
||||
/* Red, magenta and brown are mapped to green to to keep it readable */
|
||||
static const int col_conv[16] = {
|
||||
6, 6, 6, 6, 2, 2, 2, 6, 14, 14, 14, 14, 10, 10, 10, 14
|
||||
@ -401,7 +404,7 @@ draw_txtmouse(scr_stat *scp, int x, int y)
|
||||
else
|
||||
color = ((a & 0xf000) >> 4) | ((a & 0x0f00) << 4);
|
||||
sc_vtb_putc(&scp->scr, pos, sc_vtb_getc(&scp->scr, pos), color);
|
||||
#endif /* SC_ALT_MOUSE_IMAGE */
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -412,9 +412,7 @@ scmeminit(void *arg)
|
||||
sc_alloc_scr_buffer(sc_console, FALSE, FALSE);
|
||||
|
||||
#ifndef SC_NO_CUTPASTE
|
||||
/* cut buffer is available only when the mouse pointer is used */
|
||||
if (ISMOUSEAVAIL(sc_console->sc->adp->va_flags))
|
||||
sc_alloc_cut_buffer(sc_console, FALSE);
|
||||
sc_alloc_cut_buffer(sc_console, FALSE);
|
||||
#endif
|
||||
|
||||
#ifndef SC_NO_HISTORY
|
||||
@ -2801,8 +2799,7 @@ static scr_stat
|
||||
sc_init_emulator(scp, "*");
|
||||
|
||||
#ifndef SC_NO_CUTPASTE
|
||||
if (ISMOUSEAVAIL(sc->adp->va_flags))
|
||||
sc_alloc_cut_buffer(scp, TRUE);
|
||||
sc_alloc_cut_buffer(scp, TRUE);
|
||||
#endif
|
||||
|
||||
#ifndef SC_NO_HISTORY
|
||||
|
@ -56,6 +56,20 @@
|
||||
#undef SC_PIXEL_MODE
|
||||
#endif
|
||||
|
||||
/* Always load font data if the pixel (raster text) mode is to be used. */
|
||||
#ifdef SC_PIXEL_MODE
|
||||
#undef SC_NO_FONT_LOADING
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If font data is not available, the `arrow'-shaped mouse cursor cannot
|
||||
* be drawn. Use the alternative drawing method.
|
||||
*/
|
||||
#ifdef SC_NO_FONT_LOADING
|
||||
#undef SC_ALT_MOUSE_IMAGE
|
||||
#define SC_ALT_MOUSE_IMAGE 1
|
||||
#endif
|
||||
|
||||
#ifndef SC_CURSOR_CHAR
|
||||
#define SC_CURSOR_CHAR (0x07)
|
||||
#endif
|
||||
@ -456,15 +470,9 @@ typedef struct {
|
||||
== PIXEL_MODE)
|
||||
#define ISUNKNOWNSC(scp) ((scp)->status & UNKNOWN_MODE)
|
||||
|
||||
#ifndef ISMOUSEAVAIL
|
||||
#ifdef SC_ALT_MOUSE_IMAGE
|
||||
#define ISMOUSEAVAIL(af) (1)
|
||||
#else
|
||||
#define ISMOUSEAVAIL(af) ((af) & V_ADP_FONT)
|
||||
#endif /* SC_ALT_MOUSE_IMAGE */
|
||||
#define ISFONTAVAIL(af) ((af) & V_ADP_FONT)
|
||||
#define ISPALAVAIL(af) ((af) & V_ADP_PALETTE)
|
||||
#endif /* ISMOUSEAVAIL */
|
||||
|
||||
#define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user