From be549330de1979ba914194bd79bfd7eb998a792e Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 10 Sep 2002 18:05:41 +0000 Subject: console/ 2002-09-10 Marcus Brinkmann * 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 * console.h (struct cons_display): New member FLAGS. (union cons_change_t): Likewise for WHAT->flags. libcons/ 2002-09-10 Marcus Brinkmann * 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 * console-ncurses.c (cons_vcons_set_scroll_lock): New function. --- libcons/ChangeLog | 11 +++++++++++ libcons/cons-switch.c | 1 + libcons/cons.h | 5 +++++ libcons/file-changed.c | 10 ++++++++++ libcons/vcons-refresh.c | 2 ++ 5 files changed, 29 insertions(+) (limited to 'libcons') diff --git a/libcons/ChangeLog b/libcons/ChangeLog index bae85db0..e6323d2f 100644 --- a/libcons/ChangeLog +++ b/libcons/ChangeLog @@ -1,3 +1,14 @@ +2002-09-10 Marcus Brinkmann + + * 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. + 2002-09-09 Marcus Brinkmann * Makefile (SRCS): Add vcons-scrollback.c. diff --git a/libcons/cons-switch.c b/libcons/cons-switch.c index c39e83da..752af97e 100644 --- a/libcons/cons-switch.c +++ b/libcons/cons-switch.c @@ -56,6 +56,7 @@ cons_switch (vcons_t vcons, int id, int delta, vcons_t *r_vcons) else { assert (delta < 0); + vcons_entry = vcons->vcons_entry; while (delta++ < 0) { vcons_entry = vcons_entry->prev; diff --git a/libcons/cons.h b/libcons/cons.h index 6b2fca49..783aeb6a 100644 --- a/libcons/cons.h +++ b/libcons/cons.h @@ -76,6 +76,7 @@ struct vcons struct { + uint32_t flags; struct { uint32_t col; @@ -195,6 +196,10 @@ void cons_vcons_beep (vcons_t vcons); VCONS, which is locked, flash visibly. */ void cons_vcons_flash (vcons_t vcons); +/* The user must define this function. Notice the current status of + the scroll lock flag. */ +void cons_vcons_set_scroll_lock (vcons_t vcons, int onoff); + /* The user must define this function. It is called whenever a virtual console is selected to be the active one. It is the user's responsibility to close the console at some later time. */ diff --git a/libcons/file-changed.c b/libcons/file-changed.c index b4372ed9..fabc7f6e 100644 --- a/libcons/file-changed.c +++ b/libcons/file-changed.c @@ -202,6 +202,16 @@ cons_S_file_changed (cons_notify_t notify, natural_t tickno, vcons->state.bell.visible++; } } + if (change.what.flags) + { + uint32_t flags = vcons->display->flags; + + if (flags & CONS_FLAGS_SCROLL_LOCK + != vcons->display->flags & CONS_FLAGS_SCROLL_LOCK) + cons_vcons_set_scroll_lock (vcons, flags + & CONS_FLAGS_SCROLL_LOCK); + vcons->state.flags = flags; + } } else { diff --git a/libcons/vcons-refresh.c b/libcons/vcons-refresh.c index 35e74224..c2db2c57 100644 --- a/libcons/vcons-refresh.c +++ b/libcons/vcons-refresh.c @@ -34,6 +34,7 @@ cons_vcons_refresh (vcons_t vcons) vcons->state.cursor.status = vcons->display->cursor.status; vcons->state.bell.audible = vcons->display->bell.audible; vcons->state.bell.visible = vcons->display->bell.visible; + vcons->state.flags = vcons->display->flags; vcons->state.changes.written = vcons->display->changes.written; cons_vcons_write (vcons, vcons->state.screen.matrix @@ -60,5 +61,6 @@ cons_vcons_refresh (vcons_t vcons) cons_vcons_set_cursor_pos (vcons, vcons->state.cursor.col, vcons->state.cursor.row); cons_vcons_set_cursor_status (vcons, vcons->state.cursor.status); + cons_vcons_set_scroll_lock (vcons, vcons->state.flags & CONS_FLAGS_SCROLL_LOCK); cons_vcons_update (vcons); } -- cgit v1.2.3