From 43e87b8a95aa36ab5a7f78de3034e081bac2e8ad Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Mon, 16 Sep 2002 02:48:56 +0000 Subject: hurd/ 2002-09-16 Marcus Brinkmann * console.h (conchar_attr_t): Add bits for italic and bold text attributes. console/ 2002-09-16 Marcus Brinkmann * hurd.ti: Add capabilities , , , . * display.c (handle_esc_bracket_m): Add support for italic. (display_output_one): Add new capabilities PU1 and PU2 to toggle bold mode. Reset PARSE->state on most escape sequences. * console.c (parse_attributes): Rename old bold attribute to bright. Add support for italic and bold. --- console/ChangeLog | 9 +++++++++ console/console.c | 14 ++++++++++++-- console/display.c | 19 +++++++++++++++++-- console/hurd.ti | 5 +++++ 4 files changed, 43 insertions(+), 4 deletions(-) (limited to 'console') diff --git a/console/ChangeLog b/console/ChangeLog index e1bed32c..58dbcf17 100644 --- a/console/ChangeLog +++ b/console/ChangeLog @@ -1,3 +1,12 @@ +2002-09-16 Marcus Brinkmann + + * hurd.ti: Add capabilities , , , . + * display.c (handle_esc_bracket_m): Add support for italic. + (display_output_one): Add new capabilities PU1 and PU2 to toggle + bold mode. Reset PARSE->state on most escape sequences. + * console.c (parse_attributes): Rename old bold attribute to + bright. Add support for italic and bold. + 2002-09-10 Marcus Brinkmann * display.c (DISPLAY_CHANGE_FLAGS): New macro. diff --git a/console/console.c b/console/console.c index 3896f361..48567e1f 100644 --- a/console/console.c +++ b/console/console.c @@ -1360,9 +1360,9 @@ parse_attributes (const char *name, conchar_attr_t *attr) return EINVAL; attr->intensity = CONS_ATTR_INTENSITY_NORMAL; } - else if (!strncmp (name, "bold", 4)) + else if (!strncmp (name, "bright", 6)) { - name += 4; + name += 6; if (value != 1) return EINVAL; attr->intensity = CONS_ATTR_INTENSITY_BOLD; @@ -1389,6 +1389,16 @@ parse_attributes (const char *name, conchar_attr_t *attr) name += 9; attr->concealed = value; } + else if (!strncmp (name, "italic", 6)) + { + name += 6; + attr->italic = value; + } + else if (!strncmp (name, "bold", 4)) + { + name += 4; + attr->bold = value; + } else return EINVAL; diff --git a/console/display.c b/console/display.c index d11091b4..352e41c4 100644 --- a/console/display.c +++ b/console/display.c @@ -1000,6 +1000,10 @@ handle_esc_bracket_m (attr_t attr, int code) /* Dim on: . */ attr->current.intensity = CONS_ATTR_INTENSITY_DIM; break; + case 3: + /* Italic on: . */ + attr->current.italic = 1; + break; case 4: /* Underline on: . */ attr->current.underlined = 1; @@ -1028,6 +1032,10 @@ handle_esc_bracket_m (attr_t attr, int code) /* Normal intensity. */ attr->current.intensity = CONS_ATTR_INTENSITY_NORMAL; break; + case 23: + /* Italic off: . */ + attr->current.italic = 1; + break; case 24: /* Underline off: . */ attr->current.underlined = 0; @@ -1521,6 +1529,7 @@ display_output_one (display_t display, wchar_t chr) break; case STATE_ESC: + parse->state = STATE_NORMAL; switch (chr) { case L'[': @@ -1539,7 +1548,6 @@ display_output_one (display_t display, wchar_t chr) L' ', display->attr.current); user->cursor.col = user->cursor.row = 0; /* XXX Flag cursor change. */ - parse->state = STATE_NORMAL; break; case L'E': /* ECMA-48 . */ /* Newline. */ @@ -1562,9 +1570,16 @@ display_output_one (display_t display, wchar_t chr) /* Visible bell. */ user->bell.visible++; break; + case L'Q': /* ECMA-48 . */ + /* Bold on: . This is a GNU extension. */ + display->attr.current.bold = 1; + break; + case L'R': /* ECMA-48 . */ + /* Bold off: . This is a GNU extension. */ + display->attr.current.bold = 0; + break; default: /* Unsupported escape sequence. */ - parse->state = STATE_NORMAL; break; } break; diff --git a/console/hurd.ti b/console/hurd.ti index eb9d57b9..d0496d26 100644 --- a/console/hurd.ti +++ b/console/hurd.ti @@ -153,6 +153,11 @@ hurd|The GNU Hurd console server, smso=\E[7m, rmso=\E[27m, # Enable (disable) underline mode. smul=\E[4m, rmul=\E[24m, +# Enable (disable) italic mode. + sitm=\E[3m, ritm=\E[23m, +# Enable (disable) real bold (not intensity bright) mode. This is a +# GNU extension. + gsbom=\EQ, grbom=\ER, # XXX Linux has those also for rmpch and smpch. # Enable (disable) alternative character set. smacs=\E[11m, rmacs=\E[10m, -- cgit v1.2.3