228 | 228 |
colors = 1;
|
229 | 229 |
}
|
230 | 230 |
|
231 | |
// set background color of main window
|
|
231 |
// set background color for main window
|
232 | 232 |
if(colors)
|
233 | |
wbkgd(stdscr, COLOR_PAIR(CP_YELLOW));
|
234 | |
|
235 | |
// setup main window
|
|
233 |
wbkgd(stdscr, COLOR_PAIR(CP_WHITE));
|
|
234 |
|
|
235 |
// setup content window
|
236 | 236 |
WINDOW *content = newwin(LINES - bar_top - bar_bottom, COLS, 0 + bar_top, 0);
|
|
237 |
|
|
238 |
// set background color of content window
|
237 | 239 |
if(colors)
|
238 | 240 |
wbkgd(content, COLOR_PAIR(CP_WHITE));
|
239 | 241 |
|
|
259 | 261 |
|
260 | 262 |
// always resize window in case terminal geometry has changed
|
261 | 263 |
wresize(content, LINES - bar_top - bar_bottom, COLS);
|
|
264 |
|
|
265 |
// set main window text color
|
|
266 |
if(colors)
|
|
267 |
wattron(stdscr, COLOR_PAIR(CP_YELLOW));
|
262 | 268 |
|
263 | 269 |
// setup header
|
264 | 270 |
if(bar_top) {
|
|
303 | 309 |
break;
|
304 | 310 |
}
|
305 | 311 |
|
306 | |
// make header + fooder visible
|
307 | |
wrefresh(content);
|
308 | |
wrefresh(stdscr);
|
|
312 |
// copy changed lines in main window to virtual screen
|
|
313 |
wnoutrefresh(stdscr);
|
309 | 314 |
|
310 | 315 |
line = slide->line;
|
311 | 316 |
l = stop = 0;
|
|
338 | 343 |
}
|
339 | 344 |
}
|
340 | 345 |
|
341 | |
// make content visible
|
342 | |
wrefresh(content);
|
|
346 |
// copy changed lines in content window to virtual screen
|
|
347 |
wnoutrefresh(content);
|
|
348 |
|
|
349 |
// compare virtual screen to physical screen and does the actual updates
|
|
350 |
doupdate();
|
343 | 351 |
|
344 | 352 |
// fade in
|
345 | 353 |
if(fade)
|
|
519 | 527 |
|
520 | 528 |
// fill rest off line with spaces if we are in a code block
|
521 | 529 |
if(CHECK_BIT(line->bits, IS_CODE) && colors) {
|
522 | |
wattron(window, COLOR_PAIR(CP_BLACK));
|
|
530 |
if(colors)
|
|
531 |
wattron(window, COLOR_PAIR(CP_BLACK));
|
523 | 532 |
for(i = getcurx(window) - x; i < max_cols; i++)
|
524 | 533 |
wprintw(window, "%s", " ");
|
525 | 534 |
}
|
|
861 | 870 |
init_pair(CP_BLACK, 16, white_ramp[i]);
|
862 | 871 |
}
|
863 | 872 |
|
864 | |
// refresh window with new color
|
865 | |
wrefresh(window);
|
|
873 |
// refresh virtual screen with new color
|
|
874 |
wnoutrefresh(window);
|
|
875 |
|
|
876 |
// compare virtual screen to physical screen and does the actual updates
|
|
877 |
doupdate();
|
866 | 878 |
|
867 | 879 |
// delay for our eyes to recognize the change
|
868 | 880 |
usleep(FADE_DELAY);
|
|
888 | 900 |
init_pair(CP_BLACK, 16, white_ramp[i]);
|
889 | 901 |
}
|
890 | 902 |
|
891 | |
// refresh window with new color
|
892 | |
wrefresh(window);
|
|
903 |
// refresh virtual screen with new color
|
|
904 |
wnoutrefresh(window);
|
|
905 |
|
|
906 |
// compare virtual screen to physical screen and does the actual updates
|
|
907 |
doupdate();
|
893 | 908 |
|
894 | 909 |
// delay for our eyes to recognize the change
|
895 | 910 |
usleep(FADE_DELAY);
|