58 |
uint32_t cur_line; |
uint32_t cur_line; |
59 |
uint32_t scr_lines; |
uint32_t scr_lines; |
60 |
} screen; |
} screen; |
61 |
|
|
62 |
|
uint32_t bell_audible; |
63 |
|
uint32_t bell_visible; |
64 |
|
|
65 |
off_t start; |
off_t start; |
66 |
off_t end; |
off_t end; |
67 |
|
|
69 |
#define DISPLAY_CHANGE_CURSOR_STATUS 2 |
#define DISPLAY_CHANGE_CURSOR_STATUS 2 |
70 |
#define DISPLAY_CHANGE_SCREEN_CUR_LINE 4 |
#define DISPLAY_CHANGE_SCREEN_CUR_LINE 4 |
71 |
#define DISPLAY_CHANGE_SCREEN_SCR_LINES 8 |
#define DISPLAY_CHANGE_SCREEN_SCR_LINES 8 |
72 |
#define DISPLAY_CHANGE_MATRIX 16 |
#define DISPLAY_CHANGE_BELL_AUDIBLE 16 |
73 |
|
#define DISPLAY_CHANGE_BELL_VISIBLE 32 |
74 |
|
#define DISPLAY_CHANGE_MATRIX 64 |
75 |
unsigned int which; |
unsigned int which; |
76 |
}; |
}; |
77 |
|
|
550 |
display_flush_filechange (display_t display, unsigned int type) |
display_flush_filechange (display_t display, unsigned int type) |
551 |
{ |
{ |
552 |
struct cons_display *user = display->user; |
struct cons_display *user = display->user; |
553 |
cons_change_t *next = &user->changes._buffer[(user->changes.written + 1) |
cons_change_t *next = &user->changes._buffer[user->changes.written |
554 |
% _CONS_CHANGES_LENGTH]; |
% _CONS_CHANGES_LENGTH]; |
555 |
int notify = 0; |
int notify = 0; |
556 |
int bump_written = 0; |
int bump_written = 0; |
562 |
next->matrix.start = display->changes.start; |
next->matrix.start = display->changes.start; |
563 |
next->matrix.end = display->changes.end; |
next->matrix.end = display->changes.end; |
564 |
user->changes.written++; |
user->changes.written++; |
565 |
next = &user->changes._buffer[(user->changes.written + 1) |
next = &user->changes._buffer[user->changes.written |
566 |
% _CONS_CHANGES_LENGTH]; |
% _CONS_CHANGES_LENGTH]; |
567 |
display->changes.which &= ~DISPLAY_CHANGE_MATRIX; |
display->changes.which &= ~DISPLAY_CHANGE_MATRIX; |
568 |
} |
} |
611 |
display->changes.which &= ~DISPLAY_CHANGE_SCREEN_SCR_LINES; |
display->changes.which &= ~DISPLAY_CHANGE_SCREEN_SCR_LINES; |
612 |
} |
} |
613 |
|
|
614 |
|
if (type & DISPLAY_CHANGE_BELL_AUDIBLE |
615 |
|
&& display->changes.which & DISPLAY_CHANGE_BELL_AUDIBLE |
616 |
|
&& display->changes.bell_audible != user->bell.audible) |
617 |
|
{ |
618 |
|
notify = 1; |
619 |
|
next->what.bell_audible = 1; |
620 |
|
bump_written = 1; |
621 |
|
display->changes.which &= ~DISPLAY_CHANGE_BELL_AUDIBLE; |
622 |
|
} |
623 |
|
|
624 |
|
if (type & DISPLAY_CHANGE_BELL_VISIBLE |
625 |
|
&& display->changes.which & DISPLAY_CHANGE_BELL_VISIBLE |
626 |
|
&& display->changes.bell_visible != user->bell.visible) |
627 |
|
{ |
628 |
|
notify = 1; |
629 |
|
next->what.bell_visible = 1; |
630 |
|
bump_written = 1; |
631 |
|
display->changes.which &= ~DISPLAY_CHANGE_BELL_VISIBLE; |
632 |
|
} |
633 |
|
|
634 |
if (bump_written) |
if (bump_written) |
635 |
user->changes.written++; |
user->changes.written++; |
636 |
if (notify) |
if (notify) |
708 |
if (disjunct) |
if (disjunct) |
709 |
{ |
{ |
710 |
/* The regions are disjunct, so we have to flush the old |
/* The regions are disjunct, so we have to flush the old |
711 |
changes. */ |
changes. */ |
712 |
display_flush_filechange (display, DISPLAY_CHANGE_MATRIX); |
display_flush_filechange (display, DISPLAY_CHANGE_MATRIX); |
713 |
|
display->changes.which |= DISPLAY_CHANGE_MATRIX; |
714 |
} |
} |
715 |
display->changes.start = start; |
display->changes.start = start; |
716 |
display->changes.end = end; |
display->changes.end = end; |
1464 |
case L'\0': |
case L'\0': |
1465 |
/* Padding character: <pad>. */ |
/* Padding character: <pad>. */ |
1466 |
break; |
break; |
1467 |
|
case L'\a': |
1468 |
|
/* Audible bell. */ |
1469 |
|
user->bell.audible++; |
1470 |
|
break; |
1471 |
default: |
default: |
1472 |
{ |
{ |
1473 |
int line = (user->screen.cur_line + user->cursor.row) |
int line = (user->screen.cur_line + user->cursor.row) |
1529 |
/* In case the screen was larger before: */ |
/* In case the screen was larger before: */ |
1530 |
limit_cursor (display); |
limit_cursor (display); |
1531 |
break; |
break; |
1532 |
|
case L'g': |
1533 |
|
/* Visible bell. */ |
1534 |
|
user->bell.visible++; |
1535 |
|
break; |
1536 |
default: |
default: |
1537 |
/* Unsupported escape sequence. */ |
/* Unsupported escape sequence. */ |
1538 |
parse->state = STATE_NORMAL; |
parse->state = STATE_NORMAL; |
1590 |
display->changes.cursor.status = display->user->cursor.status; |
display->changes.cursor.status = display->user->cursor.status; |
1591 |
display->changes.screen.cur_line = display->user->screen.cur_line; |
display->changes.screen.cur_line = display->user->screen.cur_line; |
1592 |
display->changes.screen.scr_lines = display->user->screen.scr_lines; |
display->changes.screen.scr_lines = display->user->screen.scr_lines; |
1593 |
|
display->changes.bell_audible = display->user->bell.audible; |
1594 |
|
display->changes.bell_visible = display->user->bell.visible; |
1595 |
display->changes.which = ~DISPLAY_CHANGE_MATRIX; |
display->changes.which = ~DISPLAY_CHANGE_MATRIX; |
1596 |
|
|
1597 |
while (!err && *length > 0) |
while (!err && *length > 0) |