From 9cc0d6d3f8a89f35ddea92e30bdc2822c4164358 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 22 Aug 2002 19:24:19 +0000 Subject: libcons/ 2002-08-22 Marcus Brinkmann * 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. --- libcons/vcons-refresh.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 libcons/vcons-refresh.c (limited to 'libcons/vcons-refresh.c') 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 +#include + +#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); +} -- cgit v1.2.3