diff options
author | Marcus Brinkmann <marcus@gnu.org> | 2003-08-15 21:07:31 +0000 |
---|---|---|
committer | Marcus Brinkmann <marcus@gnu.org> | 2003-08-15 21:07:31 +0000 |
commit | 1ee1295c23c6a62b957a8a593639460b592b9b64 (patch) | |
tree | 0974b6460eeb6248a7f7ae48109541f0c3122b70 /console-client/console.c | |
parent | 8ba76d487d9820cdbe5d40337ef787c77a6389a9 (diff) |
2003-08-11 Marco Gerards <metgerards@student.han.nl>
* console.c (cons_vcons_set_dimension): New function.
* display.h (display_ops): New interface set_dimension.
* ncursesw.c (ncursesw_set_dimension): New function.
(ncursesw_displ): Add ncursesw_set_dimension.
(ncurses_lock): Make variable static.
(current_width): New variable.
(current_height): Likewise.
(cursor_state): Likewise.
(cursor_hidden): Likewise.
(driver_ncursesw_ops): Added ncursesw_set_dimension.
* vga.c (current_width): New variable.
(current_height): Likewise.
(vga_display_set_cursor_status): If the cursor is outside the
screen, don't change the visibility.
(vga_display_set_cursor_pos): Don't set the cursor outside the
physical screen. Update cursor_hidden and hide/unhide
to match cursor_hidden. Function moved to above
vga_display_set_cursor_status.
(vga_display_scroll): Report an error when scrolling is not
possible.
(vga_display_clear): Recalculate cols, rows and length.
(vga_display_write): Make it wrap around the edge.
(vga_set_dimension): New function.
(vga_disp_ops): Added vga_set_dimension.
* ncursesw.c (conspad): New variable.
(padx): Likewise.
(pady): Likewise.
(autoscroll): Likewise.
(refresh_screen): new function.
(input_loop): Use conspad instead of (the default) stdscr.
Call console_exit instead of exiting here. Add keybindings
'j, 'k', 'l' and 'i' to scroll the console, add keybinding 'a'
to switch autoscroll.
(mvwputsn): Use conspad instead of (the default) stdscr.
(ncursesw_scroll): Likewise.
(ncursesw_write): Likewise.
(ncursesw_driver_start): Likewise. Initialize conspad.
(ncursesw_update): Call refresh_screen to refresh the console.
(ncursesw_set_cursor_pos): Use conspad instead of (the default)
stdscr. Make the console autoscroll.
* ncursesw.c (ncursesw_driver_start): Remove endwin call at
the end of the function.
* ncursesw.c (ncursesw_set_cursor_status): If the status can
not be set, use another status that can sanely be used instead
of the unavailable status.
Diffstat (limited to 'console-client/console.c')
-rw-r--r-- | console-client/console.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/console-client/console.c b/console-client/console.c index 34573580..0fb3aa97 100644 --- a/console-client/console.c +++ b/console-client/console.c @@ -1,5 +1,5 @@ /* console.c -- A pluggable console client. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003 Free Software Foundation, Inc. Written by Marcus Brinkmann. This program is free software; you can redistribute it and/or @@ -354,6 +354,23 @@ cons_vcons_set_scroll_lock (vcons_t vcons, int onoff) mutex_unlock (&global_lock); } + +/* The user must define this function. Clear the existing screen + matrix and set the size of the screen matrix to the dimension COL x + ROW. This call will be immediately followed by a call to + cons_vcons_write that covers the whole new screen matrix. */ +error_t +cons_vcons_set_dimension (vcons_t vcons, uint32_t col, uint32_t row) +{ + mutex_lock (&global_lock); + if (vcons == active_vcons) + display_iterate + if (display->ops->set_dimension) + display->ops->set_dimension (display->handle, col, row); + mutex_unlock (&global_lock); + return 0; +} + /* Console-specific options. */ static const struct argp_option |