diff options
| -rw-r--r-- | ui-curses.c | 10 | ||||
| -rw-r--r-- | ui.h | 2 | ||||
| -rw-r--r-- | vis.c | 8 | ||||
| -rw-r--r-- | vis.h | 3 |
4 files changed, 23 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))) { @@ -80,6 +80,8 @@ struct UiWin { void (*options_set)(UiWin*, enum UiOption); enum UiOption (*options_get)(UiWin*); bool (*syntax_style)(UiWin*, int id, const char *style); + int (*window_width)(UiWin*); + int (*window_height)(UiWin*); }; #endif @@ -268,6 +268,14 @@ bool vis_window_syntax_set(Win *win, const char *syntax) { return !syntax || win->lexer_name; } +int vis_window_width_get(const Win *win) { + return win->ui->window_width(win->ui); +} + +int vis_window_height_get(const Win *win) { + return win->ui->window_height(win->ui); +} + void vis_draw(Vis *vis) { vis->ui->draw(vis->ui); } @@ -104,6 +104,9 @@ void vis_window_swap(Win*, Win*); const char *vis_window_syntax_get(Win*); bool vis_window_syntax_set(Win*, const char *name); +int vis_window_width_get(const Win*); +int vis_window_height_get(const Win*); + /* display a user prompt with a certain title and default text */ void vis_prompt_show(Vis*, const char *title); |
