- Timestamp:
- Jan 20, 2007, 9:49:55 PM (18 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 575877f
- Parents:
- 212764e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
filter.c
r446aa2b r8fa9562 21 21 f->name=owl_strdup(name); 22 22 f->polarity=0; 23 f->color=OWL_COLOR_DEFAULT; 23 f->fgcolor=OWL_COLOR_DEFAULT; 24 f->bgcolor=OWL_COLOR_DEFAULT; 24 25 f->cachedmsgid=-1; 25 26 26 27 /* first take arguments that have to come first */ 27 28 /* set the color */ 28 if (argc>=2 && !strcmp(argv[0], "-c")) { 29 while ( argc>=2 && ( !strcmp(argv[0], "-c") || 30 !strcmp(argv[0], "-b") ) ) { 29 31 if (owl_util_string_to_color(argv[1])==-1) { 30 32 owl_function_error("The color '%s' is not available, using default.", argv[1]); 31 33 } else { 32 f->color=owl_util_string_to_color(argv[1]); 34 switch (argv[0][1]) { 35 case 'c': 36 f->fgcolor=owl_util_string_to_color(argv[1]); 37 break; 38 case 'b': 39 f->bgcolor=owl_util_string_to_color(argv[1]); 40 break; 41 } 33 42 } 34 43 argc-=2; … … 159 168 } 160 169 161 void owl_filter_set_color(owl_filter *f, int color) 162 { 163 f->color=color; 164 } 165 166 int owl_filter_get_color(owl_filter *f) 167 { 168 return(f->color); 170 void owl_filter_set_fgcolor(owl_filter *f, int color) 171 { 172 f->fgcolor=color; 173 } 174 175 int owl_filter_get_fgcolor(owl_filter *f) 176 { 177 return(f->fgcolor); 178 } 179 180 void owl_filter_set_bgcolor(owl_filter *f, int color) 181 { 182 f->bgcolor=color; 183 } 184 185 int owl_filter_get_bgcolor(owl_filter *f) 186 { 187 return(f->bgcolor); 169 188 } 170 189 … … 196 215 strcat(out, ": "); 197 216 198 if (f-> color!=OWL_COLOR_DEFAULT) {217 if (f->fgcolor!=OWL_COLOR_DEFAULT) { 199 218 strcat(out, "-c "); 200 strcat(out, owl_util_color_to_string(f->color)); 219 strcat(out, owl_util_color_to_string(f->fgcolor)); 220 strcat(out, " "); 221 } 222 if (f->bgcolor!=OWL_COLOR_DEFAULT) { 223 strcat(out, "-b "); 224 strcat(out, owl_util_color_to_string(f->bgcolor)); 201 225 strcat(out, " "); 202 226 }
Note: See TracChangeset
for help on using the changeset viewer.