~xzfc/libvterm/libvterm

« back to all changes in this revision

Viewing changes to src/screen.c

  • Committer: Albert Safin
  • Date: 2017-10-25 09:41:50 UTC
  • Revision ID: xzfcpw@gmail.com-20171025094150-wq78wsd1fwwiju4a
Export color indexes

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
{
15
15
  /* After the bitfield */
16
16
  VTermColor   fg, bg;
 
17
  int32_t      fg_index, bg_index;
17
18
 
18
19
  unsigned int bold      : 1;
19
20
  unsigned int underline : 2;
426
427
  case VTERM_ATTR_BACKGROUND:
427
428
    screen->pen.bg = val->color;
428
429
    return 1;
 
430
  case VTERM_ATTR_FOREGROUND_INDEX:
 
431
    screen->pen.fg_index = val->number;
 
432
    return 1;
 
433
  case VTERM_ATTR_BACKGROUND_INDEX:
 
434
    screen->pen.bg_index = val->number;
 
435
    return 1;
429
436
 
430
437
  case VTERM_N_ATTRS:
431
438
    return 0;
759
766
 
760
767
  cell->fg = intcell->pen.fg;
761
768
  cell->bg = intcell->pen.bg;
 
769
  cell->fg_index = intcell->pen.fg_index;
 
770
  cell->bg_index = intcell->pen.bg_index;
762
771
 
763
772
  if(pos.col < (screen->cols - 1) &&
764
773
     getcell(screen, pos.row, pos.col + 1)->chars[0] == (uint32_t)-1)
793
802
 
794
803
  intcell->pen.fg = cell->fg;
795
804
  intcell->pen.bg = cell->bg;
 
805
  intcell->pen.fg_index = cell->fg_index;
 
806
  intcell->pen.bg_index = cell->bg_index;
796
807
 
797
808
  if(cell->width == 2)
798
809
    getcell(screen, pos.row, pos.col + 1)->chars[0] = (uint32_t)-1;