Changeset 8fa9562 for mainwin.c


Ignore:
Timestamp:
Jan 20, 2007, 9:49:55 PM (14 years ago)
Author:
Alejandro R. Sedeño <asedeno@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
575877f
Parents:
212764e
Message:
Added background color support to owl.

If we run out of color pairs during a painting of the screen, further
background colors will be silently dropped. I'm hoping this doesn't
happen often. The used pair list is reset with each draw, so only
what's actually on screen matters.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • mainwin.c

    r37eab7f r8fa9562  
    1414  int i, p, q, lines, isfull, viewsize;
    1515  int x, y, savey, recwinlines, start;
    16   int topmsg, curmsg, color;
     16  int topmsg, curmsg, fgcolor, bgcolor;
    1717  WINDOW *recwin;
    1818  owl_view *v;
     
    2424  curmsg=owl_global_get_curmsg(&g);
    2525  v=owl_global_get_current_view(&g);
     26  owl_fmtext_reset_colorpairs();
    2627
    2728  if (v==NULL) {
     
    7273
    7374    /* if we match filters set the color */
    74     color=OWL_COLOR_DEFAULT;
     75    fgcolor=OWL_COLOR_DEFAULT;
     76    bgcolor=OWL_COLOR_DEFAULT;
    7577    filtlist=owl_global_get_filterlist(&g);
    7678    q=owl_list_get_size(filtlist);
     
    7880      f=owl_list_get_element(filtlist, p);
    7981      if (owl_filter_message_match(f, m)) {
    80         if (owl_filter_get_color(f)!=OWL_COLOR_DEFAULT) color=owl_filter_get_color(f);
     82        if (owl_filter_get_fgcolor(f)!=OWL_COLOR_DEFAULT) fgcolor=owl_filter_get_fgcolor(f);
     83        if (owl_filter_get_bgcolor(f)!=OWL_COLOR_DEFAULT) bgcolor=owl_filter_get_bgcolor(f);
    8184      }
    8285    }
     
    9295                               owl_global_get_rightshift(&g),
    9396                               owl_global_get_cols(&g)+owl_global_get_rightshift(&g)-1,
    94                                color);
     97                               fgcolor, bgcolor);
    9598    } else {
    9699      /* otherwise print the whole thing */
     
    100103                               owl_global_get_rightshift(&g),
    101104                               owl_global_get_cols(&g)+owl_global_get_rightshift(&g)-1,
    102                                color);
     105                               fgcolor, bgcolor);
    103106    }
    104107
Note: See TracChangeset for help on using the changeset viewer.