/[hurd]/hurd/console/display.c
ViewVC logotype

Diff of /hurd/console/display.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by marcus, Wed Aug 28 17:28:35 2002 UTC revision 1.19 by marcus, Thu Aug 29 23:57:44 2002 UTC
# Line 125  typedef struct output *output_t; Line 125  typedef struct output *output_t;
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;
# Line 978  handle_esc_bracket_m (attr_t attr, int c Line 977  handle_esc_bracket_m (attr_t attr, int c
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:
# Line 1041  handle_esc_bracket_m (attr_t attr, int c Line 1038  handle_esc_bracket_m (attr_t attr, int c
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>.  */
# Line 1049  handle_esc_bracket_m (attr_t attr, int c Line 1046  handle_esc_bracket_m (attr_t attr, int c
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  }  }
# Line 1519  display_output_one (display_t display, w Line 1516  display_output_one (display_t display, w
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.  */
# Line 1681  display_init (void) Line 1676  display_init (void)
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;
# Line 1704  display_create (display_t *r_display, co Line 1699  display_create (display_t *r_display, co
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)

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26