diff --git a/pdcurses/color.c b/pdcurses/color.c index 09fc81cd..2cc9a116 100644 --- a/pdcurses/color.c +++ b/pdcurses/color.c @@ -15,7 +15,7 @@ #include #include -RCSID("$Id: color.c,v 1.69 2006/10/23 05:03:30 wmcbrine Exp $"); +RCSID("$Id: color.c,v 1.70 2006/11/12 10:26:14 wmcbrine Exp $"); /*man-start************************************************************** @@ -65,9 +65,12 @@ RCSID("$Id: color.c,v 1.69 2006/10/23 05:03:30 wmcbrine Exp $"); pair_content() is used to determine what the colors of a given color-pair consist of. + PDCurses Description: PDC_set_line_color() is used to set the color, globally, for the color of the lines drawn for the attributes: A_UNDERLINE, - A_OVERLINE, A_LEFTLINE and A_RIGHTLINE. PDCurses only feature. + A_OVERLINE, A_LEFTLINE and A_RIGHTLINE. A value of -1 (the + default) indicates that the current foreground color should be + used. NOTE: COLOR_PAIR() and PAIR_NUMBER() are implemented as macros. @@ -243,7 +246,7 @@ int pair_content(short pair, short *fg, short *bg) int PDC_set_line_color(short color) { - if (color < 0 || color >= COLORS) + if (color < -1 || color >= COLORS) return ERR; SP->line_color = color; diff --git a/pdcurses/initscr.c b/pdcurses/initscr.c index cd870c26..aa850822 100644 --- a/pdcurses/initscr.c +++ b/pdcurses/initscr.c @@ -14,7 +14,7 @@ #include #include -RCSID("$Id: initscr.c,v 1.88 2006/11/11 16:36:08 wmcbrine Exp $"); +RCSID("$Id: initscr.c,v 1.89 2006/11/12 10:26:14 wmcbrine Exp $"); const char *_curses_notice = "PDCurses 3.0 - Public Domain 2006"; @@ -154,6 +154,7 @@ WINDOW *Xinitscr(int argc, char *argv[]) SP->linesrippedoff = 0; SP->linesrippedoffontop = 0; SP->delaytenths = 0; + SP->line_color = -1; SP->orgcbr = PDC_get_ctrl_break(); SP->orig_cursor = PDC_get_cursor_mode(); diff --git a/x11/pdcscrn.c b/x11/pdcscrn.c index 072763e2..7f88a119 100644 --- a/x11/pdcscrn.c +++ b/x11/pdcscrn.c @@ -13,7 +13,7 @@ #include "pdcx11.h" -RCSID("$Id: pdcscrn.c,v 1.47 2006/11/11 16:36:08 wmcbrine Exp $"); +RCSID("$Id: pdcscrn.c,v 1.48 2006/11/12 10:26:14 wmcbrine Exp $"); /*man-start************************************************************** @@ -78,7 +78,6 @@ int PDC_scr_open(int argc, char **argv) SP->sb_total_x = 0; SP->sb_viewport_x = 0; SP->sb_cur_x = 0; - SP->line_color = COLOR_WHITE; return OK; } diff --git a/x11/x11.c b/x11/x11.c index e694ef0c..ab5531b9 100644 --- a/x11/x11.c +++ b/x11/x11.c @@ -28,7 +28,7 @@ #include #include -RCSID("$Id: x11.c,v 1.30 2006/11/11 20:27:21 wmcbrine Exp $"); +RCSID("$Id: x11.c,v 1.31 2006/11/12 10:26:14 wmcbrine Exp $"); #ifndef XPOINTER_TYPEDEFED typedef char * XPointer; @@ -783,7 +783,9 @@ static int NewPacket(chtype attr, bool rev, int len, int col, int row, { int k; - XSetForeground(XCURSESDISPLAY, gc, colors[SP->line_color]); + if (SP->line_color != -1) + XSetForeground(XCURSESDISPLAY, gc, + colors[SP->line_color]); if (attr & A_UNDERLINE) /* UNDER */ XDrawLine(XCURSESDISPLAY, XCURSESWIN, gc,