diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2014-10-01 11:29:09 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-10-02 08:40:43 +0200 |
commit | dda57d9143644d39091207b287f142f91f55d0ad (patch) | |
tree | 93991e28537dc9790c57f7b8604321bd6adf1051 /src/libsystemd-terminal/term-screen.c | |
parent | a30f1425133d2b64a1c3f0113a710528872a3cbb (diff) |
terminal: add helpers to retrieve page dimensions
Allow term users to retrieve the page dimensions of a terminal screen.
This is needed to properly calculate the grid dimensions when rendering.
Diffstat (limited to 'src/libsystemd-terminal/term-screen.c')
-rw-r--r-- | src/libsystemd-terminal/term-screen.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libsystemd-terminal/term-screen.c b/src/libsystemd-terminal/term-screen.c index 67f9056d57..14c32aceb9 100644 --- a/src/libsystemd-terminal/term-screen.c +++ b/src/libsystemd-terminal/term-screen.c @@ -3743,6 +3743,18 @@ static int screen_feed_cmd(term_screen *screen, const term_seq *seq) { return 0; } +unsigned int term_screen_get_width(term_screen *screen) { + assert_return(screen, -EINVAL); + + return screen->page->width; +} + +unsigned int term_screen_get_height(term_screen *screen) { + assert_return(screen, -EINVAL); + + return screen->page->height; +} + int term_screen_feed_text(term_screen *screen, const uint8_t *in, size_t size) { const uint32_t *ucs4_str; size_t i, j, ucs4_len; |