more italic support

There might be some follow-ups to this.
This commit is contained in:
nhmall
2024-01-29 08:40:05 -05:00
parent 74a1caf536
commit 0dfe92ac61
9 changed files with 169 additions and 117 deletions
+25 -9
View File
@@ -124,10 +124,13 @@ putstr(window, attr, str)
Multiple putstr()s are output on separate lines. Attributes Multiple putstr()s are output on separate lines. Attributes
can be one of can be one of
ATR_NONE (or 0) ATR_NONE (or 0)
ATR_ULINE
ATR_BOLD ATR_BOLD
ATR_DIM
ATR_ITALIC
ATR_ULINE
ATR_BLINK ATR_BLINK
ATR_INVERSE ATR_INVERSE
If a window-port does not support all of these, it may map If a window-port does not support all of these, it may map
unsupported attributes to a supported one (e.g. map them unsupported attributes to a supported one (e.g. map them
all to ATR_INVERSE). putstr() may compress spaces out of all to ATR_INVERSE). putstr() may compress spaces out of
@@ -158,10 +161,13 @@ putmixed(window, attr, str)
Multiple putmixed()s are output on separate lines. Multiple putmixed()s are output on separate lines.
Attributes can be one of Attributes can be one of
ATR_NONE (or 0) ATR_NONE (or 0)
ATR_ULINE
ATR_BOLD ATR_BOLD
ATR_DIM
ATR_ITALIC
ATR_ULINE
ATR_BLINK ATR_BLINK
ATR_INVERSE ATR_INVERSE
If a window-port does not support all of these, it may map If a window-port does not support all of these, it may map
unsupported attributes to a supported one (e.g. map them unsupported attributes to a supported one (e.g. map them
all to ATR_INVERSE). putmixed() may compress spaces out of all to ATR_INVERSE). putmixed() may compress spaces out of
@@ -374,10 +380,13 @@ add_menu(windid window, glyphinfo, const anything identifier, char accelerator,
with the default object class symbols. with the default object class symbols.
-- attr attributes can be one of -- attr attributes can be one of
ATR_NONE (or 0) ATR_NONE (or 0)
ATR_ULINE
ATR_BOLD ATR_BOLD
ATR_DIM
ATR_ITALIC
ATR_ULINE
ATR_BLINK ATR_BLINK
ATR_INVERSE ATR_INVERSE
If a window-port does not support all of these, it may map If a window-port does not support all of these, it may map
unsupported attributes to a supported one (e.g. map them unsupported attributes to a supported one (e.g. map them
all to ATR_INVERSE). all to ATR_INVERSE).
@@ -575,17 +584,24 @@ status_update(int fldindex, genericptr_t ptr, int chg, int percentage, \
+------+----------------------+--------------------+ +------+----------------------+--------------------+
| 15 | CLR_WHITE | | | 15 | CLR_WHITE | |
+------+----------------------+--------------------+ +------+----------------------+--------------------+
| 16 | HL_ATTCLR_DIM | | CLR_MAX | 16 | HL_ATTCLR_UNDEF | | CLR_MAX
+------+----------------------+--------------------+ +------+----------------------+--------------------+
| 17 | HL_ATTCLR_BLINK | | | 17 | HL_ATTCLR_NONE | | CLR_MAX + 1
+------+----------------------+--------------------+ +------+----------------------+--------------------+
| 18 | HL_ATTCLR_ULINE | | | 18 | HL_ATTCLR_BOLD | | CLR_MAX + 2
+------+----------------------+--------------------+ +------+----------------------+--------------------+
| 19 | HL_ATTCLR_INVERSE | 00010110 | | 19 | HL_ATTCLR_DIM | | CLR_MAX + 3
+------+----------------------+--------------------+ +------+----------------------+--------------------+
| 20 | HL_ATTCLR_BOLD | | | 20 | HL_ATTCLR_ITALIC | | CLR_MAX + 4
+------+----------------------+--------------------+ +------+----------------------+--------------------+
| 21 | beyond array boundary| | BL_ATTCLR_MAX | 21 | HL_ATTCLR_ULINE | | CLR_MAX + 5
+------+----------------------+--------------------+
| 22 | HL_ATTCLR_BLINK | | CLR_MAX + 6
+------+----------------------+--------------------+
| 23 | HL_ATTCLR_INVERSE | | CLR_MAX + 7
+------+----------------------+--------------------+
| 24 | beyond array boundary| | BL_ATTCLR_MAX
The window port can AND (&) the bits passed in the The window port can AND (&) the bits passed in the
ptr argument to status_update() with any non-zero ptr argument to status_update() with any non-zero
+25 -14
View File
@@ -201,10 +201,18 @@ extern int cond_idx[CONDITION_COUNT];
/* #ifdef STATUS_HILITES */ /* #ifdef STATUS_HILITES */
/* hilite status field behavior - coloridx values */ /* hilite status field behavior - coloridx values */
#define BL_HILITE_NONE -1 /* no hilite of this field */ #define BL_HILITE_NONE -1 /* no hilite of this field */
#define BL_HILITE_INVERSE -2 /* inverse hilite */
#define BL_HILITE_BOLD -3 /* bold hilite */ #if 0
/* or any CLR_ index (0 - 15) */ #define BL_HILITE_BOLD -2 /* bold hilite */
#define BL_HILITE_DIM -3 /* dim hilite */
#define BL_HILITE_ITALIC -4 /* italic hilite */
#define BL_HILITE_ULINE -5 /* underline hilite */
#define BL_HILITE_BLINK -6 /* blink hilite */
#define BL_HILITE_INVERSE -7 /* inverse hilite */
/* or any CLR_ index (0 - 15) */
#endif
#define BL_TH_NONE 0 #define BL_TH_NONE 0
#define BL_TH_VAL_PERCENTAGE 100 /* threshold is percentage */ #define BL_TH_VAL_PERCENTAGE 100 /* threshold is percentage */
#define BL_TH_VAL_ABSOLUTE 101 /* threshold is particular value */ #define BL_TH_VAL_ABSOLUTE 101 /* threshold is particular value */
@@ -214,21 +222,24 @@ extern int cond_idx[CONDITION_COUNT];
#define BL_TH_ALWAYS_HILITE 105 /* highlight regardless of value */ #define BL_TH_ALWAYS_HILITE 105 /* highlight regardless of value */
#define BL_TH_CRITICALHP 106 /* highlight critically low HP */ #define BL_TH_CRITICALHP 106 /* highlight critically low HP */
#define HL_ATTCLR_DIM CLR_MAX + 0 #define HL_ATTCLR_NONE CLR_MAX + 1
#define HL_ATTCLR_BLINK CLR_MAX + 1 #define HL_ATTCLR_BOLD CLR_MAX + 2
#define HL_ATTCLR_ULINE CLR_MAX + 2 #define HL_ATTCLR_DIM CLR_MAX + 3
#define HL_ATTCLR_INVERSE CLR_MAX + 3 #define HL_ATTCLR_ITALIC CLR_MAX + 4
#define HL_ATTCLR_BOLD CLR_MAX + 4 #define HL_ATTCLR_ULINE CLR_MAX + 5
#define BL_ATTCLR_MAX CLR_MAX + 5 #define HL_ATTCLR_BLINK CLR_MAX + 6
#define HL_ATTCLR_INVERSE CLR_MAX + 7
#define BL_ATTCLR_MAX CLR_MAX + 8
enum hlattribs { enum hlattribs {
HL_UNDEF = 0x00, HL_UNDEF = 0x00,
HL_NONE = 0x01, HL_NONE = 0x01,
HL_BOLD = 0x02, HL_BOLD = 0x02,
HL_INVERSE = 0x04, HL_DIM = 0x04,
HL_ULINE = 0x08, HL_ITALIC = 0x08,
HL_BLINK = 0x10, HL_ULINE = 0x10,
HL_DIM = 0x20 HL_BLINK = 0x20,
HL_INVERSE = 0x40
}; };
#define MAXVALWIDTH 80 /* actually less, but was using 80 to allocate title #define MAXVALWIDTH 80 /* actually less, but was using 80 to allocate title
+50 -43
View File
@@ -2734,16 +2734,18 @@ parse_status_hl2(char (*s)[QBUFSZ], boolean from_configfile)
for (i = 0; i < sf; ++i) { for (i = 0; i < sf; ++i) {
int a = match_str2attr(subfields[i], FALSE); int a = match_str2attr(subfields[i], FALSE);
if (a == ATR_DIM) if (a == ATR_BOLD)
disp_attrib |= HL_BOLD;
else if (a == ATR_DIM)
disp_attrib |= HL_DIM; disp_attrib |= HL_DIM;
else if (a == ATR_BLINK) else if (a == ATR_ITALIC)
disp_attrib |= HL_BLINK; disp_attrib |= HL_ITALIC;
else if (a == ATR_ULINE) else if (a == ATR_ULINE)
disp_attrib |= HL_ULINE; disp_attrib |= HL_ULINE;
else if (a == ATR_BLINK)
disp_attrib |= HL_BLINK;
else if (a == ATR_INVERSE) else if (a == ATR_INVERSE)
disp_attrib |= HL_INVERSE; disp_attrib |= HL_INVERSE;
else if (a == ATR_BOLD)
disp_attrib |= HL_BOLD;
else if (a == ATR_NONE) else if (a == ATR_NONE)
disp_attrib = HL_NONE; disp_attrib = HL_NONE;
else { else {
@@ -2967,7 +2969,7 @@ parse_condition(char (*s)[QBUFSZ], int sidx)
* bitmasks indexed by the color chosen * bitmasks indexed by the color chosen
* (0 to (CLR_MAX - 1)) * (0 to (CLR_MAX - 1))
* and/or attributes chosen * and/or attributes chosen
* (HL_ATTCLR_DIM to (BL_ATTCLR_MAX - 1)) * (HL_ATTCLR_NONE to (BL_ATTCLR_MAX - 1))
* We still have to parse the colors and attributes out. * We still have to parse the colors and attributes out.
*/ */
@@ -2993,34 +2995,31 @@ parse_condition(char (*s)[QBUFSZ], int sidx)
* We have the following additional array offsets to * We have the following additional array offsets to
* use for storing the attributes beyond the end of * use for storing the attributes beyond the end of
* the color indexes, all of which are less than CLR_MAX. * the color indexes, all of which are less than CLR_MAX.
* HL_ATTCLR_DIM = CLR_MAX
* HL_ATTCLR_BLINK = CLR_MAX + 1
* HL_ATTCLR_ULINE = CLR_MAX + 2
* HL_ATTCLR_INVERSE = CLR_MAX + 3
* HL_ATTCLR_BOLD = CLR_MAX + 4
* HL_ATTCLR_MAX = CLR_MAX + 5 (this is past array boundary)
* *
*/ */
for (i = 0; i < sf; ++i) { for (i = 0; i < sf; ++i) {
int a = match_str2attr(subfields[i], FALSE); int a = match_str2attr(subfields[i], FALSE);
if (a == ATR_DIM) if (a == ATR_BOLD)
gc.cond_hilites[HL_ATTCLR_BOLD] |= conditions_bitmask;
else if (a == ATR_DIM)
gc.cond_hilites[HL_ATTCLR_DIM] |= conditions_bitmask; gc.cond_hilites[HL_ATTCLR_DIM] |= conditions_bitmask;
else if (a == ATR_BLINK) else if (a == ATR_ITALIC)
gc.cond_hilites[HL_ATTCLR_BLINK] |= conditions_bitmask; gc.cond_hilites[HL_ATTCLR_ITALIC] |= conditions_bitmask;
else if (a == ATR_ULINE) else if (a == ATR_ULINE)
gc.cond_hilites[HL_ATTCLR_ULINE] |= conditions_bitmask; gc.cond_hilites[HL_ATTCLR_ULINE] |= conditions_bitmask;
else if (a == ATR_BLINK)
gc.cond_hilites[HL_ATTCLR_BLINK] |= conditions_bitmask;
else if (a == ATR_INVERSE) else if (a == ATR_INVERSE)
gc.cond_hilites[HL_ATTCLR_INVERSE] |= conditions_bitmask; gc.cond_hilites[HL_ATTCLR_INVERSE] |= conditions_bitmask;
else if (a == ATR_BOLD)
gc.cond_hilites[HL_ATTCLR_BOLD] |= conditions_bitmask;
else if (a == ATR_NONE) { else if (a == ATR_NONE) {
gc.cond_hilites[HL_ATTCLR_DIM] &= ~conditions_bitmask;
gc.cond_hilites[HL_ATTCLR_BLINK] &= ~conditions_bitmask;
gc.cond_hilites[HL_ATTCLR_ULINE] &= ~conditions_bitmask;
gc.cond_hilites[HL_ATTCLR_INVERSE] &= ~conditions_bitmask;
gc.cond_hilites[HL_ATTCLR_BOLD] &= ~conditions_bitmask; gc.cond_hilites[HL_ATTCLR_BOLD] &= ~conditions_bitmask;
gc.cond_hilites[HL_ATTCLR_DIM] &= ~conditions_bitmask;
gc.cond_hilites[HL_ATTCLR_ITALIC] &= ~conditions_bitmask;
gc.cond_hilites[HL_ATTCLR_ULINE] &= ~conditions_bitmask;
gc.cond_hilites[HL_ATTCLR_BLINK] &= ~conditions_bitmask;
gc.cond_hilites[HL_ATTCLR_INVERSE] &= ~conditions_bitmask;
} else { } else {
int k = match_str2clr(subfields[i]); int k = match_str2clr(subfields[i]);
@@ -3075,14 +3074,16 @@ hlattr2attrname(int attrib, char *buf, size_t bufsz)
if (attrib & HL_BOLD) if (attrib & HL_BOLD)
Strcat(attbuf, first++ ? "+bold" : "bold"); Strcat(attbuf, first++ ? "+bold" : "bold");
if (attrib & HL_INVERSE) if (attrib & HL_DIM)
Strcat(attbuf, first++ ? "+inverse" : "inverse"); Strcat(attbuf, first++ ? "+dim" : "dim");
if (attrib & HL_ITALIC)
Strcat(attbuf, first++ ? "+italic" : "italic");
if (attrib & HL_ULINE) if (attrib & HL_ULINE)
Strcat(attbuf, first++ ? "+underline" : "underline"); Strcat(attbuf, first++ ? "+underline" : "underline");
if (attrib & HL_BLINK) if (attrib & HL_BLINK)
Strcat(attbuf, first++ ? "+blink" : "blink"); Strcat(attbuf, first++ ? "+blink" : "blink");
if (attrib & HL_DIM) if (attrib & HL_INVERSE)
Strcat(attbuf, first++ ? "+dim" : "dim"); Strcat(attbuf, first++ ? "+inverse" : "inverse");
k = strlen(attbuf); k = strlen(attbuf);
if (k < (size_t)(bufsz - 1)) if (k < (size_t)(bufsz - 1))
@@ -3198,14 +3199,16 @@ status_hilite_linestr_gather_conditions(void)
clr = j; clr = j;
break; break;
} }
if (gc.cond_hilites[HL_ATTCLR_DIM] & conditions[i].mask)
atr |= HL_DIM;
if (gc.cond_hilites[HL_ATTCLR_BOLD] & conditions[i].mask) if (gc.cond_hilites[HL_ATTCLR_BOLD] & conditions[i].mask)
atr |= HL_BOLD; atr |= HL_BOLD;
if (gc.cond_hilites[HL_ATTCLR_BLINK] & conditions[i].mask) if (gc.cond_hilites[HL_ATTCLR_DIM] & conditions[i].mask)
atr |= HL_BLINK; atr |= HL_DIM;
if (gc.cond_hilites[HL_ATTCLR_ITALIC] & conditions[i].mask)
atr |= HL_ITALIC;
if (gc.cond_hilites[HL_ATTCLR_ULINE] & conditions[i].mask) if (gc.cond_hilites[HL_ATTCLR_ULINE] & conditions[i].mask)
atr |= HL_ULINE; atr |= HL_ULINE;
if (gc.cond_hilites[HL_ATTCLR_BLINK] & conditions[i].mask)
atr |= HL_BLINK;
if (gc.cond_hilites[HL_ATTCLR_INVERSE] & conditions[i].mask) if (gc.cond_hilites[HL_ATTCLR_INVERSE] & conditions[i].mask)
atr |= HL_INVERSE; atr |= HL_INVERSE;
if (atr != HL_NONE) if (atr != HL_NONE)
@@ -3931,22 +3934,25 @@ status_hilite_menu_add(int origfld)
char attrbuf[BUFSZ]; char attrbuf[BUFSZ];
char *tmpattr; char *tmpattr;
if (atr & HL_DIM)
gc.cond_hilites[HL_ATTCLR_DIM] |= cond;
if (atr & HL_BLINK)
gc.cond_hilites[HL_ATTCLR_BLINK] |= cond;
if (atr & HL_ULINE)
gc.cond_hilites[HL_ATTCLR_ULINE] |= cond;
if (atr & HL_INVERSE)
gc.cond_hilites[HL_ATTCLR_INVERSE] |= cond;
if (atr & HL_BOLD) if (atr & HL_BOLD)
gc.cond_hilites[HL_ATTCLR_BOLD] |= cond; gc.cond_hilites[HL_ATTCLR_BOLD] |= cond;
if (atr & HL_DIM)
gc.cond_hilites[HL_ATTCLR_DIM] |= cond;
if (atr & HL_ITALIC)
gc.cond_hilites[HL_ATTCLR_ITALIC] |= cond;
if (atr & HL_ULINE)
gc.cond_hilites[HL_ATTCLR_ULINE] |= cond;
if (atr & HL_BLINK)
gc.cond_hilites[HL_ATTCLR_BLINK] |= cond;
if (atr & HL_INVERSE)
gc.cond_hilites[HL_ATTCLR_INVERSE] |= cond;
if (atr == HL_NONE) { if (atr == HL_NONE) {
gc.cond_hilites[HL_ATTCLR_DIM] &= ~cond;
gc.cond_hilites[HL_ATTCLR_BLINK] &= ~cond;
gc.cond_hilites[HL_ATTCLR_ULINE] &= ~cond;
gc.cond_hilites[HL_ATTCLR_INVERSE] &= ~cond;
gc.cond_hilites[HL_ATTCLR_BOLD] &= ~cond; gc.cond_hilites[HL_ATTCLR_BOLD] &= ~cond;
gc.cond_hilites[HL_ATTCLR_DIM] &= ~cond;
gc.cond_hilites[HL_ATTCLR_ITALIC] &= ~cond;
gc.cond_hilites[HL_ATTCLR_ULINE] &= ~cond;
gc.cond_hilites[HL_ATTCLR_BLINK] &= ~cond;
gc.cond_hilites[HL_ATTCLR_INVERSE] &= ~cond;
} }
gc.cond_hilites[clr] |= cond; gc.cond_hilites[clr] |= cond;
(void) strNsubst(strcpy(clrbuf, clr2colorname(clr)), " ", "-", 0); (void) strNsubst(strcpy(clrbuf, clr2colorname(clr)), " ", "-", 0);
@@ -3999,10 +4005,11 @@ status_hilite_remove(int id)
for (i = 0; i < CLR_MAX; i++) for (i = 0; i < CLR_MAX; i++)
gc.cond_hilites[i] &= ~hlstr->mask; gc.cond_hilites[i] &= ~hlstr->mask;
gc.cond_hilites[HL_ATTCLR_DIM] &= ~hlstr->mask;
gc.cond_hilites[HL_ATTCLR_BOLD] &= ~hlstr->mask; gc.cond_hilites[HL_ATTCLR_BOLD] &= ~hlstr->mask;
gc.cond_hilites[HL_ATTCLR_BLINK] &= ~hlstr->mask; gc.cond_hilites[HL_ATTCLR_DIM] &= ~hlstr->mask;
gc.cond_hilites[HL_ATTCLR_ITALIC] &= ~hlstr->mask;
gc.cond_hilites[HL_ATTCLR_ULINE] &= ~hlstr->mask; gc.cond_hilites[HL_ATTCLR_ULINE] &= ~hlstr->mask;
gc.cond_hilites[HL_ATTCLR_BLINK] &= ~hlstr->mask;
gc.cond_hilites[HL_ATTCLR_INVERSE] &= ~hlstr->mask; gc.cond_hilites[HL_ATTCLR_INVERSE] &= ~hlstr->mask;
return TRUE; return TRUE;
} else { } else {
+16 -13
View File
@@ -7476,23 +7476,26 @@ query_attr(const char *prompt, int dflt_attr)
j = picks[i].item.a_int - 1; j = picks[i].item.a_int - 1;
if (attrnames[j].attr != ATR_NONE || pick_cnt == 1) { if (attrnames[j].attr != ATR_NONE || pick_cnt == 1) {
switch (attrnames[j].attr) { switch (attrnames[j].attr) {
case ATR_DIM: case ATR_NONE:
k |= HL_DIM; k = HL_NONE;
break;
case ATR_BLINK:
k |= HL_BLINK;
break;
case ATR_ULINE:
k |= HL_ULINE;
break;
case ATR_INVERSE:
k |= HL_INVERSE;
break; break;
case ATR_BOLD: case ATR_BOLD:
k |= HL_BOLD; k |= HL_BOLD;
break; break;
case ATR_NONE: case ATR_DIM:
k = HL_NONE; k |= HL_DIM;
break;
case ATR_ITALIC:
k |= HL_ITALIC;
break;
case ATR_ULINE:
k |= HL_ULINE;
break;
case ATR_BLINK:
k |= HL_BLINK;
break;
case ATR_INVERSE:
k |= HL_INVERSE;
break; break;
} }
} }
+5 -4
View File
@@ -1035,11 +1035,12 @@ void js_constants_init() {
SET_CONSTANT("COLORS", CLR_MAX); SET_CONSTANT("COLORS", CLR_MAX);
// color attributes (?) // color attributes (?)
SET_CONSTANT("COLOR_ATTR", HL_ATTCLR_DIM);
SET_CONSTANT("COLOR_ATTR", HL_ATTCLR_BLINK);
SET_CONSTANT("COLOR_ATTR", HL_ATTCLR_ULINE);
SET_CONSTANT("COLOR_ATTR", HL_ATTCLR_INVERSE);
SET_CONSTANT("COLOR_ATTR", HL_ATTCLR_BOLD); SET_CONSTANT("COLOR_ATTR", HL_ATTCLR_BOLD);
SET_CONSTANT("COLOR_ATTR", HL_ATTCLR_DIM);
SET_CONSTANT("COLOR_ATTR", HL_ATTCLR_ITALIC);
SET_CONSTANT("COLOR_ATTR", HL_ATTCLR_ULINE);
SET_CONSTANT("COLOR_ATTR", HL_ATTCLR_BLINK);
SET_CONSTANT("COLOR_ATTR", HL_ATTCLR_INVERSE);
SET_CONSTANT("COLOR_ATTR", BL_ATTCLR_MAX); SET_CONSTANT("COLOR_ATTR", BL_ATTCLR_MAX);
} }
+8 -5
View File
@@ -220,21 +220,24 @@ condattr(long bm, unsigned long *bmarray)
for (i = HL_ATTCLR_DIM; i < BL_ATTCLR_MAX; ++i) { for (i = HL_ATTCLR_DIM; i < BL_ATTCLR_MAX; ++i) {
if (bmarray[i] && (bm & bmarray[i])) { if (bmarray[i] && (bm & bmarray[i])) {
switch(i) { switch(i) {
case HL_ATTCLR_BOLD:
attr |= HL_BOLD;
break;
case HL_ATTCLR_DIM: case HL_ATTCLR_DIM:
attr |= HL_DIM; attr |= HL_DIM;
break; break;
case HL_ATTCLR_BLINK: case HL_ATTCLR_ITALIC:
attr |= HL_BLINK; attr |= HL_ITALIC;
break; break;
case HL_ATTCLR_ULINE: case HL_ATTCLR_ULINE:
attr |= HL_ULINE; attr |= HL_ULINE;
break; break;
case HL_ATTCLR_BLINK:
attr |= HL_BLINK;
break;
case HL_ATTCLR_INVERSE: case HL_ATTCLR_INVERSE:
attr |= HL_INVERSE; attr |= HL_INVERSE;
break; break;
case HL_ATTCLR_BOLD:
attr |= HL_BOLD;
break;
} }
} }
} }
+15 -12
View File
@@ -1273,24 +1273,25 @@ condattr(long bm, unsigned long *bmarray)
if (bm && bmarray) { if (bm && bmarray) {
for (i = HL_ATTCLR_DIM; i < BL_ATTCLR_MAX; ++i) { for (i = HL_ATTCLR_DIM; i < BL_ATTCLR_MAX; ++i) {
if ((bmarray[i] & bm) != 0) { if ((bmarray[i] & bm) != 0) {
switch (i) { switch(i) {
case HL_ATTCLR_BOLD:
attr |= HL_BOLD;
break;
case HL_ATTCLR_DIM: case HL_ATTCLR_DIM:
attr |= HL_DIM; attr |= HL_DIM;
break; break;
case HL_ATTCLR_BLINK: case HL_ATTCLR_ITALIC:
attr |= HL_BLINK; attr |= HL_ITALIC;
break; break;
case HL_ATTCLR_ULINE: case HL_ATTCLR_ULINE:
attr |= HL_ULINE; attr |= HL_ULINE;
break; break;
case HL_ATTCLR_BLINK:
attr |= HL_BLINK;
break;
case HL_ATTCLR_INVERSE: case HL_ATTCLR_INVERSE:
attr |= HL_INVERSE; attr |= HL_INVERSE;
break; break;
case HL_ATTCLR_BOLD:
attr |= HL_BOLD;
break;
default:
break;
} }
} }
} }
@@ -1306,14 +1307,16 @@ nhattr2curses(int attrmask)
if (attrmask & HL_BOLD) if (attrmask & HL_BOLD)
result |= A_BOLD; result |= A_BOLD;
if (attrmask & HL_INVERSE) if (attrmask & HL_DIM)
result |= A_REVERSE; result |= A_DIM;
if (attrmask & HL_ITALIC)
result |= A_ITALIC;
if (attrmask & HL_ULINE) if (attrmask & HL_ULINE)
result |= A_UNDERLINE; result |= A_UNDERLINE;
if (attrmask & HL_BLINK) if (attrmask & HL_BLINK)
result |= A_BLINK; result |= A_BLINK;
if (attrmask & HL_DIM) if (attrmask & HL_INVERSE)
result |= A_DIM; result |= A_REVERSE;
return result; return result;
} }
+20 -13
View File
@@ -4824,21 +4824,24 @@ condattr(long bm, unsigned long *bmarray)
for (i = HL_ATTCLR_DIM; i < BL_ATTCLR_MAX; ++i) { for (i = HL_ATTCLR_DIM; i < BL_ATTCLR_MAX; ++i) {
if ((bm & bmarray[i]) != 0) { if ((bm & bmarray[i]) != 0) {
switch (i) { switch (i) {
case HL_ATTCLR_BOLD:
attr |= HL_BOLD;
break;
case HL_ATTCLR_DIM: case HL_ATTCLR_DIM:
attr |= HL_DIM; attr |= HL_DIM;
break; break;
case HL_ATTCLR_BLINK: case HL_ATTCLR_ITALIC:
attr |= HL_BLINK; attr |= HL_ITALIC;
break; break;
case HL_ATTCLR_ULINE: case HL_ATTCLR_ULINE:
attr |= HL_ULINE; attr |= HL_ULINE;
break; break;
case HL_ATTCLR_BLINK:
attr |= HL_BLINK;
break;
case HL_ATTCLR_INVERSE: case HL_ATTCLR_INVERSE:
attr |= HL_INVERSE; attr |= HL_INVERSE;
break; break;
case HL_ATTCLR_BOLD:
attr |= HL_BOLD;
break;
} }
} }
} }
@@ -4851,28 +4854,32 @@ condattr(long bm, unsigned long *bmarray)
if (m) { \ if (m) { \
if ((m) & HL_BOLD) \ if ((m) & HL_BOLD) \
term_start_attr(ATR_BOLD); \ term_start_attr(ATR_BOLD); \
if ((m) & HL_INVERSE) \ if ((m) & HL_DIM) \
term_start_attr(ATR_INVERSE); \ term_start_attr(ATR_DIM); \
if ((m) & HL_ITALIC) \
term_start_attr(ATR_ITALIC); \
if ((m) & HL_ULINE) \ if ((m) & HL_ULINE) \
term_start_attr(ATR_ULINE); \ term_start_attr(ATR_ULINE); \
if ((m) & HL_BLINK) \ if ((m) & HL_BLINK) \
term_start_attr(ATR_BLINK); \ term_start_attr(ATR_BLINK); \
if ((m) & HL_DIM) \ if ((m) & HL_INVERSE) \
term_start_attr(ATR_DIM); \ term_start_attr(ATR_INVERSE); \
} \ } \
} while (0) } while (0)
#define End_Attr(m) \ #define End_Attr(m) \
do { \ do { \
if (m) { \ if (m) { \
if ((m) & HL_DIM) \ if ((m) & HL_INVERSE) \
term_end_attr(ATR_DIM); \ term_end_attr(ATR_INVERSE); \
if ((m) & HL_BLINK) \ if ((m) & HL_BLINK) \
term_end_attr(ATR_BLINK); \ term_end_attr(ATR_BLINK); \
if ((m) & HL_ULINE) \ if ((m) & HL_ULINE) \
term_end_attr(ATR_ULINE); \ term_end_attr(ATR_ULINE); \
if ((m) & HL_INVERSE) \ if ((m) & HL_ITALIC) \
term_end_attr(ATR_INVERSE); \ term_end_attr(ATR_ITALIC); \
if ((m) & HL_DIM) \
term_end_attr(ATR_DIM); \
if ((m) & HL_BOLD) \ if ((m) & HL_BOLD) \
term_end_attr(ATR_BOLD); \ term_end_attr(ATR_BOLD); \
} \ } \
+5 -4
View File
@@ -3068,11 +3068,12 @@ static int
mswin_condattr(long bm, unsigned long *bmarray) mswin_condattr(long bm, unsigned long *bmarray)
{ {
if (bm && bmarray) { if (bm && bmarray) {
if (bm & bmarray[HL_ATTCLR_DIM]) return HL_DIM; if (bm & bmarray[HL_ATTCLR_BOLD]) return HL_BOLD;
if (bm & bmarray[HL_ATTCLR_BLINK]) return HL_BLINK; if (bm & bmarray[HL_ATTCLR_DIM]) return HL_DIM;
if (bm & bmarray[HL_ATTCLR_ULINE]) return HL_ULINE; if (bm & bmarray[HL_ATTCLR_ITALIC]) return HL_ITALIC;
if (bm & bmarray[HL_ATTCLR_ULINE]) return HL_ULINE;
if (bm & bmarray[HL_ATTCLR_BLINK]) return HL_BLINK;
if (bm & bmarray[HL_ATTCLR_INVERSE]) return HL_INVERSE; if (bm & bmarray[HL_ATTCLR_INVERSE]) return HL_INVERSE;
if (bm & bmarray[HL_ATTCLR_BOLD]) return HL_BOLD;
} }
return HL_NONE; return HL_NONE;