1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-06 21:48:05 -05:00

Rename cursor attributes from the TATTR_ to the ATTR_ namespace

No functional change.
This commit is contained in:
Ben Harris 2025-04-03 20:50:36 +01:00
parent f2d63388a8
commit 7a100534d3
4 changed files with 32 additions and 32 deletions

28
putty.h
View File

@ -208,9 +208,6 @@ extern const int colour_indices_oscp_to_osc4[OSCP_NCOLOURS];
* ATTR_INVALID is an illegal colour combination. * ATTR_INVALID is an illegal colour combination.
*/ */
#define TATTR_ACTCURS 0x40000000UL /* active cursor (block) */
#define TATTR_PASCURS 0x20000000UL /* passive cursor (box) */
#define TATTR_RIGHTCURS 0x10000000UL /* cursor-on-RHS */
#define TATTR_COMBINING 0x80000000UL /* combining characters */ #define TATTR_COMBINING 0x80000000UL /* combining characters */
#define DATTR_STARTRUN 0x80000000UL /* start of redraw run */ #define DATTR_STARTRUN 0x80000000UL /* start of redraw run */
@ -256,17 +253,20 @@ extern const int colour_indices_oscp_to_osc4[OSCP_NCOLOURS];
*/ */
#define UCSWIDE 0xDFFF #define UCSWIDE 0xDFFF
#define ATTR_NARROW 0x0800000U #define ATTR_NARROW 0x00800000U
#define ATTR_WIDE 0x0400000U #define ATTR_WIDE 0x00400000U
#define ATTR_BOLD 0x0040000U #define ATTR_BOLD 0x00040000U
#define ATTR_UNDER 0x0080000U #define ATTR_UNDER 0x00080000U
#define ATTR_REVERSE 0x0100000U #define ATTR_REVERSE 0x00100000U
#define ATTR_BLINK 0x0200000U #define ATTR_BLINK 0x00200000U
#define ATTR_FGMASK 0x00001FFU /* stores a colour in OSC 4 indexing */ #define ATTR_FGMASK 0x000001FFU /* stores a colour in OSC 4 indexing */
#define ATTR_BGMASK 0x003FE00U /* stores a colour in OSC 4 indexing */ #define ATTR_BGMASK 0x0003FE00U /* stores a colour in OSC 4 indexing */
#define ATTR_COLOURS 0x003FFFFU #define ATTR_COLOURS 0x0003FFFFU
#define ATTR_DIM 0x1000000U #define ATTR_DIM 0x01000000U
#define ATTR_STRIKE 0x2000000U #define ATTR_STRIKE 0x02000000U
#define ATTR_ACTCURS 0x40000000UL /* active cursor (block) */
#define ATTR_PASCURS 0x20000000UL /* passive cursor (box) */
#define ATTR_RIGHTCURS 0x10000000UL /* cursor-on-RHS */
#define ATTR_FGSHIFT 0 #define ATTR_FGSHIFT 0
#define ATTR_BGSHIFT 9 #define ATTR_BGSHIFT 9

View File

@ -6017,7 +6017,7 @@ static void do_paint_draw(Terminal *term, termline *ldata, int x, int y,
IS_REGIONAL_INDICATOR_LETTER(ch[1])) IS_REGIONAL_INDICATOR_LETTER(ch[1]))
attr |= ATTR_WIDE | TATTR_COMBINING; attr |= ATTR_WIDE | TATTR_COMBINING;
win_draw_text(term->win, x, y, ch, ccount, attr, ldata->lattr, tc); win_draw_text(term->win, x, y, ch, ccount, attr, ldata->lattr, tc);
if (attr & (TATTR_ACTCURS | TATTR_PASCURS)) if (attr & (ATTR_ACTCURS | ATTR_PASCURS))
win_draw_cursor(term->win, x, y, ch, ccount, win_draw_cursor(term->win, x, y, ch, ccount,
attr, ldata->lattr, tc); attr, ldata->lattr, tc);
} }
@ -6053,13 +6053,13 @@ static void do_paint(Terminal *term)
if (term->cursor_on) { if (term->cursor_on) {
if (term->has_focus) { if (term->has_focus) {
if (term->cblinker || !term->blink_cur) if (term->cblinker || !term->blink_cur)
cursor = TATTR_ACTCURS; cursor = ATTR_ACTCURS;
else else
cursor = 0; cursor = 0;
} else } else
cursor = TATTR_PASCURS; cursor = ATTR_PASCURS;
if (term->wrapnext) if (term->wrapnext)
cursor |= TATTR_RIGHTCURS; cursor |= ATTR_RIGHTCURS;
} else } else
cursor = 0; cursor = 0;
our_curs_y = term->curs.y - term->disptop; our_curs_y = term->curs.y - term->disptop;

View File

@ -3886,7 +3886,7 @@ static void do_text_internal(
nfg = ((monochrome ? ATTR_DEFFG : (attr & ATTR_FGMASK)) >> ATTR_FGSHIFT); nfg = ((monochrome ? ATTR_DEFFG : (attr & ATTR_FGMASK)) >> ATTR_FGSHIFT);
nbg = ((monochrome ? ATTR_DEFBG : (attr & ATTR_BGMASK)) >> ATTR_BGSHIFT); nbg = ((monochrome ? ATTR_DEFBG : (attr & ATTR_BGMASK)) >> ATTR_BGSHIFT);
if (!!(attr & ATTR_REVERSE) ^ (monochrome && (attr & TATTR_ACTCURS))) { if (!!(attr & ATTR_REVERSE) ^ (monochrome && (attr & ATTR_ACTCURS))) {
struct optionalrgb trgb; struct optionalrgb trgb;
t = nfg; t = nfg;
@ -3905,7 +3905,7 @@ static void do_text_internal(
if (nbg < 16) nbg |= 8; if (nbg < 16) nbg |= 8;
else if (nbg >= 256) nbg |= 1; else if (nbg >= 256) nbg |= 1;
} }
if ((attr & TATTR_ACTCURS) && !monochrome) { if ((attr & ATTR_ACTCURS) && !monochrome) {
truecolour.fg = truecolour.bg = optionalrgb_none; truecolour.fg = truecolour.bg = optionalrgb_none;
nfg = 260; nfg = 260;
nbg = 261; nbg = 261;
@ -4071,13 +4071,13 @@ static void gtkwin_draw_cursor(
bool active, passive; bool active, passive;
int widefactor; int widefactor;
if (attr & TATTR_PASCURS) { if (attr & ATTR_PASCURS) {
attr &= ~TATTR_PASCURS; attr &= ~ATTR_PASCURS;
passive = true; passive = true;
} else } else
passive = false; passive = false;
if ((attr & TATTR_ACTCURS) && inst->cursor_type != CURSOR_BLOCK) { if ((attr & ATTR_ACTCURS) && inst->cursor_type != CURSOR_BLOCK) {
attr &= ~TATTR_ACTCURS; attr &= ~ATTR_ACTCURS;
active = true; active = true;
} else } else
active = false; active = false;
@ -4138,7 +4138,7 @@ static void gtkwin_draw_cursor(
length = len * widefactor * char_width; length = len * widefactor * char_width;
} else /* inst->cursor_type == CURSOR_VERTICAL_LINE */ { } else /* inst->cursor_type == CURSOR_VERTICAL_LINE */ {
int xadjust = 0; int xadjust = 0;
if (attr & TATTR_RIGHTCURS) if (attr & ATTR_RIGHTCURS)
xadjust = char_width - 1; xadjust = char_width - 1;
startx = x * inst->font_width + inst->window_border + xadjust; startx = x * inst->font_width + inst->window_border + xadjust;
starty = y * inst->font_height + inst->window_border; starty = y * inst->font_height + inst->window_border;

View File

@ -3571,7 +3571,7 @@ static void do_text_internal(
x += wgs->offset_width; x += wgs->offset_width;
y += wgs->offset_height; y += wgs->offset_height;
if ((attr & TATTR_ACTCURS) && if ((attr & ATTR_ACTCURS) &&
(wgs->cursor_type == CURSOR_BLOCK || wgs->term->big_cursor)) { (wgs->cursor_type == CURSOR_BLOCK || wgs->term->big_cursor)) {
truecolour.fg = truecolour.bg = optionalrgb_none; truecolour.fg = truecolour.bg = optionalrgb_none;
attr &= ~(ATTR_REVERSE|ATTR_BLINK|ATTR_COLOURS|ATTR_DIM); attr &= ~(ATTR_REVERSE|ATTR_BLINK|ATTR_COLOURS|ATTR_DIM);
@ -3967,14 +3967,14 @@ static void wintw_draw_cursor(
lattr &= LATTR_MODE; lattr &= LATTR_MODE;
if ((attr & TATTR_ACTCURS) && if ((attr & ATTR_ACTCURS) &&
(ctype == CURSOR_BLOCK || wgs->term->big_cursor)) { (ctype == CURSOR_BLOCK || wgs->term->big_cursor)) {
if (*text != UCSWIDE) { if (*text != UCSWIDE) {
win_draw_text(tw, x, y, text, len, attr, lattr, truecolour); win_draw_text(tw, x, y, text, len, attr, lattr, truecolour);
return; return;
} }
ctype = CURSOR_VERTICAL_LINE; ctype = CURSOR_VERTICAL_LINE;
attr |= TATTR_RIGHTCURS; attr |= ATTR_RIGHTCURS;
} }
fnt_width = char_width = wgs->font_width * (1 + (lattr != LATTR_NORM)); fnt_width = char_width = wgs->font_width * (1 + (lattr != LATTR_NORM));
@ -3985,7 +3985,7 @@ static void wintw_draw_cursor(
x += wgs->offset_width; x += wgs->offset_width;
y += wgs->offset_height; y += wgs->offset_height;
if ((attr & TATTR_PASCURS) && if ((attr & ATTR_PASCURS) &&
(ctype == CURSOR_BLOCK || wgs->term->big_cursor)) { (ctype == CURSOR_BLOCK || wgs->term->big_cursor)) {
POINT pts[5]; POINT pts[5];
HPEN oldpen; HPEN oldpen;
@ -3998,7 +3998,7 @@ static void wintw_draw_cursor(
Polyline(wgs->wintw_hdc, pts, 5); Polyline(wgs->wintw_hdc, pts, 5);
oldpen = SelectObject(wgs->wintw_hdc, oldpen); oldpen = SelectObject(wgs->wintw_hdc, oldpen);
DeleteObject(oldpen); DeleteObject(oldpen);
} else if ((attr & (TATTR_ACTCURS | TATTR_PASCURS)) && } else if ((attr & (ATTR_ACTCURS | ATTR_PASCURS)) &&
ctype != CURSOR_BLOCK) { ctype != CURSOR_BLOCK) {
int startx, starty, dx, dy, length, i; int startx, starty, dx, dy, length, i;
if (ctype == CURSOR_UNDERLINE) { if (ctype == CURSOR_UNDERLINE) {
@ -4009,7 +4009,7 @@ static void wintw_draw_cursor(
length = char_width; length = char_width;
} else /* ctype == CURSOR_VERTICAL_LINE */ { } else /* ctype == CURSOR_VERTICAL_LINE */ {
int xadjust = 0; int xadjust = 0;
if (attr & TATTR_RIGHTCURS) if (attr & ATTR_RIGHTCURS)
xadjust = char_width - 1; xadjust = char_width - 1;
startx = x + xadjust; startx = x + xadjust;
starty = y; starty = y;
@ -4017,7 +4017,7 @@ static void wintw_draw_cursor(
dy = 1; dy = 1;
length = wgs->font_height; length = wgs->font_height;
} }
if (attr & TATTR_ACTCURS) { if (attr & ATTR_ACTCURS) {
HPEN oldpen; HPEN oldpen;
oldpen = oldpen =
SelectObject(wgs->wintw_hdc, SelectObject(wgs->wintw_hdc,