Patch #6210: implement ability to resize output device parameters to
authorBen Pfaff <blp@gnu.org>
Wed, 26 Sep 2007 04:24:07 +0000 (04:24 +0000)
committerBen Pfaff <blp@gnu.org>
Wed, 26 Sep 2007 04:24:07 +0000 (04:24 +0000)
commitbce579d144b66ca2eee18f6d27d847285a96d7b9
tree05a2e3685302a761274895041497960fa79a997c
parent646890cac8de355277617ea100898c7d858a92d2
Patch #6210: implement ability to resize output device parameters to
fit terminal window size as it changes.  Reviewed by John Darrington.

* automake.mk (src_ui_terminal_libui_a_SOURCES): Add new files.

* terminal.c: New file.

* terminal.h: New file.

* main.c (main): No need to set up SIGWINCH handler any longer.
But we do need to call terminal_init.
(set_fallback_viewport): Move to terminal.c.
[HAVE_LIBNCURSES] (get_termcap_viewport): Ditto.
[!HAVE_LIBNCURSES] (get_termcap_viewport): Ditto.

* read-line.c (readln_read): After the first line of a command,
call terminal_check_size to allow it to re-detect the terminal
size.

* ascii.c: Implement ability to resize output device parameters to
fit terminal window size as it changes.
(struct ascii_driver_ext): New members `auto_width',
`auto_length'.
(ascii_open_driver): Initialize new members, call
update_page_size.
(update_page_size): New function to update device size.
(handle_option): Support new "auto" setting for length, width.
(ascii_open_page): Call update_page_size.

* devices (tty-ascii): Set length and width to "auto", so that
they reflect the current size of the terminal window as it
changes.
config/ChangeLog
config/devices
doc/configuring.texi
src/output/ChangeLog
src/output/ascii.c
src/ui/terminal/ChangeLog
src/ui/terminal/automake.mk
src/ui/terminal/main.c
src/ui/terminal/read-line.c
src/ui/terminal/terminal.c [new file with mode: 0644]
src/ui/terminal/terminal.h [new file with mode: 0644]