diff options
author | ray <ray@FreeBSD.org> | 2013-10-31 09:44:48 +0000 |
---|---|---|
committer | ray <ray@FreeBSD.org> | 2013-10-31 09:44:48 +0000 |
commit | a2f43a333929fa6b49c089d9784d8729fc4ac198 (patch) | |
tree | 11c2e65900dc71865804f3bb32a7b8030f9830ab /sys/teken | |
parent | 630a3895d30eb6c0180ef08707c747fb080bf20c (diff) | |
download | FreeBSD-src-a2f43a333929fa6b49c089d9784d8729fc4ac198.zip FreeBSD-src-a2f43a333929fa6b49c089d9784d8729fc4ac198.tar.gz |
Add teken_subr_do_resize new method, to update taken sizes w/o reset positions
and use it in case we update terminal size not touching existing data.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/teken')
-rw-r--r-- | sys/teken/teken.c | 8 | ||||
-rw-r--r-- | sys/teken/teken.h | 1 | ||||
-rw-r--r-- | sys/teken/teken_subr.h | 9 |
3 files changed, 18 insertions, 0 deletions
diff --git a/sys/teken/teken.c b/sys/teken/teken.c index 8ca88d2..a54c9f9 100644 --- a/sys/teken/teken.c +++ b/sys/teken/teken.c @@ -347,6 +347,14 @@ teken_set_winsize(teken_t *t, const teken_pos_t *p) } void +teken_set_winsize_noreset(teken_t *t, const teken_pos_t *p) +{ + + t->t_winsize = *p; + teken_subr_do_resize(t); +} + +void teken_set_8bit(teken_t *t) { diff --git a/sys/teken/teken.h b/sys/teken/teken.h index 2feef6e..a9bca98 100644 --- a/sys/teken/teken.h +++ b/sys/teken/teken.h @@ -168,6 +168,7 @@ void teken_set_cursor(teken_t *, const teken_pos_t *); void teken_set_curattr(teken_t *, const teken_attr_t *); void teken_set_defattr(teken_t *, const teken_attr_t *); void teken_set_winsize(teken_t *, const teken_pos_t *); +void teken_set_winsize_noreset(teken_t *, const teken_pos_t *); /* Key input escape sequences. */ #define TKEY_UP 0x00 diff --git a/sys/teken/teken_subr.h b/sys/teken/teken_subr.h index 64f4e54..f25ab6a 100644 --- a/sys/teken/teken_subr.h +++ b/sys/teken/teken_subr.h @@ -956,6 +956,15 @@ teken_subr_reset_mode(teken_t *t, unsigned int cmd) } static void +teken_subr_do_resize(teken_t *t) +{ + + t->t_scrollreg.ts_begin = 0; + t->t_scrollreg.ts_end = t->t_winsize.tp_row; + t->t_originreg = t->t_scrollreg; +} + +static void teken_subr_do_reset(teken_t *t) { |