125 |
|
|
126 |
struct attr |
struct attr |
127 |
{ |
{ |
128 |
unsigned int bgcol_def; |
conchar_attr_t attr_def; |
|
unsigned int fgcol_def; |
|
129 |
conchar_attr_t current; |
conchar_attr_t current; |
130 |
/* True if in alternate character set (ASCII graphic) mode. */ |
/* True if in alternate character set (ASCII graphic) mode. */ |
131 |
unsigned int altchar; |
unsigned int altchar; |
977 |
{ |
{ |
978 |
case 0: |
case 0: |
979 |
/* All attributes off: <sgr0>. */ |
/* All attributes off: <sgr0>. */ |
980 |
memset (&attr->current, 0, sizeof (conchar_attr_t)); |
attr->current = attr->attr_def; |
|
attr->current.fgcol = attr->fgcol_def; |
|
|
attr->current.bgcol = attr->bgcol_def; |
|
981 |
attr->altchar = 0; |
attr->altchar = 0; |
982 |
break; |
break; |
983 |
case 1: |
case 1: |
1038 |
break; |
break; |
1039 |
case 39: |
case 39: |
1040 |
/* Default foreground color; ANSI?. */ |
/* Default foreground color; ANSI?. */ |
1041 |
attr->current.fgcol = attr->fgcol_def; |
attr->current.fgcol = attr->attr_def.fgcol; |
1042 |
break; |
break; |
1043 |
case 40 ... 47: |
case 40 ... 47: |
1044 |
/* Set background color: <setab>. */ |
/* Set background color: <setab>. */ |
1046 |
break; |
break; |
1047 |
case 49: |
case 49: |
1048 |
/* Default background color; ANSI?. */ |
/* Default background color; ANSI?. */ |
1049 |
attr->current.bgcol = attr->bgcol_def; |
attr->current.bgcol = attr->attr_def.bgcol; |
1050 |
break; |
break; |
1051 |
} |
} |
1052 |
} |
} |
1516 |
break; |
break; |
1517 |
case L'M': /* ECMA-48 <RIS>. */ |
case L'M': /* ECMA-48 <RIS>. */ |
1518 |
/* Reset: <rs2>. */ |
/* Reset: <rs2>. */ |
1519 |
* (uint32_t *) &display->attr.current = 0; |
display->attr.current = display->attr.attr_def; |
|
display->attr.current.bgcol = display->attr.bgcol_def; |
|
|
display->attr.current.fgcol = display->attr.fgcol_def; |
|
1520 |
display->attr.altchar = 0; |
display->attr.altchar = 0; |
1521 |
user->cursor.status = CONS_CURSOR_NORMAL; |
user->cursor.status = CONS_CURSOR_NORMAL; |
1522 |
/* Fall through. */ |
/* Fall through. */ |
1676 |
being ENCODING. */ |
being ENCODING. */ |
1677 |
error_t |
error_t |
1678 |
display_create (display_t *r_display, const char *encoding, |
display_create (display_t *r_display, const char *encoding, |
1679 |
int foreground, int background) |
conchar_attr_t def_attr) |
1680 |
{ |
{ |
1681 |
error_t err = 0; |
error_t err = 0; |
1682 |
display_t display; |
display_t display; |
1699 |
display->notify_port->display = display; |
display->notify_port->display = display; |
1700 |
|
|
1701 |
mutex_init (&display->lock); |
mutex_init (&display->lock); |
1702 |
display->attr.bgcol_def = background; |
display->attr.attr_def = def_attr; |
1703 |
display->attr.fgcol_def = foreground; |
display->attr.current = display->attr.attr_def; |
|
display->attr.current.bgcol = display->attr.bgcol_def; |
|
|
display->attr.current.fgcol = display->attr.fgcol_def; |
|
1704 |
err = user_create (display, width, height, lines, L' ', |
err = user_create (display, width, height, lines, L' ', |
1705 |
display->attr.current); |
display->attr.current); |
1706 |
if (err) |
if (err) |