=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/screen-write.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- src/usr.bin/tmux/screen-write.c 2009/07/22 16:45:31 1.15 +++ src/usr.bin/tmux/screen-write.c 2009/07/22 18:02:23 1.16 @@ -1,4 +1,4 @@ -/* $OpenBSD: screen-write.c,v 1.15 2009/07/22 16:45:31 nicm Exp $ */ +/* $OpenBSD: screen-write.c,v 1.16 2009/07/22 18:02:23 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -327,7 +327,7 @@ s->rupper = 0; s->rlower = screen_size_y(s) - 1; - tty_write0(ctx->wp, TTY_ALIGNMENTTEST); + tty_write0(ctx->wp, tty_cmd_alignmenttest); } /* Insert nx characters. */ @@ -349,7 +349,7 @@ if (s->cx <= screen_size_x(s) - 1) grid_view_insert_cells(s->grid, s->cx, s->cy, nx); - tty_writenum(ctx->wp, TTY_INSERTCHARACTER, nx); + tty_writenum(ctx->wp, tty_cmd_insertcharacter, nx); } /* Delete nx characters. */ @@ -371,7 +371,7 @@ if (s->cx <= screen_size_x(s) - 1) grid_view_delete_cells(s->grid, s->cx, s->cy, nx); - tty_writenum(ctx->wp, TTY_DELETECHARACTER, nx); + tty_writenum(ctx->wp, tty_cmd_deletecharacter, nx); } /* Insert ny lines. */ @@ -393,7 +393,7 @@ grid_view_insert_lines(s->grid, s->cy, ny); - tty_writenum(ctx->wp, TTY_INSERTLINE, ny); + tty_writenum(ctx->wp, tty_cmd_insertline, ny); return; } @@ -409,7 +409,7 @@ else grid_view_insert_lines_region(s->grid, s->rlower, s->cy, ny); - tty_writenum(ctx->wp, TTY_INSERTLINE, ny); + tty_writenum(ctx->wp, tty_cmd_insertline, ny); } /* Delete ny lines. */ @@ -431,7 +431,7 @@ grid_view_delete_lines(s->grid, s->cy, ny); - tty_writenum(ctx->wp, TTY_DELETELINE, ny); + tty_writenum(ctx->wp, tty_cmd_deleteline, ny); return; } @@ -447,7 +447,7 @@ else grid_view_delete_lines_region(s->grid, s->rlower, s->cy, ny); - tty_writenum(ctx->wp, TTY_DELETELINE, ny); + tty_writenum(ctx->wp, tty_cmd_deleteline, ny); } /* Clear line at cursor. */ @@ -460,7 +460,7 @@ grid_view_clear(s->grid, 0, s->cy, screen_size_x(s), 1); - tty_writenum(ctx->wp, TTY_CLEARLINE, 0); + tty_write0(ctx->wp, tty_cmd_clearline); } /* Clear to end of line from cursor. */ @@ -477,7 +477,7 @@ if (s->cx <= sx - 1) grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1); - tty_writenum(ctx->wp, TTY_CLEARENDOFLINE, 0); + tty_write0(ctx->wp, tty_cmd_clearendofline); } /* Clear to start of line from cursor. */ @@ -496,7 +496,7 @@ else grid_view_clear(s->grid, 0, s->cy, s->cx + 1, 1); - tty_writenum(ctx->wp, TTY_CLEARSTARTOFLINE, 0); + tty_write0(ctx->wp, tty_cmd_clearstartofline); } /* Move cursor to px,py. */ @@ -539,7 +539,7 @@ else if (s->cy > 0) s->cy--; - tty_writenum(ctx->wp, TTY_REVERSEINDEX, 0); + tty_write0(ctx->wp, tty_cmd_reverseindex); } /* Set scroll region. */ @@ -601,7 +601,7 @@ else if (s->cy < screen_size_y(s) - 1) s->cy++; - tty_writenum(ctx->wp, TTY_LINEFEED, 0); + tty_write0(ctx->wp, tty_cmd_linefeed); } /* Carriage return (cursor to start of line). */ @@ -653,7 +653,7 @@ grid_view_clear(s->grid, s->cx, s->cy, sx - s->cx, 1); grid_view_clear(s->grid, 0, s->cy + 1, sx, sy - (s->cy + 1)); - tty_writenum(ctx->wp, TTY_CLEARENDOFSCREEN, 0); + tty_write0(ctx->wp, tty_cmd_clearendofscreen); } /* Clear to start of screen. */ @@ -674,7 +674,7 @@ else grid_view_clear(s->grid, 0, s->cy, s->cx + 1, 1); - tty_writenum(ctx->wp, TTY_CLEARSTARTOFSCREEN, 0); + tty_write0(ctx->wp, tty_cmd_clearstartofscreen); } /* Clear entire screen. */ @@ -687,7 +687,7 @@ grid_view_clear(s->grid, 0, 0, screen_size_x(s), screen_size_y(s)); - tty_writenum(ctx->wp, TTY_CLEARSCREEN, 0); + tty_write0(ctx->wp, tty_cmd_clearscreen); } /* Write cell data. */ @@ -737,7 +737,7 @@ memcpy(tmp_gu->data + i, udata, UTF8_SIZE - i); /* Assume the previous character has just been input. */ - tty_writeptr(ctx->wp, TTY_UTF8CHARACTER, udata); + tty_writeptr(ctx->wp, tty_cmd_utf8character, udata); return; } @@ -790,16 +790,16 @@ /* Draw to the screen if necessary. */ if (insert) - tty_writenum(ctx->wp, TTY_INSERTCHARACTER, width); + tty_writenum(ctx->wp, tty_cmd_insertcharacter, width); ttyctx.wp = ctx->wp; ttyctx.utf8 = &gu; if (screen_check_selection(s, s->cx - width, s->cy)) { s->sel.cell.data = gc->data; ttyctx.cell = &s->sel.cell; - tty_write_cmd(TTY_CELL, &ttyctx); + tty_write(tty_cmd_cell, &ttyctx); } else { ttyctx.cell = gc; - tty_write_cmd(TTY_CELL, &ttyctx); + tty_write(tty_cmd_cell, &ttyctx); } }