summaryrefslogtreecommitdiff
path: root/console
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-09-10 18:05:41 +0000
committerMarcus Brinkmann <marcus@gnu.org>2002-09-10 18:05:41 +0000
commitbe549330de1979ba914194bd79bfd7eb998a792e (patch)
tree0e507d51c57f7a94934c3cf2ad3eaf72461ae510 /console
parent26482336f2919d72935a8aacc42420aa89138cbd (diff)
console/
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. hurd/ 2002-09-10 Marcus Brinkmann <marcus@gnu.org> * console.h (struct cons_display): New member FLAGS. (union cons_change_t): Likewise for WHAT->flags. libcons/ 2002-09-10 Marcus Brinkmann <marcus@gnu.org> * cons.h: New prototype for cons_vcons_set_scroll_lock. (struct vcons): Add member FLAGS to state. * file-changed.c (cons_S_file_changed): Handle change of flags. * vcons-refresh.c (cons_vcons_refresh): Copy FLAGS field. Call cons_vcons_set_scroll_lock. * cons-switch.c (cons_switch): Initialize VCONS_ENTRY even if DELTA is negative. utils/ 2002-09-09 Marcus Brinkmann <marcus@gnu.org> * console-ncurses.c (cons_vcons_set_scroll_lock): New function.
Diffstat (limited to 'console')
-rw-r--r--console/ChangeLog7
-rw-r--r--console/display.c37
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);
}