diff options
author | Marcus Brinkmann <marcus@gnu.org> | 2002-08-22 19:24:19 +0000 |
---|---|---|
committer | Marcus Brinkmann <marcus@gnu.org> | 2002-08-22 19:24:19 +0000 |
commit | 9cc0d6d3f8a89f35ddea92e30bdc2822c4164358 (patch) | |
tree | d182cfe90532231aaff4411a9d0118e9e5a15e7e /libcons/vcons-refresh.c | |
parent | 4062fb2fcf938bb6a9c5d8f6404586cab11fe227 (diff) |
libcons/
2002-08-22 Marcus Brinkmann <marcus@gnu.org>
* demuxer.c, init-init.c, init-loop.c, opts-version.c,
extra-version.c, dir-changed.c, file-changed.c,
opts-std-startup.c, cons-lookup.c, cons-switch.c, vcons-remove.c,
vcons-add.c, vcons-open.c, vcons-close.c, vcons-refresh.c, priv.h,
mutations.h, cons.h: New files.
Diffstat (limited to 'libcons/vcons-refresh.c')
-rw-r--r-- | libcons/vcons-refresh.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/libcons/vcons-refresh.c b/libcons/vcons-refresh.c new file mode 100644 index 00000000..34f0de88 --- /dev/null +++ b/libcons/vcons-refresh.c @@ -0,0 +1,60 @@ +/* vcons-refresh.c - Redraw a virtual console. + Copyright (C) 2002 Free Software Foundation, Inc. + Written by Marcus Brinkmann. + + This file is part of the GNU Hurd. + + The GNU Hurd is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + The GNU Hurd is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ + +#include <errno.h> +#include <assert.h> + +#include "cons.h" + +/* Redraw the virtual console VCONS, which is locked. */ +void +cons_vcons_refresh (vcons_t vcons) +{ + vcons->state.screen.cur_line = vcons->display->screen.cur_line; + vcons->state.screen.scr_lines = vcons->display->screen.scr_lines; + vcons->state.cursor.col = vcons->display->cursor.col; + vcons->state.cursor.row = vcons->display->cursor.row; + 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.changes.written = vcons->display->changes.written; + + cons_vcons_write (vcons, vcons->state.screen.matrix + + vcons->state.screen.cur_line * vcons->state.screen.width, + ((vcons->state.screen.lines - vcons->state.screen.cur_line + < vcons->state.screen.height) + ? vcons->state.screen.lines - vcons->state.screen.cur_line + : vcons->state.screen.height) + * vcons->state.screen.width, 0, 0); + if (vcons->state.screen.lines - vcons->state.screen.cur_line + < vcons->state.screen.height) + cons_vcons_write (vcons, vcons->state.screen.matrix, + vcons->state.screen.height * vcons->state.screen.width + - (vcons->state.screen.lines + - vcons->state.screen.cur_line) + * vcons->state.screen.width, 0, + vcons->state.screen.lines + - vcons->state.screen.cur_line); + + 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_update (vcons); +} |