sysinst: the IRIX Indigo Magic colours on a fixed-colour console
The first screen follows the console theme now: where curses cannot
redefine a colour (wscons, VGA text), util.c's set_coloring() takes the
IRIX Indigo Magic console - light text (snow) on ANSI magenta, the
closest the eight fixed colours get to Indigo #4B0082 - with a black
selection on light white, a black box and the window colour behind the
menus. The colour menu still offers the classic schemes: do_coloring()
passes startup=false, only main.c's first call does not.
i386/conf/GENERIC gets the same four wscons defaults as amd64 (commit
46b08b567e): WS_DEFAULT_FG=LIGHT_WHITE, WS_DEFAULT_BG=MAGENTA,
WS_KERNEL_FG=GREEN, WS_KERNEL_BG=MAGENTA.
Measured: sysinst built with nbmake-amd64 (build/obj/usr.sbin/sysinst/
arch/amd64), -Werror, linked; nm util.o has do_coloring_startup. i386
GENERIC through nbconfig generates opt_wsmsgattrs.h with the four
defines. The i386 kernel itself was not compiled yet: build.sh has no
i386 toolchain in this tree and the build lock was held by the MCDE
build.
This commit is contained in:
1 parent
59c667621c
commit
2c30d21fd2
4 files changed
+47
-10
No files matched your search
@@ -227,12 +227,16 @@ options NFS_BOOT_DHCP,NFS_BOOT_BOOTPARAM
|
||||
options WSEMUL_VT100 # VT100 / VT220 emulation
|
||||
# customization of console and kernel output - see dev/wscons/wsdisplayvar.h
|
||||
options WSDISPLAY_CUSTOM_OUTPUT # color customization from wsconsctl(8)
|
||||
#options WS_DEFAULT_FG=WSCOL_WHITE
|
||||
#options WS_DEFAULT_BG=WSCOL_BLACK
|
||||
#options WS_DEFAULT_COLATTR="(0)"
|
||||
#options WS_DEFAULT_MONOATTR="(0)"
|
||||
# Makronix: the IRIX Indigo Magic console, the same defaults as amd64 (see
|
||||
# arch/amd64/conf/GENERIC). wscons names only the ANSI colours; ANSI 5
|
||||
# (magenta, #AA00AA on VGA text) is the closest to IRIX Indigo (#4B0082), whose
|
||||
# exact value needs a colormap (WSDISPLAYIO_PUTCMAP) VGA text mode lacks.
|
||||
options WS_DEFAULT_FG=WSCOL_LIGHT_WHITE
|
||||
options WS_DEFAULT_BG=WSCOL_MAGENTA
|
||||
options WS_KERNEL_FG=WSCOL_GREEN
|
||||
#options WS_KERNEL_BG=WSCOL_BLACK
|
||||
options WS_KERNEL_BG=WSCOL_MAGENTA
|
||||
#options WS_KERNEL_COLATTR=""
|
||||
#options WS_KERNEL_MONOATTR=""
|
||||
# customization of console border color
|
||||
|
||||
@@ -908,6 +908,7 @@ int extract_file(distinfo *, int);
|
||||
int extract_file_to(distinfo *dist, int update, const char *dest_dir,
|
||||
const char *extr_pattern, bool do_stats);
|
||||
void do_coloring (unsigned int, unsigned int);
|
||||
void do_coloring_startup (unsigned int, unsigned int);
|
||||
int set_menu_select(menudesc *, void *);
|
||||
const char *safectime(time_t *);
|
||||
bool use_tgz_for_set(const char*);
|
||||
|
||||
@@ -205,8 +205,9 @@ init(void)
|
||||
|
||||
/*
|
||||
* Makronix: the CDE look, dark text on the palette's window colour.
|
||||
* With the eight fixed colours of a console this is black on white;
|
||||
* do_coloring() makes it the CDE colour where the terminal can.
|
||||
* Where the terminal has only the eight fixed colours, the first
|
||||
* screen takes the IRIX Indigo Magic console instead (light text on
|
||||
* ANSI magenta; see do_coloring_startup()).
|
||||
*/
|
||||
clr_arg.bg=COLOR_WHITE;
|
||||
clr_arg.fg=COLOR_BLACK;
|
||||
@@ -311,7 +312,12 @@ main(int argc, char **argv)
|
||||
}
|
||||
if (has_colors()) {
|
||||
start_color();
|
||||
do_coloring(clr_arg.fg,clr_arg.bg);
|
||||
/*
|
||||
* Makronix: the first screen follows the console theme (the
|
||||
* IRIX Indigo Magic colours where the terminal has only the
|
||||
* eight fixed ones); the colour menu later stays classic.
|
||||
*/
|
||||
do_coloring_startup(clr_arg.fg, clr_arg.bg);
|
||||
}
|
||||
msg_window(mainwin);
|
||||
|
||||
|
||||
@@ -2359,8 +2359,9 @@ cde_contrast(int r, int g, int b)
|
||||
COLOR_BLACK : COLOR_CYAN;
|
||||
}
|
||||
|
||||
void
|
||||
do_coloring(unsigned int fg, unsigned int bg) {
|
||||
static void
|
||||
set_coloring(unsigned int fg, unsigned int bg, bool startup)
|
||||
{
|
||||
if (bg > COLOR_WHITE)
|
||||
bg = COLOR_BLUE;
|
||||
if (fg > COLOR_WHITE)
|
||||
@@ -2369,6 +2370,10 @@ do_coloring(unsigned int fg, unsigned int bg) {
|
||||
/*
|
||||
* The default pair is white background, black text: where the
|
||||
* terminal can redefine a colour, make that white the CDE one.
|
||||
* On a fixed-colour console (wscons, VGA text) the startup
|
||||
* takes the IRIX Indigo Magic colours instead: light text on
|
||||
* ANSI magenta, a black selection on light white and a black
|
||||
* box on magenta. The colour menu keeps the classic schemes.
|
||||
*/
|
||||
if (bg == COLOR_WHITE && fg == COLOR_BLACK) {
|
||||
/*
|
||||
@@ -2377,8 +2382,9 @@ do_coloring(unsigned int fg, unsigned int bg) {
|
||||
* redefinable palette: slot 5 is the window (COLOR_WHITE),
|
||||
* slot 6 the menu/dialog (COLOR_BLUE), slot 1 the active
|
||||
* line (COLOR_GREEN); the text colour is chosen for
|
||||
* contrast. With the eight fixed colours: white on blue,
|
||||
* blue box, menus on the window colour (pair 1).
|
||||
* contrast. With the eight fixed colours: IRIX white on
|
||||
* magenta at startup, or white on blue for the colour
|
||||
* menu.
|
||||
*/
|
||||
if (can_change_color()) {
|
||||
(void)init_color(COLOR_WHITE, CDE_BG_R,
|
||||
@@ -2393,6 +2399,12 @@ do_coloring(unsigned int fg, unsigned int bg) {
|
||||
init_pair(3, COLOR_BLUE, COLOR_WHITE);
|
||||
init_pair(4, cde_contrast(CDE_MENU_R,
|
||||
CDE_MENU_G, CDE_MENU_B), COLOR_BLUE);
|
||||
} else if (startup) {
|
||||
fg = COLOR_WHITE;
|
||||
bg = COLOR_MAGENTA;
|
||||
init_pair(2, COLOR_BLACK, COLOR_WHITE);
|
||||
init_pair(3, COLOR_BLACK, COLOR_MAGENTA);
|
||||
init_pair(4, COLOR_BLACK, COLOR_BLACK);
|
||||
} else {
|
||||
init_pair(2, COLOR_WHITE, COLOR_BLUE);
|
||||
init_pair(3, COLOR_BLUE, COLOR_WHITE);
|
||||
@@ -2422,6 +2434,20 @@ do_coloring(unsigned int fg, unsigned int bg) {
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
do_coloring(unsigned int fg, unsigned int bg)
|
||||
{
|
||||
|
||||
set_coloring(fg, bg, false);
|
||||
}
|
||||
|
||||
void
|
||||
do_coloring_startup(unsigned int fg, unsigned int bg)
|
||||
{
|
||||
|
||||
set_coloring(fg, bg, true);
|
||||
}
|
||||
|
||||
int
|
||||
set_menu_select(menudesc *m, void *arg)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user