/*
* $Log$
+ * Revision 1.52 2008/02/28 16:57:52 james
+ * *** empty log message ***
+ *
+ * Revision 1.51 2008/02/28 16:37:16 james
+ * *** empty log message ***
+ *
+ * Revision 1.50 2008/02/28 12:12:25 james
+ * *** empty log message ***
+ *
* Revision 1.49 2008/02/28 11:27:48 james
* *** empty log message ***
*
return 1;
}
-void vt102_do_resize(Context *c)
+void
+vt102_crt_update (Context * c)
{
+ VT102 *v = c->v;
-VT102 *v=c->v;
+ v->crt.pos = v->pos;
+ v->crt.hide_cursor =
+ v->private_modes[VT102_PRIVATE_MODE_SHOW_CURSOR] ? 0 : 1;
- v->crt.size = v->current_size;
- v->crt.size.y++;
- v->screen_end = v->current_size;
- v->screen_end.x--;
- v->screen_end.y--;
- v->top_margin = v->screen_start;
- v->bottom_margin = v->screen_end;
- vt102_cursor_home (v);
- crt_cls (&v->crt);
+ if (v->current_line.y != v->pos.y)
+ {
+ vt102_log_line (c, v->current_line.y);
+ v->current_line = v->pos;
+ }
- if (c->t)
- tty_winch(c->t,v->current_size);
+ if (c->d)
+ cmd_show_status (c->d, c);
+}
+
+void
+vt102_do_resize (Context * c)
+{
+
+ VT102 *v = c->v;
+
+ v->crt.size = v->current_size;
+ v->crt.size.y++;
+ v->screen_end = v->current_size;
+ v->screen_end.x--;
+ v->screen_end.y--;
+ v->top_margin = v->screen_start;
+ v->bottom_margin = v->screen_end;
+ vt102_cursor_home (v);
+ crt_cls (&v->crt);
+
+ if (c->t)
+ tty_winch (c->t, v->current_size);
+
+ log_f (c->l, "<size now %dx%d>", v->current_size.x, v->current_size.y);
+ vt102_crt_update (c);
}
void
-vt102_change_mode (Context *c, int private, char *ns, int set)
+vt102_change_mode (Context * c, int private, char *ns, int set)
{
- VT102 *v=c->v;
+ VT102 *v = c->v;
int m;
private_modes[VT102_PRIVATE_MODE_132COLS] ? VT102_COLS_132 :
VT102_COLS_80;
- vt102_do_resize(c);
+ vt102_do_resize (c);
break;
}
}
void
-vt102_parse_mode_string (Context *c, char *buf, int len)
+vt102_parse_mode_string (Context * c, char *buf, int len)
{
- VT102 *v=c->v;
+ VT102 *v = c->v;
int private = 0;
char last = buf[len - 1];
char num[4];
void
-vt102_reset_state (Context *c)
+vt102_reset_state (Context * c)
{
- VT102 *v=c->v;
+ VT102 *v = c->v;
vt102_parser_reset (&v->parser);
v->attr = CRT_ATTR_NORMAL;
v->current_size = v->original_size;
- vt102_do_resize(c);
+ vt102_do_resize (c);
memset (v->modes, 0, VT102_NMODES);
memset (v->private_modes, 0, VT102_NMODES);
#endif
}
- v->crt.pos = v->pos;
- v->crt.hide_cursor =
- v->private_modes[VT102_PRIVATE_MODE_SHOW_CURSOR] ? 0 : 1;
+ vt102_crt_update (c);
- if (v->current_line.y != v->pos.y)
- {
- vt102_log_line (c, v->current_line.y);
- v->current_line = v->pos;
- }
- if (c->d)
- cmd_show_status (c->d, c);
}
void
void
vt102_reset (Context * c)
{
- VT102 *v=c->v;
+ VT102 *v = c->v;
VT102_parser *p = &v->parser;
if (v->original_size.x > VT102_MAX_COLS)
v->original_size.x = VT102_MAX_COLS;
- if (v->original_size.y > VT102_ROWS)
- v->original_size.y = VT102_ROWS;
+ if (v->original_size.y > VT102_MAX_ROWS)
+ v->original_size.y = VT102_MAX_ROWS;
}
else
{
v->original_size.x = VT102_COLS_80;
- v->original_size.y = VT102_ROWS;
+ v->original_size.y = VT102_ROWS_24;
}
return v;
v->xn_glitch = ansi ? 0 : 1;
}
-void vt102_resize(Context *c,CRT_Pos size)
+void
+vt102_resize (Context * c, CRT_Pos size)
{
+ log_f (c->l, "<size change to %dx%d requested>", size.x, size.y);
+ if (!size.x)
+ size.x = c->v->current_size.x;
+ if (!size.y)
+ size.y = c->v->current_size.y;
- if (size.x < 1)
- size.x = 1;
- if (size.y < 1)
- size.y = 1;
+ if (size.x < 1)
+ size.x = 1;
+ if (size.y < 1)
+ size.y = 1;
- if (size.x > VT102_MAX_COLS)
- size.x = VT102_MAX_COLS;
- if (size.y > VT102_ROWS)
- size.y = VT102_ROWS;
+ if (size.x > VT102_MAX_COLS)
+ size.x = VT102_MAX_COLS;
+ if (size.y > VT102_MAX_ROWS)
+ size.y = VT102_MAX_ROWS;
- c->v->current_size=size;
- vt102_do_resize(c);
+ c->v->current_size = size;
+ vt102_do_resize (c);
}
void