version 1.89, 2021/10/11 13:27:50 |
version 1.90, 2021/10/14 13:19:01 |
|
|
static void screen_redraw_set_context(struct client *, |
static void screen_redraw_set_context(struct client *, |
struct screen_redraw_ctx *); |
struct screen_redraw_ctx *); |
|
|
#define CELL_INSIDE 0 |
|
#define CELL_TOPBOTTOM 1 |
|
#define CELL_LEFTRIGHT 2 |
|
#define CELL_TOPLEFT 3 |
|
#define CELL_TOPRIGHT 4 |
|
#define CELL_BOTTOMLEFT 5 |
|
#define CELL_BOTTOMRIGHT 6 |
|
#define CELL_TOPJOIN 7 |
|
#define CELL_BOTTOMJOIN 8 |
|
#define CELL_LEFTJOIN 9 |
|
#define CELL_RIGHTJOIN 10 |
|
#define CELL_JOIN 11 |
|
#define CELL_OUTSIDE 12 |
|
|
|
#define CELL_BORDERS " xqlkmjwvtun~" |
|
|
|
#define START_ISOLATE "\342\201\246" |
#define START_ISOLATE "\342\201\246" |
#define END_ISOLATE "\342\201\251" |
#define END_ISOLATE "\342\201\251" |
|
|
static const struct utf8_data screen_redraw_double_borders[] = { |
|
{ "", 0, 0, 0 }, |
|
{ "\342\225\221", 0, 3, 1 }, /* U+2551 */ |
|
{ "\342\225\220", 0, 3, 1 }, /* U+2550 */ |
|
{ "\342\225\224", 0, 3, 1 }, /* U+2554 */ |
|
{ "\342\225\227", 0, 3, 1 }, /* U+2557 */ |
|
{ "\342\225\232", 0, 3, 1 }, /* U+255A */ |
|
{ "\342\225\235", 0, 3, 1 }, /* U+255D */ |
|
{ "\342\225\246", 0, 3, 1 }, /* U+2566 */ |
|
{ "\342\225\251", 0, 3, 1 }, /* U+2569 */ |
|
{ "\342\225\240", 0, 3, 1 }, /* U+2560 */ |
|
{ "\342\225\243", 0, 3, 1 }, /* U+2563 */ |
|
{ "\342\225\254", 0, 3, 1 }, /* U+256C */ |
|
{ "\302\267", 0, 2, 1 } /* U+00B7 */ |
|
}; |
|
|
|
static const struct utf8_data screen_redraw_heavy_borders[] = { |
|
{ "", 0, 0, 0 }, |
|
{ "\342\224\203", 0, 3, 1 }, /* U+2503 */ |
|
{ "\342\224\201", 0, 3, 1 }, /* U+2501 */ |
|
{ "\342\224\223", 0, 3, 1 }, /* U+2513 */ |
|
{ "\342\224\217", 0, 3, 1 }, /* U+250F */ |
|
{ "\342\224\227", 0, 3, 1 }, /* U+2517 */ |
|
{ "\342\224\233", 0, 3, 1 }, /* U+251B */ |
|
{ "\342\224\263", 0, 3, 1 }, /* U+2533 */ |
|
{ "\342\224\273", 0, 3, 1 }, /* U+253B */ |
|
{ "\342\224\243", 0, 3, 1 }, /* U+2523 */ |
|
{ "\342\224\253", 0, 3, 1 }, /* U+252B */ |
|
{ "\342\225\213", 0, 3, 1 }, /* U+254B */ |
|
{ "\302\267", 0, 2, 1 } /* U+00B7 */ |
|
}; |
|
|
|
enum screen_redraw_border_type { |
enum screen_redraw_border_type { |
SCREEN_REDRAW_OUTSIDE, |
SCREEN_REDRAW_OUTSIDE, |
SCREEN_REDRAW_INSIDE, |
SCREEN_REDRAW_INSIDE, |
|
|
|
|
/* Get cell border character. */ |
/* Get cell border character. */ |
static void |
static void |
screen_redraw_border_set(struct window_pane *wp, int pane_lines, int cell_type, |
screen_redraw_border_set(struct window_pane *wp, enum pane_lines pane_lines, |
struct grid_cell *gc) |
int cell_type, struct grid_cell *gc) |
{ |
{ |
u_int idx; |
u_int idx; |
|
|
|
|
break; |
break; |
case PANE_LINES_DOUBLE: |
case PANE_LINES_DOUBLE: |
gc->attr &= ~GRID_ATTR_CHARSET; |
gc->attr &= ~GRID_ATTR_CHARSET; |
utf8_copy(&gc->data, &screen_redraw_double_borders[cell_type]); |
utf8_copy(&gc->data, tty_acs_double_borders(cell_type)); |
break; |
break; |
case PANE_LINES_HEAVY: |
case PANE_LINES_HEAVY: |
gc->attr &= ~GRID_ATTR_CHARSET; |
gc->attr &= ~GRID_ATTR_CHARSET; |
utf8_copy(&gc->data, &screen_redraw_heavy_borders[cell_type]); |
utf8_copy(&gc->data, tty_acs_heavy_borders(cell_type)); |
break; |
break; |
case PANE_LINES_SIMPLE: |
case PANE_LINES_SIMPLE: |
gc->attr &= ~GRID_ATTR_CHARSET; |
gc->attr &= ~GRID_ATTR_CHARSET; |
utf8_set(&gc->data, " |-+++++++++."[cell_type]); |
utf8_set(&gc->data, SIMPLE_BORDERS[cell_type]); |
break; |
break; |
default: |
default: |
gc->attr |= GRID_ATTR_CHARSET; |
gc->attr |= GRID_ATTR_CHARSET; |
|
|
/* Update pane status. */ |
/* Update pane status. */ |
static int |
static int |
screen_redraw_make_pane_status(struct client *c, struct window_pane *wp, |
screen_redraw_make_pane_status(struct client *c, struct window_pane *wp, |
struct screen_redraw_ctx *rctx, int pane_lines) |
struct screen_redraw_ctx *rctx, enum pane_lines pane_lines) |
{ |
{ |
struct window *w = wp->window; |
struct window *w = wp->window; |
struct grid_cell gc; |
struct grid_cell gc; |
|
|
static int |
static int |
screen_redraw_update(struct client *c, int flags) |
screen_redraw_update(struct client *c, int flags) |
{ |
{ |
struct window *w = c->session->curw->window; |
struct window *w = c->session->curw->window; |
struct window_pane *wp; |
struct window_pane *wp; |
struct options *wo = w->options; |
struct options *wo = w->options; |
int redraw, lines; |
int redraw; |
struct screen_redraw_ctx ctx; |
enum pane_lines lines; |
|
struct screen_redraw_ctx ctx; |
|
|
if (c->message_string != NULL) |
if (c->message_string != NULL) |
redraw = status_message_redraw(c); |
redraw = status_message_redraw(c); |