Implement selective text attributes for the syscons vty / vt100 emulator

selection since an attribute which looks good on a color console doesn't
necessarily look good in an xterm.
This commit is contained in:
Jordan K. Hubbard 1996-06-08 09:08:51 +00:00
parent 0453d3cbb3
commit dabbacad12
20 changed files with 52 additions and 55 deletions

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.48 1996/05/09 09:42:03 jkh Exp $
* $Id: disks.c,v 1.49 1996/06/08 08:01:43 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -101,7 +101,7 @@ print_chunks(Disk *d)
"Subtype", "Flags");
for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) {
if (i == current_chunk)
attrset(tag_attr);
attrset(ATTR_SELECTED);
mvprintw(row, 2, "%10ld %10lu %10lu %8s %8d %8s %8d\t%-6s",
chunk_info[i]->offset, chunk_info[i]->size,
chunk_info[i]->end, chunk_info[i]->name,

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id$
* $Id: dispatch.c,v 1.1 1996/05/16 11:47:27 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -82,6 +82,7 @@ static struct _word {
{ "mediaSetFtpUserPass", mediaSetFtpUserPass },
{ "mediaSetCPIOVerbosity", mediaSetCPIOVerbosity },
{ "mediaGetType", mediaGetType },
{ "optionsEditor", optionsEditor },
{ NULL, NULL },
};
@ -119,7 +120,5 @@ dispatchCommand(char *str)
msgConfirm("No such command: %s", str);
return DITEM_FAILURE;
}
else if (DITEM_STATUS(i) != DITEM_SUCCESS)
msgConfirm("Command `%s' returned an error status.");
return i;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.48 1996/05/09 09:42:08 jkh Exp $
* $Id: label.c,v 1.49 1996/06/08 08:01:51 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -400,7 +400,7 @@ print_label_chunks(void)
if (label_chunk_info[i].type == PART_SLICE) {
sz = space_free(label_chunk_info[i].c);
if (i == here)
attrset(tag_attr);
attrset(ATTR_SELECTED);
mvprintw(srow++, 0, "Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name, sz, (sz / ONE_MEG));
attrset(A_NORMAL);
@ -447,7 +447,7 @@ print_label_chunks(void)
memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs));
onestr[PART_NEWFS_COL + strlen(newfs)] = '\0';
if (i == here)
wattrset(ChunkWin, tag_attr);
wattrset(ChunkWin, ATTR_SELECTED);
mvwaddstr(ChunkWin, prow, pcol, onestr);
wattrset(ChunkWin, A_NORMAL);
wrefresh(ChunkWin);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: msg.c,v 1.33 1996/05/16 11:47:40 jkh Exp $
* $Id: msg.c,v 1.34 1996/05/23 16:34:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -99,7 +99,7 @@ msgInfo(char *fmt, ...)
break;
}
line[80] = '\0';
attrset(item_attr);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, line);
attrset(attrs);
move(OnVTY ? VTY_STATLINE : TTY_STATLINE, 79);
@ -121,7 +121,7 @@ msgWarn(char *fmt, ...)
va_end(args);
attrs = getattrs(stdscr);
beep();
attrset(A_REVERSE);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr);
attrset(attrs);
refresh();
@ -144,7 +144,7 @@ msgError(char *fmt, ...)
va_end(args);
beep();
attrs = getattrs(stdscr);
attrset(A_REVERSE);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr);
attrset(attrs);
refresh();
@ -167,7 +167,7 @@ msgFatal(char *fmt, ...)
va_end(args);
beep();
attrs = getattrs(stdscr);
attrset(A_REVERSE);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr);
addstr(" - ");
addstr("PRESS ANY KEY TO ");

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
* $Id: options.c,v 1.36 1996/05/09 09:42:17 jkh Exp $
* $Id: options.c,v 1.37 1996/06/08 08:01:52 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -218,7 +218,7 @@ optionsEditor(dialogMenuItem *self)
/* Names are painted somewhat gratuitously each time, but it's easier this way */
mvprintw(optrow, OPT_NAME_COL + optcol, Options[i].name);
if (currOpt == i)
attrset(tag_attr);
attrset(ATTR_SELECTED);
mvprintw(optrow++, OPT_VALUE_COL + optcol, value_of(Options[i]));
if (currOpt == i)
attrset(A_NORMAL);

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: sysinstall.h,v 1.56 1996/05/16 11:47:44 jkh Exp $
* $Id: sysinstall.h,v 1.57 1996/05/29 01:35:30 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -129,6 +129,9 @@
/* One MB worth of blocks */
#define ONE_MEG 2048
/* Which selection attributes to use */
#define ATTR_SELECTED (OnVTY ? item_selected_attr : item_attr)
/*** Types ***/
typedef unsigned int Boolean;
typedef struct disk Disk;
@ -279,8 +282,6 @@ extern unsigned int XF86Dists; /* Which XFree86 dists we want */
extern unsigned int XF86ServerDists; /* The XFree86 servers we want */
extern unsigned int XF86FontDists; /* The XFree86 fonts we want */
extern int BootMgr; /* Which boot manager to use */
extern DMenu MenuInitial; /* Initial installation menu */
extern DMenu MenuFixit; /* Fixit repair menu */
extern DMenu MenuMBRType; /* Type of MBR to write on the disk */

View File

@ -30,7 +30,6 @@ set_termcap(void)
int stat;
OnVTY = FALSE;
term = getenv("TERM");
stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.48 1996/05/09 09:42:03 jkh Exp $
* $Id: disks.c,v 1.49 1996/06/08 08:01:43 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -101,7 +101,7 @@ print_chunks(Disk *d)
"Subtype", "Flags");
for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) {
if (i == current_chunk)
attrset(tag_attr);
attrset(ATTR_SELECTED);
mvprintw(row, 2, "%10ld %10lu %10lu %8s %8d %8s %8d\t%-6s",
chunk_info[i]->offset, chunk_info[i]->size,
chunk_info[i]->end, chunk_info[i]->name,

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id$
* $Id: dispatch.c,v 1.1 1996/05/16 11:47:27 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -82,6 +82,7 @@ static struct _word {
{ "mediaSetFtpUserPass", mediaSetFtpUserPass },
{ "mediaSetCPIOVerbosity", mediaSetCPIOVerbosity },
{ "mediaGetType", mediaGetType },
{ "optionsEditor", optionsEditor },
{ NULL, NULL },
};
@ -119,7 +120,5 @@ dispatchCommand(char *str)
msgConfirm("No such command: %s", str);
return DITEM_FAILURE;
}
else if (DITEM_STATUS(i) != DITEM_SUCCESS)
msgConfirm("Command `%s' returned an error status.");
return i;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.48 1996/05/09 09:42:08 jkh Exp $
* $Id: label.c,v 1.49 1996/06/08 08:01:51 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -400,7 +400,7 @@ print_label_chunks(void)
if (label_chunk_info[i].type == PART_SLICE) {
sz = space_free(label_chunk_info[i].c);
if (i == here)
attrset(tag_attr);
attrset(ATTR_SELECTED);
mvprintw(srow++, 0, "Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name, sz, (sz / ONE_MEG));
attrset(A_NORMAL);
@ -447,7 +447,7 @@ print_label_chunks(void)
memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs));
onestr[PART_NEWFS_COL + strlen(newfs)] = '\0';
if (i == here)
wattrset(ChunkWin, tag_attr);
wattrset(ChunkWin, ATTR_SELECTED);
mvwaddstr(ChunkWin, prow, pcol, onestr);
wattrset(ChunkWin, A_NORMAL);
wrefresh(ChunkWin);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: msg.c,v 1.33 1996/05/16 11:47:40 jkh Exp $
* $Id: msg.c,v 1.34 1996/05/23 16:34:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -99,7 +99,7 @@ msgInfo(char *fmt, ...)
break;
}
line[80] = '\0';
attrset(item_attr);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, line);
attrset(attrs);
move(OnVTY ? VTY_STATLINE : TTY_STATLINE, 79);
@ -121,7 +121,7 @@ msgWarn(char *fmt, ...)
va_end(args);
attrs = getattrs(stdscr);
beep();
attrset(A_REVERSE);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr);
attrset(attrs);
refresh();
@ -144,7 +144,7 @@ msgError(char *fmt, ...)
va_end(args);
beep();
attrs = getattrs(stdscr);
attrset(A_REVERSE);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr);
attrset(attrs);
refresh();
@ -167,7 +167,7 @@ msgFatal(char *fmt, ...)
va_end(args);
beep();
attrs = getattrs(stdscr);
attrset(A_REVERSE);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr);
addstr(" - ");
addstr("PRESS ANY KEY TO ");

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: sysinstall.h,v 1.56 1996/05/16 11:47:44 jkh Exp $
* $Id: sysinstall.h,v 1.57 1996/05/29 01:35:30 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -129,6 +129,9 @@
/* One MB worth of blocks */
#define ONE_MEG 2048
/* Which selection attributes to use */
#define ATTR_SELECTED (OnVTY ? item_selected_attr : item_attr)
/*** Types ***/
typedef unsigned int Boolean;
typedef struct disk Disk;
@ -279,8 +282,6 @@ extern unsigned int XF86Dists; /* Which XFree86 dists we want */
extern unsigned int XF86ServerDists; /* The XFree86 servers we want */
extern unsigned int XF86FontDists; /* The XFree86 fonts we want */
extern int BootMgr; /* Which boot manager to use */
extern DMenu MenuInitial; /* Initial installation menu */
extern DMenu MenuFixit; /* Fixit repair menu */
extern DMenu MenuMBRType; /* Type of MBR to write on the disk */

View File

@ -30,7 +30,6 @@ set_termcap(void)
int stat;
OnVTY = FALSE;
term = getenv("TERM");
stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.48 1996/05/09 09:42:03 jkh Exp $
* $Id: disks.c,v 1.49 1996/06/08 08:01:43 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -101,7 +101,7 @@ print_chunks(Disk *d)
"Subtype", "Flags");
for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) {
if (i == current_chunk)
attrset(tag_attr);
attrset(ATTR_SELECTED);
mvprintw(row, 2, "%10ld %10lu %10lu %8s %8d %8s %8d\t%-6s",
chunk_info[i]->offset, chunk_info[i]->size,
chunk_info[i]->end, chunk_info[i]->name,

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id$
* $Id: dispatch.c,v 1.1 1996/05/16 11:47:27 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -82,6 +82,7 @@ static struct _word {
{ "mediaSetFtpUserPass", mediaSetFtpUserPass },
{ "mediaSetCPIOVerbosity", mediaSetCPIOVerbosity },
{ "mediaGetType", mediaGetType },
{ "optionsEditor", optionsEditor },
{ NULL, NULL },
};
@ -119,7 +120,5 @@ dispatchCommand(char *str)
msgConfirm("No such command: %s", str);
return DITEM_FAILURE;
}
else if (DITEM_STATUS(i) != DITEM_SUCCESS)
msgConfirm("Command `%s' returned an error status.");
return i;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.48 1996/05/09 09:42:08 jkh Exp $
* $Id: label.c,v 1.49 1996/06/08 08:01:51 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -400,7 +400,7 @@ print_label_chunks(void)
if (label_chunk_info[i].type == PART_SLICE) {
sz = space_free(label_chunk_info[i].c);
if (i == here)
attrset(tag_attr);
attrset(ATTR_SELECTED);
mvprintw(srow++, 0, "Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name, sz, (sz / ONE_MEG));
attrset(A_NORMAL);
@ -447,7 +447,7 @@ print_label_chunks(void)
memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs));
onestr[PART_NEWFS_COL + strlen(newfs)] = '\0';
if (i == here)
wattrset(ChunkWin, tag_attr);
wattrset(ChunkWin, ATTR_SELECTED);
mvwaddstr(ChunkWin, prow, pcol, onestr);
wattrset(ChunkWin, A_NORMAL);
wrefresh(ChunkWin);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: msg.c,v 1.33 1996/05/16 11:47:40 jkh Exp $
* $Id: msg.c,v 1.34 1996/05/23 16:34:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -99,7 +99,7 @@ msgInfo(char *fmt, ...)
break;
}
line[80] = '\0';
attrset(item_attr);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, line);
attrset(attrs);
move(OnVTY ? VTY_STATLINE : TTY_STATLINE, 79);
@ -121,7 +121,7 @@ msgWarn(char *fmt, ...)
va_end(args);
attrs = getattrs(stdscr);
beep();
attrset(A_REVERSE);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr);
attrset(attrs);
refresh();
@ -144,7 +144,7 @@ msgError(char *fmt, ...)
va_end(args);
beep();
attrs = getattrs(stdscr);
attrset(A_REVERSE);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr);
attrset(attrs);
refresh();
@ -167,7 +167,7 @@ msgFatal(char *fmt, ...)
va_end(args);
beep();
attrs = getattrs(stdscr);
attrset(A_REVERSE);
attrset(title_attr);
mvaddstr(OnVTY ? VTY_STATLINE : TTY_STATLINE, 0, errstr);
addstr(" - ");
addstr("PRESS ANY KEY TO ");

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
* $Id: options.c,v 1.36 1996/05/09 09:42:17 jkh Exp $
* $Id: options.c,v 1.37 1996/06/08 08:01:52 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -218,7 +218,7 @@ optionsEditor(dialogMenuItem *self)
/* Names are painted somewhat gratuitously each time, but it's easier this way */
mvprintw(optrow, OPT_NAME_COL + optcol, Options[i].name);
if (currOpt == i)
attrset(tag_attr);
attrset(ATTR_SELECTED);
mvprintw(optrow++, OPT_VALUE_COL + optcol, value_of(Options[i]));
if (currOpt == i)
attrset(A_NORMAL);

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: sysinstall.h,v 1.56 1996/05/16 11:47:44 jkh Exp $
* $Id: sysinstall.h,v 1.57 1996/05/29 01:35:30 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -129,6 +129,9 @@
/* One MB worth of blocks */
#define ONE_MEG 2048
/* Which selection attributes to use */
#define ATTR_SELECTED (OnVTY ? item_selected_attr : item_attr)
/*** Types ***/
typedef unsigned int Boolean;
typedef struct disk Disk;
@ -279,8 +282,6 @@ extern unsigned int XF86Dists; /* Which XFree86 dists we want */
extern unsigned int XF86ServerDists; /* The XFree86 servers we want */
extern unsigned int XF86FontDists; /* The XFree86 fonts we want */
extern int BootMgr; /* Which boot manager to use */
extern DMenu MenuInitial; /* Initial installation menu */
extern DMenu MenuFixit; /* Fixit repair menu */
extern DMenu MenuMBRType; /* Type of MBR to write on the disk */

View File

@ -30,7 +30,6 @@ set_termcap(void)
int stat;
OnVTY = FALSE;
term = getenv("TERM");
stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);