| 208 | } |
| 209 | |
| 210 | RESTORE_WARNING_FORMAT_NONLITERAL |
| 211 | |
| 212 | static void |
| 213 | draw_status(void) |
| 214 | { |
| 215 | WINDOW *win = curses_get_nhwin(STATUS_WIN); |
| 216 | orient statorient = (orient) curses_get_window_orientation(STATUS_WIN); |
| 217 | boolean horiz = (statorient != ALIGN_RIGHT && statorient != ALIGN_LEFT); |
| 218 | boolean border = curses_window_has_border(STATUS_WIN); |
| 219 | |
| 220 | /* Figure out if we have proper window dimensions for horizontal |
| 221 | statusbar. */ |
| 222 | if (horiz) { |
| 223 | int ax = 0, ay = 0; |
| 224 | int cy = (iflags.wc2_statuslines < 3) ? 2 : 3; |
| 225 | |
| 226 | /* actual y (and x) */ |
| 227 | getmaxyx(win, ay, ax); |
| 228 | if (border) |
| 229 | ay -= 2; |
| 230 | |
| 231 | if (cy != ay) { /* something changed. Redo everything */ |
| 232 | curs_reset_windows(TRUE, TRUE); |
| 233 | win = curses_get_nhwin(STATUS_WIN); |
| 234 | } |
| 235 | nhUse(ax); /* getmaxyx macro isn't sufficient */ |
| 236 | } |
| 237 | |
| 238 | werase(win); |
| 239 | if (horiz) |
| 240 | draw_horizontal(border); |
| 241 | else |
| 242 | draw_vertical(border); |
| 243 | |
| 244 | if (border) |
| 245 | box(win, 0, 0); |
| 246 | wnoutrefresh(win); |
| 247 | } |
| 248 | |
| 249 | /* horizontal layout on 2 or 3 lines */ |
| 250 | static void |
no test coverage detected