diff options
| author | Marcus Brinkmann <marcus@gnu.org> | 2002-09-16 02:48:56 +0000 | 
|---|---|---|
| committer | Marcus Brinkmann <marcus@gnu.org> | 2002-09-16 02:48:56 +0000 | 
| commit | 43e87b8a95aa36ab5a7f78de3034e081bac2e8ad (patch) | |
| tree | 8620e769fd58379a8dfa34529aa8688cd9356c60 | |
| parent | a618f28ce12e97bfffea729bdf421c38a236f9ca (diff) | |
hurd/
2002-09-16  Marcus Brinkmann  <marcus@gnu.org>
	* console.h (conchar_attr_t): Add bits for italic and bold text
	attributes.
console/
2002-09-16  Marcus Brinkmann  <marcus@gnu.org>
	* hurd.ti: Add capabilities <sitm>, <ritm>, <gsbom>, <grbom>.
	* 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.
| -rw-r--r-- | console/ChangeLog | 9 | ||||
| -rw-r--r-- | console/console.c | 14 | ||||
| -rw-r--r-- | console/display.c | 19 | ||||
| -rw-r--r-- | console/hurd.ti | 5 | ||||
| -rw-r--r-- | hurd/ChangeLog | 5 | ||||
| -rw-r--r-- | hurd/console.h | 10 | 
6 files changed, 57 insertions, 5 deletions
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  <marcus@gnu.org> + +	* hurd.ti: Add capabilities <sitm>, <ritm>, <gsbom>, <grbom>. +	* 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  <marcus@gnu.org>  	* 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: <dim>.  */        attr->current.intensity = CONS_ATTR_INTENSITY_DIM;        break; +    case 3: +      /* Italic on: <sitm>.  */ +      attr->current.italic = 1; +      break;      case 4:        /* Underline on: <smul>.  */        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: <ritm>.  */ +      attr->current.italic = 1; +      break;      case 24:        /* Underline off: <rmul>.  */        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 <NEL>.  */  	  /* 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 <PU1>.  */ +	  /* Bold on: <gsbom>.  This is a GNU extension.  */ +	  display->attr.current.bold = 1; +	  break; +	case L'R':		/* ECMA-48 <PU2>.  */ +	  /* Bold off: <grbom>.  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, diff --git a/hurd/ChangeLog b/hurd/ChangeLog index d4c72fac..52ed7006 100644 --- a/hurd/ChangeLog +++ b/hurd/ChangeLog @@ -1,3 +1,8 @@ +2002-09-16  Marcus Brinkmann  <marcus@gnu.org> + +	* console.h (conchar_attr_t): Add bits for italic and bold text +	attributes. +  2002-09-10  Marcus Brinkmann  <marcus@gnu.org>  	* console.h (struct cons_display): New member FLAGS. diff --git a/hurd/console.h b/hurd/console.h index bf15e357..09fd088f 100644 --- a/hurd/console.h +++ b/hurd/console.h @@ -31,17 +31,25 @@ typedef enum  typedef struct  { +  /* The intensity is traditionally a color attribute.  */  #define CONS_ATTR_INTENSITY_NORMAL	000000000000  #define CONS_ATTR_INTENSITY_BOLD	000000000001  #define CONS_ATTR_INTENSITY_DIM		000000000002    uint32_t intensity : 2; +    uint32_t underlined : 1;    uint32_t blinking : 1;    uint32_t reversed : 1;    uint32_t concealed : 1; + +  /* Color attributes.  */    uint32_t bgcol : 3;    uint32_t fgcol : 3; -} conchar_attr_t; + +  /* Font attributes.  */ +  uint32_t italic : 1; +  uint32_t bold : 1; +} conchar_attr_t;   typedef struct  {  | 
