version 1.6, 2009/06/04 14:42:14 |
version 1.7, 2009/06/04 18:48:24 |
|
|
void input_handle_sequence_hpa(struct input_ctx *); |
void input_handle_sequence_hpa(struct input_ctx *); |
void input_handle_sequence_cup(struct input_ctx *); |
void input_handle_sequence_cup(struct input_ctx *); |
void input_handle_sequence_cup(struct input_ctx *); |
void input_handle_sequence_cup(struct input_ctx *); |
|
void input_handle_sequence_tbc(struct input_ctx *); |
void input_handle_sequence_ed(struct input_ctx *); |
void input_handle_sequence_ed(struct input_ctx *); |
void input_handle_sequence_el(struct input_ctx *); |
void input_handle_sequence_el(struct input_ctx *); |
void input_handle_sequence_sm(struct input_ctx *); |
void input_handle_sequence_sm(struct input_ctx *); |
|
|
{ 'P', input_handle_sequence_dch }, |
{ 'P', input_handle_sequence_dch }, |
{ 'd', input_handle_sequence_vpa }, |
{ 'd', input_handle_sequence_vpa }, |
{ 'f', input_handle_sequence_cup }, |
{ 'f', input_handle_sequence_cup }, |
|
{ 'g', input_handle_sequence_tbc }, |
{ 'h', input_handle_sequence_sm }, |
{ 'h', input_handle_sequence_sm }, |
{ 'l', input_handle_sequence_rm }, |
{ 'l', input_handle_sequence_rm }, |
{ 'm', input_handle_sequence_sgr }, |
{ 'm', input_handle_sequence_sgr }, |
|
|
screen_write_cursorleft(&ictx->ctx, 1); |
screen_write_cursorleft(&ictx->ctx, 1); |
break; |
break; |
case '\011': /* TAB */ |
case '\011': /* TAB */ |
s->cx = ((s->cx / 8) * 8) + 8; |
/* Don't tab beyond the end of the line. */ |
if (s->cx > screen_size_x(s) - 1) { |
if (s->cx >= screen_size_x(s) - 1) |
s->cx = 0; |
break; |
screen_write_cursordown(&ictx->ctx, 1); |
|
} |
/* Find the next tab point, or use the last column if none. */ |
screen_write_cursormove(&ictx->ctx, s->cx, s->cy); |
do { |
|
s->cx++; |
|
if (bit_test(s->tabs, s->cx)) |
|
break; |
|
} while (s->cx < screen_size_x(s) - 1); |
break; |
break; |
case '\013': /* VT */ |
case '\013': /* VT */ |
screen_write_linefeed(&ictx->ctx); |
screen_write_linefeed(&ictx->ctx); |
|
|
void |
void |
input_handle_c1_control(u_char ch, struct input_ctx *ictx) |
input_handle_c1_control(u_char ch, struct input_ctx *ictx) |
{ |
{ |
|
struct screen *s = ictx->ctx.s; |
|
|
log_debug2("-- c1 %zu: %hhu (%c)", ictx->off, ch, ch); |
log_debug2("-- c1 %zu: %hhu (%c)", ictx->off, ch, ch); |
|
|
switch (ch) { |
switch (ch) { |
|
|
screen_write_carriagereturn(&ictx->ctx); |
screen_write_carriagereturn(&ictx->ctx); |
screen_write_linefeed(&ictx->ctx); |
screen_write_linefeed(&ictx->ctx); |
break; |
break; |
|
case 'H': /* HTS */ |
|
if (s->cx < screen_size_x(s)) |
|
bit_set(s->tabs, s->cx); |
|
break; |
case 'M': /* RI */ |
case 'M': /* RI */ |
screen_write_reverseindex(&ictx->ctx); |
screen_write_reverseindex(&ictx->ctx); |
break; |
break; |
|
|
"-- s2 %zu: %hhu (%c) %hhu", ictx->off, ch, ch, ictx->intermediate); |
"-- s2 %zu: %hhu (%c) %hhu", ictx->off, ch, ch, ictx->intermediate); |
|
|
switch (ch) { |
switch (ch) { |
case 'B': /* Dscs (ASCII) */ |
case 'B': /* SCS */ |
/* |
/* |
* Not really supported, but fake it up enough for those that |
* Not really supported, but fake it up enough for those that |
* use it to switch character sets (by redefining G0 to |
* use it to switch character sets (by redefining G0 to |
|
|
ictx->saved_cx = 0; |
ictx->saved_cx = 0; |
ictx->saved_cy = 0; |
ictx->saved_cy = 0; |
|
|
|
screen_reset_tabs(ictx->ctx.s); |
|
|
screen_write_scrollregion( |
screen_write_scrollregion( |
&ictx->ctx, 0, screen_size_y(ictx->ctx.s) - 1); |
&ictx->ctx, 0, screen_size_y(ictx->ctx.s) - 1); |
|
|
|
|
m = 1; |
m = 1; |
|
|
screen_write_cursormove(&ictx->ctx, m - 1, n - 1); |
screen_write_cursormove(&ictx->ctx, m - 1, n - 1); |
|
} |
|
|
|
void |
|
input_handle_sequence_tbc(struct input_ctx *ictx) |
|
{ |
|
struct screen *s = ictx->ctx.s; |
|
uint16_t n; |
|
|
|
if (ictx->private != '\0') |
|
return; |
|
|
|
if (ARRAY_LENGTH(&ictx->args) > 1) |
|
return; |
|
if (input_get_argument(ictx, 0, &n, 1) != 0) |
|
return; |
|
|
|
switch (n) { |
|
case 0: |
|
if (s->cx < screen_size_x(s)) |
|
bit_clear(s->tabs, s->cx); |
|
break; |
|
case 3: |
|
bit_nclear(s->tabs, 0, screen_size_x(s) - 1); |
|
break; |
|
} |
} |
} |
|
|
void |
void |