Changeset 9efa5bd
- Timestamp:
- May 1, 2011, 5:29:25 PM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 7b4f3be
- Parents:
- 4fd211f
- git-author:
- David Benjamin <davidben@mit.edu> (04/26/11 21:07:08)
- git-committer:
- David Benjamin <davidben@mit.edu> (05/01/11 17:29:25)
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
fmtext.c
r4479497 r9efa5bd 852 852 if (!(pair != -1 && pair < cpmgr->next)) { 853 853 /* If we didn't find a pair, search for a free one to assign. */ 854 pair = (cpmgr->next < COLOR_PAIRS) ? cpmgr->next : -1;854 pair = (cpmgr->next < owl_util_get_colorpairs()) ? cpmgr->next : -1; 855 855 if (pair != -1) { 856 856 /* We found a free pair, initialize it. */ -
functions.c
r4fd211f r9efa5bd 1819 1819 if (owl_global_get_hascolors(&g)) { 1820 1820 owl_fmtext_append_normal(&fm, "Color: Yes\n"); 1821 owl_fmtext_appendf_normal(&fm, "Number of color pairs: %i\n", owl_ global_get_colorpairs(&g));1821 owl_fmtext_appendf_normal(&fm, "Number of color pairs: %i\n", owl_util_get_colorpairs()); 1822 1822 owl_fmtext_appendf_normal(&fm, "Can change colors: %s\n", can_change_color() ? "yes" : "no"); 1823 1823 } else { -
global.c
r47e0a6a r9efa5bd 54 54 g->hascolors=1; 55 55 } 56 g->colorpairs=COLOR_PAIRS;57 56 owl_fmtext_init_colorpair_mgr(&(g->cpmgr)); 58 57 g->debug=OWL_DEBUG; … … 581 580 if (g->hascolors) return(1); 582 581 return(0); 583 }584 585 /* color pairs */586 587 int owl_global_get_colorpairs(const owl_global *g) {588 return(g->colorpairs);589 582 } 590 583 -
owl.c
ra2a8833 r9efa5bd 444 444 /* update the terminal if we need to */ 445 445 owl_window_redraw_scheduled(); 446 /* On colorpair shortage, reset and redraw /everything/. NOTE: if 447 * the current screen uses too many colorpairs, this draws448 * everything twice. But this is unlikely; COLOR_PAIRS is 64 with449 * 8+1 colors, and 256^2 with 256+1 colors. (+1 for default.)*/446 /* On colorpair shortage, reset and redraw /everything/. NOTE: if we 447 * still overflow, this be useless work. With 8-colors, we get 64 448 * pairs. With 256-colors, we get 32768 pairs with ext-colors 449 * support and 256 otherwise. */ 450 450 cpmgr = owl_global_get_colorpair_mgr(&g); 451 451 if (cpmgr->overflow) { 452 owl_function_debugmsg("colorpairs: color shortage; reset pairs and redraw. COLOR_PAIRS = %d", COLOR_PAIRS); 452 owl_function_debugmsg("colorpairs: used all %d pairs; reset pairs and redraw.", 453 owl_util_get_colorpairs()); 453 454 owl_fmtext_reset_colorpairs(cpmgr); 454 455 owl_function_full_redisplay(); -
owl.h
r283ff1e r9efa5bd 611 611 int nextmsgid; 612 612 int hascolors; 613 int colorpairs;614 613 owl_colorpair_mgr cpmgr; 615 614 pid_t newmsgproc_pid; -
util.c
re56303f r9efa5bd 715 715 } 716 716 717 int owl_util_get_colorpairs(void) { 718 #ifndef NCURSES_EXT_COLORS 719 /* Without ext-color support (an ABI change), ncurses only supports 256 720 * different color pairs. However, it gives us a larger number even if your 721 * ncurses is compiled without ext-color. */ 722 return MIN(COLOR_PAIRS, 256); 723 #else 724 return COLOR_PAIRS; 725 #endif 726 } 727 717 728 gulong owl_dirty_window_on_signal(owl_window *w, gpointer sender, const gchar *detailed_signal) 718 729 {
Note: See TracChangeset
for help on using the changeset viewer.