int add_window(Tox *m, ToxWindow w) { if (LINES < 2) return -1; int i; for (i = 0; i < MAX_WINDOWS_NUM; i++) { if (windows[i].active) continue; w.window = newwin(LINES - 2, COLS, 0, 0); if (w.window == NULL) return -1; #ifdef URXVT_FIX /* Fixes text color problem on some terminals. */ wbkgd(w.window, COLOR_PAIR(6)); #endif windows[i] = w; w.onInit(&w, m); ++num_active_windows; return i; } return -1; }
int add_window(ToxWindow w, int n) { if (w_num >= TOXWINDOWS_MAX_NUM) return -1; if (LINES < 2) return -1; w.window = newwin(LINES - 2, COLS, 0, 0); if (w.window == NULL) return -1; windows[n] = w; w.onInit(&w); w_num++; return n; }
int add_window(ToxWindow w) { if(w_num == TOXWINDOWS_MAX_NUM) return -1; if(LINES < 2) return -1; w.window = newwin(LINES - 2, COLS, 0, 0); if(w.window == NULL) return -1; windows[w_num++] = w; w.onInit(&w); return w_num - 1; }