diff options
Diffstat (limited to 'console')
-rw-r--r-- | console/ChangeLog | 7 | ||||
-rw-r--r-- | console/display.c | 37 |
2 files changed, 37 insertions, 7 deletions
diff --git a/console/ChangeLog b/console/ChangeLog index bfa7eb14..e1bed32c 100644 --- a/console/ChangeLog +++ b/console/ChangeLog @@ -1,5 +1,12 @@ 2002-09-10 Marcus Brinkmann <marcus@gnu.org> + * display.c (DISPLAY_CHANGE_FLAGS): New macro. + (struct changes): New member FLAGS. + (display_flush_filechange): Handle change of flags. + (display_output_some): Initialize DISPLAY->changes.flags. + (display_start_output): Clear CONS_FLAGS_SCROLL_LOCK in DISPLAY. + (display_stop_output): Set CONS_FLAGS_SCROLL_LOCK in DISPLAY. + * display.c (display_output_some): If iconv fails with EILSEQ, skip the next byte in the buffer and print a replacement character. diff --git a/console/display.c b/console/display.c index 638ac222..d11091b4 100644 --- a/console/display.c +++ b/console/display.c @@ -48,6 +48,7 @@ struct changes { + uint32_t flags; struct { uint32_t col; @@ -66,13 +67,14 @@ struct changes off_t start; off_t end; -#define DISPLAY_CHANGE_CURSOR_POS 1 -#define DISPLAY_CHANGE_CURSOR_STATUS 2 -#define DISPLAY_CHANGE_SCREEN_CUR_LINE 4 -#define DISPLAY_CHANGE_SCREEN_SCR_LINES 8 -#define DISPLAY_CHANGE_BELL_AUDIBLE 16 -#define DISPLAY_CHANGE_BELL_VISIBLE 32 -#define DISPLAY_CHANGE_MATRIX 64 +#define DISPLAY_CHANGE_CURSOR_POS 0x0001 +#define DISPLAY_CHANGE_CURSOR_STATUS 0x0002 +#define DISPLAY_CHANGE_SCREEN_CUR_LINE 0x0004 +#define DISPLAY_CHANGE_SCREEN_SCR_LINES 0x0008 +#define DISPLAY_CHANGE_BELL_AUDIBLE 0x0010 +#define DISPLAY_CHANGE_BELL_VISIBLE 0x0020 +#define DISPLAY_CHANGE_FLAGS 0x0030 +#define DISPLAY_CHANGE_MATRIX 0x0040 unsigned int which; }; @@ -646,6 +648,16 @@ display_flush_filechange (display_t display, unsigned int type) display->changes.which &= ~DISPLAY_CHANGE_BELL_VISIBLE; } + if (type & DISPLAY_CHANGE_FLAGS + && display->changes.which & DISPLAY_CHANGE_FLAGS + && display->changes.flags != user->flags) + { + notify = 1; + next->what.flags = 1; + bump_written = 1; + display->changes.which &= ~DISPLAY_CHANGE_FLAGS; + } + if (bump_written) user->changes.written++; if (notify) @@ -1609,6 +1621,7 @@ display_output_some (display_t display, char **buffer, size_t *length) display->changes.screen.scr_lines = display->user->screen.scr_lines; display->changes.bell_audible = display->user->bell.audible; display->changes.bell_visible = display->user->bell.visible; + display->changes.flags = display->user->flags; display->changes.which = ~DISPLAY_CHANGE_MATRIX; while (!err && *length > 0) @@ -1913,6 +1926,7 @@ display_output (display_t display, int nonblock, char *data, size_t datalen) return amount; } + ssize_t display_read (display_t display, int nonblock, off_t off, char *data, size_t len) @@ -1923,6 +1937,7 @@ display_read (display_t display, int nonblock, off_t off, return len; } + /* Resume the output on the display DISPLAY. */ void display_start_output (display_t display) @@ -1933,6 +1948,10 @@ display_start_output (display_t display) display->output.stopped = 0; condition_broadcast (&display->output.resumed); } + display->changes.flags = display->user->flags; + display->changes.which = DISPLAY_CHANGE_FLAGS; + display->user->flags &= ~CONS_FLAGS_SCROLL_LOCK; + display_flush_filechange (display, DISPLAY_CHANGE_FLAGS); mutex_unlock (&display->lock); } @@ -1943,6 +1962,10 @@ display_stop_output (display_t display) { mutex_lock (&display->lock); display->output.stopped = 1; + display->changes.flags = display->user->flags; + display->changes.which = DISPLAY_CHANGE_FLAGS; + display->user->flags |= CONS_FLAGS_SCROLL_LOCK; + display_flush_filechange (display, DISPLAY_CHANGE_FLAGS); mutex_unlock (&display->lock); } |