diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-05-21 13:01:22 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-05-22 00:05:31 +0200 |
| commit | 33b17306fb887b175ce62ad30af93d4dd9fd0d7e (patch) | |
| tree | 7aef72484c12d5ab548f2c1edbab43a7a51342af /ui-curses.c | |
| parent | c7d2f08ba44243ac1db478a0d5239763932a6861 (diff) | |
| download | vis-33b17306fb887b175ce62ad30af93d4dd9fd0d7e.tar.gz vis-33b17306fb887b175ce62ad30af93d4dd9fd0d7e.tar.xz | |
vis: add functions to query window size
Diffstat (limited to 'ui-curses.c')
| -rw-r--r-- | ui-curses.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ui-curses.c b/ui-curses.c index 45238f3..f2f215a 100644 --- a/ui-curses.c +++ b/ui-curses.c @@ -938,6 +938,14 @@ static enum UiOption ui_window_options_get(UiWin *w) { return win->options; } +static int ui_window_width(UiWin *win) { + return ((UiCursesWin*)win)->width; +} + +static int ui_window_height(UiWin *win) { + return ((UiCursesWin*)win)->height; +} + static void ui_window_swap(UiWin *aw, UiWin *bw) { UiCursesWin *a = (UiCursesWin*)aw; UiCursesWin *b = (UiCursesWin*)bw; @@ -981,6 +989,8 @@ static UiWin *ui_window_new(Ui *ui, View *view, File *file, enum UiOption option .options_get = ui_window_options_get, .reload = ui_window_reload, .syntax_style = ui_window_syntax_style, + .window_width = ui_window_width, + .window_height = ui_window_height, }; if (!(win->win = newwin(0, 0, 0, 0))) { |
