summaryrefslogtreecommitdiffstats
path: root/input.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-11-24 23:29:49 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-11-24 23:29:49 +0000
commit15511cb41a3fc12ba627aa792ba871d64a7a860d (patch)
tree821c52df3983e4b28a1f836fa92c150b66329a16 /input.c
parent08f8740da73e1800cce0f65682b6ee08d8b4132e (diff)
Support for VT100 graphics mode. Also lose some redundant checks.
Diffstat (limited to 'input.c')
-rw-r--r--input.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/input.c b/input.c
index d363703f..fee4dd04 100644
--- a/input.c
+++ b/input.c
@@ -1,4 +1,4 @@
-/* $Id: input.c,v 1.37 2007-11-24 19:29:55 nicm Exp $ */
+/* $Id: input.c,v 1.38 2007-11-24 23:29:49 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -419,10 +419,21 @@ input_handle_c0_control(u_char ch, struct input_ctx *ictx)
s->cx = 0;
screen_display_cursor_down(s);
}
- if (!screen_hidden(s)) {
- input_store_two(
- ictx->b, CODE_CURSORMOVE, s->cy + 1, s->cx + 1);
- }
+ if (screen_hidden(s))
+ return;
+ input_store_two(ictx->b, CODE_CURSORMOVE, s->cy + 1, s->cx + 1);
+ return;
+ case '\016': /* SO */
+ s->attr |= ATTR_DRAWING;
+ if (screen_hidden(s))
+ return;
+ input_store_two(ictx->b, CODE_ATTRIBUTES, s->attr, s->colr);
+ return;
+ case '\017': /* SI */
+ s->attr &= ~ATTR_DRAWING;
+ if (screen_hidden(s))
+ return;
+ input_store_two(ictx->b, CODE_ATTRIBUTES, s->attr, s->colr);
return;
default:
log_debug("unknown c0: %hhu", ch);
@@ -481,12 +492,10 @@ input_handle_private_two(u_char ch, struct input_ctx *ictx)
s->cy = s->saved_cy;
s->attr = s->saved_attr;
s->colr = s->saved_colr;
- if (!screen_hidden(s)) {
- input_store_two(
- ictx->b, CODE_ATTRIBUTES, s->attr, s->colr);
- input_store_two(
- ictx->b, CODE_CURSORMOVE, s->cy + 1, s->cx + 1);
- }
+ if (screen_hidden(s))
+ break;
+ input_store_two(ictx->b, CODE_ATTRIBUTES, s->attr, s->colr);
+ input_store_two(ictx->b, CODE_CURSORMOVE, s->cy + 1, s->cx + 1);
break;
default:
log_debug("unknown p2: %hhu", ch);