- do_exit(ret);
-}
-
-static void print_welcome(void)
-{
- if (loglevel > LL_NOTICE)
- return;
- outputf(COLOR_WELCOME, "Welcome to para_gui " PACKAGE_VERSION
- " \"" CODENAME "\". Theme: %s", theme.name);
- wclrtoeol(bot.win);
-}
-
-/*
- * init all windows
- */
-static void init_wins(int top_lines)
-{
- int i;
-
- top.lines = top_lines;
- top.cols = COLS;
- top.begy = 0;
- top.begx = 0;
-
- bot.lines = LINES - top.lines - 3;
- bot.cols = COLS;
- bot.begy = top.lines + 1;
- bot.begx = 0;
-
- sb.lines = 1;
- sb.cols = COLS;
- sb.begy = LINES - 2;
- sb.begx = 0;
-
- in.lines = 1;
- in.cols = COLS;
- in.begy = LINES - 1;
- in.begx = 0;
-
- sep.lines = 1;
- sep.cols = COLS;
- sep.begy = top.lines;
- sep.begx = 0;
-
- assume_default_colors(theme.default_fg, theme.default_bg);
- if (top.win) {
- mvwin(top.win, top.begy, top.begx);
- wresize(top.win, top.lines, top.cols);
-
- mvwin(sb.win, sb.begy, sb.begx);
- wresize(sb.win, sb.lines, sb.cols);
-
- mvwin(sep.win, sep.begy, sep.begx);
- wresize(sep.win, sep.lines, sep.cols);
-
- mvwin(bot.win, bot.begy, bot.begx);
- wresize(bot.win, bot.lines, bot.cols);
-
- mvwin(in.win, in.begy, in.begx);
- wresize(in.win, in.lines, in.cols);
- } else {
- sep.win = newwin(sep.lines, sep.cols, sep.begy, sep.begx);
- top.win = newwin(top.lines, top.cols, top.begy, top.begx);
- bot.win = newwin(bot.lines, bot.cols, bot.begy, bot.begx);
- sb.win = newwin(sb.lines, sb.cols, sb.begy, sb.begx);
- in.win = newwin(in.lines, in.cols, in.begy, in.begx);
- if (!top.win || !bot.win || !sb.win || !in.win || !sep.win)
- msg_n_exit(1, "Error: Cannot create curses windows\n");
- wclear(bot.win);
- wclear(sb.win);
- wclear(in.win);
- scrollok(bot.win, 1);
- wattron(sb.win, COLOR_PAIR(COLOR_STATUSBAR));
- wattron(sep.win, COLOR_PAIR(COLOR_SEPARATOR));
- wattron(bot.win, COLOR_PAIR(COLOR_BOT));
- wattron(top.win, COLOR_PAIR(COLOR_TOP));
- nodelay(top.win, 1);
- nodelay(bot.win, 1);
- nodelay(sb.win, 1);
- nodelay(in.win, 0);
-
- keypad(top.win, 1);
- keypad(bot.win, 1);
- keypad(sb.win, 1);
- keypad(in.win, 1);
- print_status_bar();
- }
- wmove(sep.win, 0, 0);
- for (i = 1; i <= COLS; i++)
- waddstr(sep.win, theme.sep_str);
- wclear(top.win);
- //wclear(bot.win);
- wnoutrefresh(top.win);
- wnoutrefresh(bot.win);
- //wnoutrefresh(sb.win);
- print_status_bar();
- wnoutrefresh(in.win);
- wnoutrefresh(sep.win);
- doupdate();
-}
-
-static void check_geometry(void)
-{
- if (LINES < theme.lines_min || COLS < theme.cols_min)
- msg_n_exit(EXIT_FAILURE, "Error: Terminal (%dx%d) too small"
- " (need at least %dx%d)\n", COLS, LINES,
- theme.cols_min, theme.lines_min);