lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV Bugs in ac102 (at least for DOS)


From: T.E.Dickey
Subject: Re: LYNX-DEV Bugs in ac102 (at least for DOS)
Date: Mon, 22 Dec 1997 05:45:44 -0500 (EST)

> I just compiled and tested version 102 (the first I have done since 98).
> Color support for DOS was completely broken.  Changes in LYCurses.c made
> color never start.  The color mapping change in LYReadCFG.c didn't work,
> with DOS colors mapped incorrectly.  The following patch fixes
> LYCurses.c for DOS.  I hope that it doesn't break any other systems (I
> am not sure why the changes were made).  For LYReadCFG.c, I just put
> back the color table that was in previous versions.  I'll try to look at
> functionality more, now that I have colors working again.
I made the changes because it moves the use in PDCurses of non-ANSI color
out of sight, so to speak - it'd be nice if the PDCurses-related stuff was
ifdef'd with something more descriptive than DOSPATH, but I've not had time
or resources to build up a version on djgpp (someday...)

but restoring the table isn't the way to go -- let's try to fix it rather
than simply putting back the previous version.
 
> P.S. The LYReadCFG.c file in 102 wouldn't compile without adding 
> "int n;" to ColorCode.
> 
>                           Doug
> 
> 
> *** lynx2-7-1/src/LYCurses.c  Sun Dec 14 14:41:28 1997
> --- lynx2-7-1/src/LYCurses.c.new      Sun Dec 21 22:35:46 1997
> ***************
> *** 589,596 ****
>   
>   PRIVATE void lynx_init_colors NOARGS
>   {
> !     if (lynx_has_color) {
>       int n, m;
>   
>       lynx_color_cfg[0].fg = default_fg;
>       lynx_color_cfg[0].bg = default_bg;
> --- 589,599 ----
>   
>   PRIVATE void lynx_init_colors NOARGS
>   {
> !     lynx_has_color = FALSE;
> !     if (has_colors()) {
>       int n, m;
> +     lynx_has_color = TRUE;
> +     start_color();
>   
>       lynx_color_cfg[0].fg = default_fg;
>       lynx_color_cfg[0].bg = default_bg;
> *** lynx2-7-1/src/LYReadCFG.c Sun Dec 14 14:41:28 1997
> --- lynx2-7-1/src/LYReadCFG.c.new     Sun Dec 21 22:54:00 1997
> ***************
> *** 298,303 ****
> --- 298,324 ----
>   int default_fg = COLOR_WHITE;
>   int default_bg = COLOR_BLACK;
>   
> + #ifdef DOSPATH /* I.E. broken curses */
> + static char *Color_Strings[16] =
> + {
> +      "black",
> +      "blue",
> +      "green",
> +      "cyan",
> +      "red",
> +      "magenta",
> +      "brown",
> +      "lightgray",
> +      "gray",
> +      "brightblue",
> +      "brightgreen",
> +      "brightcyan",
> +      "brightred",
> +      "brightmagenta",
> +      "yellow",
> +      "white"
> + };
> + #else
>   static char *Color_Strings[16] =
>   {
>       "black",
> ***************
> *** 317,339 ****
>       "brightcyan",
>       "white"
>   };
> ! 
> ! #ifdef DOSPATH
> ! /*
> !  * PDCurses (and possibly some other implementations) use a non-ANSI set of
> !  * codes for colors.
> !  */
> ! PRIVATE int ColorCode ARGS1(
> !     int,    color)
> ! {
> !     static int map[] = {
> !             0,  4,  2,  6, 1,  5,  3,  7,
> !             8, 12, 10, 14, 9, 13, 11, 15 };
> !     return map[n];
> ! }
> ! #else
> ! #define ColorCode(n) (n)
> ! #endif
>   
>   /*
>    *  Validator for COLOR fields.
> --- 338,344 ----
>       "brightcyan",
>       "white"
>   };
> ! #endif /* DOSPATH (broken curses) */
>   
>   /*
>    *  Validator for COLOR fields.
> ***************
> *** 351,357 ****
>   
>       for (i = 0; i < 16; i++) {
>       if (!strcasecmp(color, Color_Strings[i]))
> !         return ColorCode(i);
>       }
>       return ERR_COLOR;
>   }
> --- 356,362 ----
>   
>       for (i = 0; i < 16; i++) {
>       if (!strcasecmp(color, Color_Strings[i]))
> !         return i;
>       }
>       return ERR_COLOR;
>   }
> 
> __
> Doug Kaufman
> Internet: address@hidden (preferred)
>         address@hidden
> 


-- 
Thomas E. Dickey
address@hidden
http://www.clark.net/pub/dickey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]