Lines Matching +full:y +full:- +full:max

1 // SPDX-License-Identifier: GPL-2.0
36 #define COLOR_DEFAULT -1
107 for (; p->attr; p++) { in set_colors()
108 int attr = p->highlight; in set_colors()
110 if (p->has_color) { in set_colors()
112 init_pair(pair, p->color_fg, p->color_bg); in set_colors()
116 *p->attr = attr; in set_colors()
121 void print_in_middle(WINDOW *win, int y, int width, const char *str, int attrs) in print_in_middle() argument
124 mvwprintw(win, y, (width - strlen(str)) / 2, "%s", str); in print_in_middle()
168 int x, y; in fill_window() local
172 getmaxyx(win, y, x); in fill_window()
174 total_lines = min(total_lines, y); in fill_window()
207 int i, x, y; in btn_dialog() local
208 int res = -1; in btn_dialog()
229 total_width = max(msg_width, btns_width); in btn_dialog()
231 y = (getmaxy(stdscr)-(msg_lines+4))/2; in btn_dialog()
232 x = (getmaxx(stdscr)-(total_width+4))/2; in btn_dialog()
241 win = newwin(win_rows, total_width+4, y, x); in btn_dialog()
243 menu_win = derwin(win, 1, btns_width, win_rows-2, in btn_dialog()
244 1+(total_width+2-btns_width)/2); in btn_dialog()
246 msg_win = derwin(win, win_rows-2, msg_width, 1, in btn_dialog()
247 1+(total_width+2-msg_width)/2); in btn_dialog()
319 int i, x, y, lines, columns, win_lines, win_cols; in dialog_inputbox() local
320 int res = -1; in dialog_inputbox()
337 prompt_width = max(prompt_width, len); in dialog_inputbox()
341 prompt_width = max(prompt_width, strlen(title)); in dialog_inputbox()
343 win_lines = min(prompt_lines+6, lines-2); in dialog_inputbox()
344 win_cols = min(prompt_width+7, columns-2); in dialog_inputbox()
345 prompt_lines = max(win_lines-6, 0); in dialog_inputbox()
346 prompt_width = max(win_cols-7, 0); in dialog_inputbox()
349 y = (lines-win_lines)/2; in dialog_inputbox()
350 x = (columns-win_cols)/2; in dialog_inputbox()
355 win = newwin(win_lines, win_cols, y, x); in dialog_inputbox()
373 cursor_form_win = min(cursor_position, prompt_width-1); in dialog_inputbox()
375 result + cursor_position-cursor_form_win); in dialog_inputbox()
398 memmove(&result[cursor_position-1], in dialog_inputbox()
400 len-cursor_position+1); in dialog_inputbox()
401 cursor_position--; in dialog_inputbox()
402 cursor_form_win--; in dialog_inputbox()
403 len--; in dialog_inputbox()
410 len-cursor_position+1); in dialog_inputbox()
411 len--; in dialog_inputbox()
424 cursor_position--; in dialog_inputbox()
425 cursor_form_win--; in dialog_inputbox()
434 cursor_form_win = min(cursor_position, prompt_width-1); in dialog_inputbox()
447 len-cursor_position+1); in dialog_inputbox()
459 else if (cursor_form_win > prompt_width-1) in dialog_inputbox()
460 cursor_form_win = prompt_width-1; in dialog_inputbox()
466 result + cursor_position-cursor_form_win); in dialog_inputbox()
515 int x, y, lines, columns; in show_scroll_win_ext() local
539 total_cols = max(total_cols, len+2); in show_scroll_win_ext()
547 win_lines = min(total_lines+4, lines-2); in show_scroll_win_ext()
548 win_cols = min(total_cols+2, columns-2); in show_scroll_win_ext()
549 text_lines = max(win_lines-4, 0); in show_scroll_win_ext()
550 text_cols = max(win_cols-2, 0); in show_scroll_win_ext()
553 y = (lines-win_lines)/2; in show_scroll_win_ext()
554 x = (columns-win_cols)/2; in show_scroll_win_ext()
556 win = newwin(win_lines, win_cols, y, x); in show_scroll_win_ext()
581 start_y += text_lines-2; in show_scroll_win_ext()
585 start_y -= text_lines+2; in show_scroll_win_ext()
591 start_y = total_lines-text_lines; in show_scroll_win_ext()
599 start_y--; in show_scroll_win_ext()
603 start_x--; in show_scroll_win_ext()
611 size_t start = (get_line(text, start_y) - text); in show_scroll_win_ext()
612 size_t end = (get_line(text, start_y + text_lines) - text); in show_scroll_win_ext()
626 if (start_y >= total_lines-text_lines) in show_scroll_win_ext()
627 start_y = total_lines-text_lines; in show_scroll_win_ext()
630 if (start_x >= total_cols-text_cols) in show_scroll_win_ext()
631 start_x = total_cols-text_cols; in show_scroll_win_ext()