version 1.16, 2010/02/04 18:20:16 |
version 1.17, 2010/09/11 16:19:22 |
|
|
#define CELL_JOIN 11 |
#define CELL_JOIN 11 |
#define CELL_OUTSIDE 12 |
#define CELL_OUTSIDE 12 |
|
|
|
#define CELL_BORDERS " xqlkmjwvtun~" |
|
|
/* Check if cell is on the border of a particular pane. */ |
/* Check if cell is on the border of a particular pane. */ |
int |
int |
screen_redraw_cell_border1(struct window_pane *wp, u_int px, u_int py) |
screen_redraw_cell_border1(struct window_pane *wp, u_int px, u_int py) |
|
|
struct grid_cell active_gc, other_gc; |
struct grid_cell active_gc, other_gc; |
u_int i, j, type; |
u_int i, j, type; |
int status, fg, bg; |
int status, fg, bg; |
const u_char *base, *ptr; |
|
u_char ch, border[20]; |
|
|
|
/* Get status line, er, status. */ |
/* Get status line, er, status. */ |
if (c->message_string != NULL || c->prompt_string != NULL) |
if (c->message_string != NULL || c->prompt_string != NULL) |
|
|
memcpy(&other_gc, &grid_default_cell, sizeof other_gc); |
memcpy(&other_gc, &grid_default_cell, sizeof other_gc); |
memcpy(&active_gc, &grid_default_cell, sizeof active_gc); |
memcpy(&active_gc, &grid_default_cell, sizeof active_gc); |
active_gc.data = other_gc.data = 'x'; /* not space */ |
active_gc.data = other_gc.data = 'x'; /* not space */ |
|
active_gc.attr = other_gc.attr = GRID_ATTR_CHARSET; |
fg = options_get_number(&c->session->options, "pane-border-fg"); |
fg = options_get_number(&c->session->options, "pane-border-fg"); |
colour_set_fg(&other_gc, fg); |
colour_set_fg(&other_gc, fg); |
bg = options_get_number(&c->session->options, "pane-border-bg"); |
bg = options_get_number(&c->session->options, "pane-border-bg"); |
|
|
colour_set_bg(&active_gc, bg); |
colour_set_bg(&active_gc, bg); |
|
|
/* Draw background and borders. */ |
/* Draw background and borders. */ |
strlcpy(border, " |-....--||+.", sizeof border); |
|
if (tty_term_has(tty->term, TTYC_ACSC)) { |
|
base = " xqlkmjwvtun~"; |
|
for (ptr = base; *ptr != '\0'; ptr++) { |
|
if ((ch = tty_get_acs(tty, *ptr)) != '\0') |
|
border[ptr - base] = ch; |
|
} |
|
other_gc.attr |= GRID_ATTR_CHARSET; |
|
active_gc.attr |= GRID_ATTR_CHARSET; |
|
} |
|
for (j = 0; j < tty->sy - status; j++) { |
for (j = 0; j < tty->sy - status; j++) { |
if (status_only && j != tty->sy - 1) |
if (status_only && j != tty->sy - 1) |
continue; |
continue; |
|
|
else |
else |
tty_attributes(tty, &other_gc); |
tty_attributes(tty, &other_gc); |
tty_cursor(tty, i, j); |
tty_cursor(tty, i, j); |
tty_putc(tty, border[type]); |
tty_putc(tty, CELL_BORDERS[type]); |
} |
} |
} |
} |
|
|