[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev [PATCH 2.8.4dev.18] remove pale background
From: |
Ilya Zakharevich |
Subject: |
lynx-dev [PATCH 2.8.4dev.18] remove pale background |
Date: |
Thu, 8 Mar 2001 01:13:24 -0500 |
User-agent: |
Mutt/1.2.5i |
This week we saw bug reports about pale background colors shown
instead of the specified ones. Here is the fix: after this patch you
can run lynx with -blink_is_boldbg, and lynx will know how to switch
on bright background colors.
[Default is to have this disabled - unless on OS/2, when it is
documented how to enforce blink-being-shown-as-bright-background.]
Enjoy,
Ilya
--- ./src/LYCurses.c-pre-blink Thu Feb 15 00:18:48 2001
+++ ./src/LYCurses.c Wed Mar 7 20:40:10 2001
@@ -60,6 +60,7 @@ int LYlineWrap = TRUE;
PRIVATE int dumbterm PARAMS((char *terminal));
BOOLEAN LYCursesON = FALSE;
+PRIVATE void make_blink_boldbg NOARGS;
#if USE_COLOR_TABLE || defined(USE_SLANG)
PUBLIC int Current_Attr, Masked_Attr;
@@ -1056,6 +1057,11 @@ PUBLIC void start_curses NOARGS
LYclear();
#endif
+#if defined(USE_BLINK) && defined(__EMX__)
+ if (term_blink_is_boldbg) /* Now actually make it so! */
+ make_blink_boldbg();
+#endif
+
LYCursesON = TRUE;
CTRACE((tfp, "start_curses: done.\n"));
} /* end of start_curses() */
@@ -2292,3 +2298,19 @@ PUBLIC void LYstowCursor ARGS3(
wrefresh(win);
#endif /* USE_SLANG */
}
+
+#if defined(USE_BLINK) && defined(__EMX__) /* Can't put it earler due to
BOOLEAN conflict */
+# define BOOLEAN os2BOOLEAN
+# define INCL_VIO
+# include "os2.h"
+PRIVATE void make_blink_boldbg NOARGS
+{
+ VIOINTENSITY buf; /* VIO windows have it anyway, */
+ /* but FS session need a switch */
+ buf.cb = sizeof(buf);
+ buf.type = 2; /* VIOINTENSITY request */
+ buf.fs = 1; /* Intensity == boldbg */
+ VioSetState(&buf,0);
+}
+#endif
+
--- ./src/LYMain.c-pre-blink Wed Feb 14 02:51:18 2001
+++ ./src/LYMain.c Wed Mar 7 20:38:56 2001
@@ -3117,6 +3117,12 @@ PRIVATE Parse_Args_Type Arg_Table [] =
"=URL\nlocal bibp server (default http://bibhost/)"
),
#endif
+#ifdef USE_BLINK
+ PARSE_STR(
+ "blink_is_boldbg", 4|SET_ARG, &term_blink_is_boldbg,
+ "enable bold background via the BLINK terminal attribute"
+ ),
+#endif
#ifdef USE_SLANG
PARSE_FUN(
"blink", 4|FUNCTION_ARG, blink_fun,
--- ./src/LYStyle.c-pre-blink Tue Feb 20 03:40:58 2001
+++ ./src/LYStyle.c Wed Mar 7 20:09:34 2001
@@ -78,7 +78,21 @@ PUBLIC int s_sb_naa = NOSTYLE;
/* start somewhere safe */
#define MAX_COLOR 16
PRIVATE int colorPairs = 0;
-PRIVATE unsigned char our_pairs[2][MAX_COLOR][MAX_COLOR];
+
+#ifdef USE_BLINK
+# define MAX_BLINK 2
+# define M_BLINK A_BLINK
+# ifdef __EMX__ /* Know how to modify */
+int term_blink_is_boldbg = 1;
+# else
+int term_blink_is_boldbg = 0;
+# endif
+#else
+# define MAX_BLINK 1
+# define M_BLINK 0
+#endif
+
+PRIVATE unsigned char our_pairs[2][MAX_BLINK][MAX_COLOR][MAX_COLOR];
/* icky parsing of the style options */
PRIVATE void parse_attributes
ARGS5(char*,mono,char*,fg,char*,bg,int,style,char*,element)
@@ -129,6 +143,14 @@ PRIVATE void parse_attributes ARGS5(char
if (fA == NO_COLOR) {
bA = NO_COLOR;
} else if (COLORS) {
+#ifdef USE_BLINK
+ if (term_blink_is_boldbg) {
+ if (fA >= COLORS)
+ cA = A_BOLD;
+ if (bA >= COLORS)
+ cA |= M_BLINK;
+ } else
+#endif
if (fA >= COLORS || bA >= COLORS)
cA = A_BOLD;
if (fA >= COLORS)
@@ -151,15 +173,15 @@ PRIVATE void parse_attributes ARGS5(char
if (fA < MAX_COLOR
&& bA < MAX_COLOR
- && our_pairs[cA == A_BOLD][fA][bA])
- curPair = our_pairs[cA == A_BOLD][fA][bA] - 1;
+ && our_pairs[!!(cA & A_BOLD)][!!(cA & A_BLINK)][fA][bA])
+ curPair = our_pairs[!!(cA & A_BOLD)][!!(cA & M_BLINK)][fA][bA] - 1;
else {
curPair = ++colorPairs;
init_pair(curPair, fA, bA);
if (fA < MAX_COLOR
&& bA < MAX_COLOR
&& curPair < 255)
- our_pairs[cA == A_BOLD][fA][bA] = curPair + 1;
+ our_pairs[!!(cA & A_BOLD)][!!(cA & M_BLINK)][fA][bA] = curPair
+ 1;
}
CTRACE((tfp, "CSS(CURPAIR):%d\n", curPair));
if (style < DSTYLE_ELEMENTS)
--- ./src/LYStyle.h-pre-blink Sun Jul 16 22:16:12 2000
+++ ./src/LYStyle.h Wed Mar 7 20:11:16 2001
@@ -15,6 +15,14 @@ extern HTCharStyle displayStyles[DSTYLE_
/* Can we do colour? - RP */
extern int lynx_has_color;
+#ifndef NO_USE_BLINK
+# define USE_BLINK
+#endif
+
+#ifdef USE_BLINK
+extern int term_blink_is_boldbg;
+#endif
+
/* Set all the buckets in the hash table to be empty */
extern void parse_userstyles NOPARAMS;
; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- lynx-dev [PATCH 2.8.4dev.18] remove pale background,
Ilya Zakharevich <=