Changeset 7b4f3be
- Timestamp:
- May 1, 2011, 5:29:25 PM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 1753ea0, 3fa0181
- Parents:
- 9efa5bd
- git-author:
- David Benjamin <davidben@mit.edu> (04/26/11 21:46:58)
- git-committer:
- David Benjamin <davidben@mit.edu> (05/01/11 17:29:25)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
fmtext.c
r9efa5bd r7b4f3be 184 184 } 185 185 186 static void _owl_fmtext_update_colorpair(short fg, short bg, short *pair)187 {188 if (owl_global_get_hascolors(&g)) {189 *pair = owl_fmtext_get_colorpair(fg, bg);190 }191 }192 193 186 static void _owl_fmtext_wcolor_set(WINDOW *w, short pair) 194 187 { 195 if ( owl_global_get_hascolors(&g)) {188 if (has_colors()) { 196 189 wcolor_set(w,pair,NULL); 197 190 wbkgdset(w, COLOR_PAIR(pair)); … … 221 214 bg = default_bgcolor; 222 215 _owl_fmtext_wattrset(w, attr); 223 _owl_fmtext_update_colorpair(fg, bg, &pair);216 pair = owl_fmtext_get_colorpair(fg, bg); 224 217 _owl_fmtext_wcolor_set(w, pair); 225 218 … … 270 263 if (bg == OWL_COLOR_DEFAULT) bg = default_bgcolor; 271 264 _owl_fmtext_wattrset(w, attr); 272 _owl_fmtext_update_colorpair(fg, bg, &pair);265 pair = owl_fmtext_get_colorpair(fg, bg); 273 266 _owl_fmtext_wcolor_set(w, pair); 274 267 … … 662 655 continue */ 663 656 } else if (!strcasecmp(buff, "@color") 664 && owl_global_get_hascolors(&g)665 657 && owl_global_is_colorztext(&g)) { 666 658 g_free(buff); … … 820 812 } 821 813 } 822 if ( owl_global_get_hascolors(&g)) {814 if (has_colors()) { 823 815 for(i = 0; i < 8; i++) { 824 816 short fg, bg; … … 835 827 owl_colorpair_mgr *cpmgr; 836 828 short pair; 829 830 if (!has_colors()) 831 return 0; 837 832 838 833 /* Sanity (Bounds) Check */ -
functions.c
r9efa5bd r7b4f3be 1817 1817 owl_global_get_cols(&g)); 1818 1818 1819 if ( owl_global_get_hascolors(&g)) {1819 if (has_colors()) { 1820 1820 owl_fmtext_append_normal(&fm, "Color: Yes\n"); 1821 1821 owl_fmtext_appendf_normal(&fm, "Number of color pairs: %i\n", owl_util_get_colorpairs()); … … 2226 2226 f = fl->data; 2227 2227 owl_fmtext_append_normal(&fm, " "); 2228 if (owl_global_get_hascolors(&g)) { 2229 owl_fmtext_append_normal_color(&fm, owl_filter_get_name(f), owl_filter_get_fgcolor(f), owl_filter_get_bgcolor(f)); 2230 } else { 2231 owl_fmtext_append_normal(&fm, owl_filter_get_name(f)); 2232 } 2228 owl_fmtext_append_normal_color(&fm, owl_filter_get_name(f), 2229 owl_filter_get_fgcolor(f), 2230 owl_filter_get_bgcolor(f)); 2233 2231 owl_fmtext_append_normal(&fm, "\n"); 2234 2232 } -
global.c
r9efa5bd r7b4f3be 51 51 g->direction=OWL_DIRECTION_DOWNWARDS; 52 52 g->zaway=0; 53 if (has_colors()) {54 g->hascolors=1;55 }56 53 owl_fmtext_init_colorpair_mgr(&(g->cpmgr)); 57 54 g->debug=OWL_DEBUG; … … 573 570 owl_view *owl_global_get_current_view(owl_global *g) { 574 571 return(&(g->current_view)); 575 }576 577 /* has colors */578 579 int owl_global_get_hascolors(const owl_global *g) {580 if (g->hascolors) return(1);581 return(0);582 572 } 583 573 -
owl.h
r9efa5bd r7b4f3be 610 610 char *startupargs; 611 611 int nextmsgid; 612 int hascolors;613 612 owl_colorpair_mgr cpmgr; 614 613 pid_t newmsgproc_pid;
Note: See TracChangeset
for help on using the changeset viewer.