version 1.132, 2012/05/05 18:45:55 |
version 1.133, 2012/05/22 09:09:16 |
|
|
void tty_redraw_region(struct tty *, const struct tty_ctx *); |
void tty_redraw_region(struct tty *, const struct tty_ctx *); |
void tty_emulate_repeat( |
void tty_emulate_repeat( |
struct tty *, enum tty_code_code, enum tty_code_code, u_int); |
struct tty *, enum tty_code_code, enum tty_code_code, u_int); |
|
void tty_repeat_space(struct tty *, u_int); |
void tty_cell(struct tty *, |
void tty_cell(struct tty *, |
const struct grid_cell *, const struct grid_utf8 *); |
const struct grid_cell *, const struct grid_utf8 *); |
|
|
|
|
} |
} |
} |
} |
|
|
|
void |
|
tty_repeat_space(struct tty *tty, u_int n) |
|
{ |
|
while (n-- > 0) |
|
tty_putc(tty, ' '); |
|
} |
|
|
/* |
/* |
* Is the region large enough to be worth redrawing once later rather than |
* Is the region large enough to be worth redrawing once later rather than |
* probably several times now? Currently yes if it is more than 50% of the |
* probably several times now? Currently yes if it is more than 50% of the |
|
|
if (sx != screen_size_x(s) && ox + screen_size_x(s) >= tty->sx && |
if (sx != screen_size_x(s) && ox + screen_size_x(s) >= tty->sx && |
tty_term_has(tty->term, TTYC_EL)) |
tty_term_has(tty->term, TTYC_EL)) |
tty_putcode(tty, TTYC_EL); |
tty_putcode(tty, TTYC_EL); |
else { |
else |
for (i = sx; i < screen_size_x(s); i++) |
tty_repeat_space(tty, screen_size_x(s) - sx); |
tty_putc(tty, ' '); |
|
} |
|
tty_update_mode(tty, tty->mode, s); |
tty_update_mode(tty, tty->mode, s); |
} |
} |
|
|
|
|
{ |
{ |
struct window_pane *wp = ctx->wp; |
struct window_pane *wp = ctx->wp; |
struct screen *s = wp->screen; |
struct screen *s = wp->screen; |
u_int i; |
|
|
|
if (ctx->xoff != 0 || screen_size_x(s) < tty->sx) { |
if (ctx->xoff != 0 || screen_size_x(s) < tty->sx) { |
tty_draw_line(tty, wp->screen, ctx->ocy, ctx->xoff, ctx->yoff); |
tty_draw_line(tty, wp->screen, ctx->ocy, ctx->xoff, ctx->yoff); |
|
|
else if (tty_term_has(tty->term, TTYC_SMIR) && |
else if (tty_term_has(tty->term, TTYC_SMIR) && |
tty_term_has(tty->term, TTYC_RMIR)) { |
tty_term_has(tty->term, TTYC_RMIR)) { |
tty_putcode(tty, TTYC_SMIR); |
tty_putcode(tty, TTYC_SMIR); |
for (i = 0; i < ctx->num; i++) |
tty_repeat_space(tty, ctx->num); |
tty_putc(tty, ' '); |
|
tty_putcode(tty, TTYC_RMIR); |
tty_putcode(tty, TTYC_RMIR); |
} else |
} else |
tty_draw_line(tty, wp->screen, ctx->ocy, ctx->xoff, ctx->yoff); |
tty_draw_line(tty, wp->screen, ctx->ocy, ctx->xoff, ctx->yoff); |
|
|
{ |
{ |
struct window_pane *wp = ctx->wp; |
struct window_pane *wp = ctx->wp; |
struct screen *s = wp->screen; |
struct screen *s = wp->screen; |
u_int i; |
|
|
|
tty_reset(tty); |
tty_reset(tty); |
|
|
tty_cursor_pane(tty, ctx, 0, ctx->ocy); |
tty_cursor_pane(tty, ctx, 0, ctx->ocy); |
|
|
if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) { |
if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) |
tty_putcode(tty, TTYC_EL); |
tty_putcode(tty, TTYC_EL); |
} else { |
else |
for (i = 0; i < screen_size_x(s); i++) |
tty_repeat_space(tty, screen_size_x(s)); |
tty_putc(tty, ' '); |
|
} |
|
} |
} |
|
|
void |
void |
|
|
{ |
{ |
struct window_pane *wp = ctx->wp; |
struct window_pane *wp = ctx->wp; |
struct screen *s = wp->screen; |
struct screen *s = wp->screen; |
u_int i; |
|
|
|
tty_reset(tty); |
tty_reset(tty); |
|
|
|
|
|
|
if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) |
if (tty_pane_full_width(tty, ctx) && tty_term_has(tty->term, TTYC_EL)) |
tty_putcode(tty, TTYC_EL); |
tty_putcode(tty, TTYC_EL); |
else { |
else |
for (i = ctx->ocx; i < screen_size_x(s); i++) |
tty_repeat_space(tty, screen_size_x(s) - ctx->ocx); |
tty_putc(tty, ' '); |
|
} |
|
} |
} |
|
|
void |
void |
tty_cmd_clearstartofline(struct tty *tty, const struct tty_ctx *ctx) |
tty_cmd_clearstartofline(struct tty *tty, const struct tty_ctx *ctx) |
{ |
{ |
u_int i; |
|
|
|
tty_reset(tty); |
tty_reset(tty); |
|
|
if (ctx->xoff == 0 && tty_term_has(tty->term, TTYC_EL1)) { |
if (ctx->xoff == 0 && tty_term_has(tty->term, TTYC_EL1)) { |
|
|
tty_putcode(tty, TTYC_EL1); |
tty_putcode(tty, TTYC_EL1); |
} else { |
} else { |
tty_cursor_pane(tty, ctx, 0, ctx->ocy); |
tty_cursor_pane(tty, ctx, 0, ctx->ocy); |
for (i = 0; i < ctx->ocx + 1; i++) |
tty_repeat_space(tty, ctx->ocx + 1); |
tty_putc(tty, ' '); |
|
} |
} |
} |
} |
|
|
|
|
} |
} |
} |
} |
} else { |
} else { |
for (i = ctx->ocx; i < screen_size_x(s); i++) |
tty_repeat_space(tty, screen_size_x(s) - ctx->ocx); |
tty_putc(tty, ' '); |
|
for (j = ctx->ocy + 1; j < screen_size_y(s); j++) { |
for (j = ctx->ocy + 1; j < screen_size_y(s); j++) { |
tty_cursor_pane(tty, ctx, 0, j); |
tty_cursor_pane(tty, ctx, 0, j); |
for (i = 0; i < screen_size_x(s); i++) |
tty_repeat_space(tty, screen_size_x(s)); |
tty_putc(tty, ' '); |
|
} |
} |
} |
} |
} |
} |
|
|
} else { |
} else { |
for (j = 0; j < ctx->ocy; j++) { |
for (j = 0; j < ctx->ocy; j++) { |
tty_cursor_pane(tty, ctx, 0, j); |
tty_cursor_pane(tty, ctx, 0, j); |
for (i = 0; i < screen_size_x(s); i++) |
tty_repeat_space(tty, screen_size_x(s)); |
tty_putc(tty, ' '); |
|
} |
} |
} |
} |
for (i = 0; i <= ctx->ocx; i++) |
tty_repeat_space(tty, ctx->ocx + 1); |
tty_putc(tty, ' '); |
|
} |
} |
|
|
void |
void |
|
|
} else { |
} else { |
for (j = 0; j < screen_size_y(s); j++) { |
for (j = 0; j < screen_size_y(s); j++) { |
tty_cursor_pane(tty, ctx, 0, j); |
tty_cursor_pane(tty, ctx, 0, j); |
for (i = 0; i < screen_size_x(s); i++) |
tty_repeat_space(tty, screen_size_x(s)); |
tty_putc(tty, ' '); |
|
} |
} |
} |
} |
} |
} |