Codebase list mdp-src / upstream/1.0.6
Imported Upstream version 1.0.6 Lev Lamberov 8 years ago
2 changed file(s) with 30 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
2424
2525 #define MDP_VER_MAJOR 1
2626 #define MDP_VER_MINOR 0
27 #define MDP_VER_REVISION 5
27 #define MDP_VER_REVISION 6
2828
2929 #endif // !defined( MAIN_H )
228228 colors = 1;
229229 }
230230
231 // set background color of main window
231 // set background color for main window
232232 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
236236 WINDOW *content = newwin(LINES - bar_top - bar_bottom, COLS, 0 + bar_top, 0);
237
238 // set background color of content window
237239 if(colors)
238240 wbkgd(content, COLOR_PAIR(CP_WHITE));
239241
259261
260262 // always resize window in case terminal geometry has changed
261263 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));
262268
263269 // setup header
264270 if(bar_top) {
303309 break;
304310 }
305311
306 // make header + fooder visible
307 wrefresh(content);
308 wrefresh(stdscr);
312 // copy changed lines in main window to virtual screen
313 wnoutrefresh(stdscr);
309314
310315 line = slide->line;
311316 l = stop = 0;
338343 }
339344 }
340345
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();
343351
344352 // fade in
345353 if(fade)
519527
520528 // fill rest off line with spaces if we are in a code block
521529 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));
523532 for(i = getcurx(window) - x; i < max_cols; i++)
524533 wprintw(window, "%s", " ");
525534 }
861870 init_pair(CP_BLACK, 16, white_ramp[i]);
862871 }
863872
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();
866878
867879 // delay for our eyes to recognize the change
868880 usleep(FADE_DELAY);
888900 init_pair(CP_BLACK, 16, white_ramp[i]);
889901 }
890902
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();
893908
894909 // delay for our eyes to recognize the change
895910 usleep(FADE_DELAY);