forked from enlightenment/terminology
termpty: handle DECERA
This commit is contained in:
parent
9f72ea3a9d
commit
bbfa60120e
|
@ -825,21 +825,17 @@ bad:
|
||||||
ty->termstate.bottom_margin = 0;
|
ty->termstate.bottom_margin = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
_handle_esc_csi_decfra(Termpty *ty, Eina_Unicode **b)
|
_clean_up_rect_coordinates(Termpty *ty,
|
||||||
|
int *top_ptr,
|
||||||
|
int *left_ptr,
|
||||||
|
int *bottom_ptr,
|
||||||
|
int *right_ptr)
|
||||||
{
|
{
|
||||||
int c = _csi_arg_get(b);
|
int top = *top_ptr;
|
||||||
|
int left = *left_ptr;
|
||||||
int top = _csi_arg_get(b);
|
int bottom = *bottom_ptr;
|
||||||
int left = _csi_arg_get(b);
|
int right = *right_ptr;
|
||||||
int bottom = _csi_arg_get(b);
|
|
||||||
int right = _csi_arg_get(b);
|
|
||||||
int len;
|
|
||||||
|
|
||||||
DBG("DECFRA (%d; %d;%d;%d;%d) Fill Rectangular Area",
|
|
||||||
c, top, left, bottom, right);
|
|
||||||
if (! ((c >= 32 && c <= 126) || (c >= 160 && c <= 255)))
|
|
||||||
return;
|
|
||||||
|
|
||||||
TERMPTY_RESTRICT_FIELD(top, 1, ty->h);
|
TERMPTY_RESTRICT_FIELD(top, 1, ty->h);
|
||||||
top--;
|
top--;
|
||||||
|
@ -871,6 +867,33 @@ _handle_esc_csi_decfra(Termpty *ty, Eina_Unicode **b)
|
||||||
bottom--;
|
bottom--;
|
||||||
|
|
||||||
if ((bottom < top) || (right < left))
|
if ((bottom < top) || (right < left))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
*top_ptr = top;
|
||||||
|
*left_ptr = left;
|
||||||
|
*bottom_ptr = bottom;
|
||||||
|
*right_ptr = right;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_handle_esc_csi_decfra(Termpty *ty, Eina_Unicode **b)
|
||||||
|
{
|
||||||
|
int c = _csi_arg_get(b);
|
||||||
|
|
||||||
|
int top = _csi_arg_get(b);
|
||||||
|
int left = _csi_arg_get(b);
|
||||||
|
int bottom = _csi_arg_get(b);
|
||||||
|
int right = _csi_arg_get(b);
|
||||||
|
int len;
|
||||||
|
|
||||||
|
DBG("DECFRA (%d; %d;%d;%d;%d) Fill Rectangular Area",
|
||||||
|
c, top, left, bottom, right);
|
||||||
|
if (! ((c >= 32 && c <= 126) || (c >= 160 && c <= 255)))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_clean_up_rect_coordinates(ty, &top, &left, &bottom, &right) < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
len = right - left;
|
len = right - left;
|
||||||
|
@ -882,6 +905,29 @@ _handle_esc_csi_decfra(Termpty *ty, Eina_Unicode **b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_handle_esc_csi_decera(Termpty *ty, Eina_Unicode **b)
|
||||||
|
{
|
||||||
|
int top = _csi_arg_get(b);
|
||||||
|
int left = _csi_arg_get(b);
|
||||||
|
int bottom = _csi_arg_get(b);
|
||||||
|
int right = _csi_arg_get(b);
|
||||||
|
int len;
|
||||||
|
|
||||||
|
DBG("DECERA (%d;%d;%d;%d) Erase Rectangular Area",
|
||||||
|
top, left, bottom, right);
|
||||||
|
|
||||||
|
if (_clean_up_rect_coordinates(ty, &top, &left, &bottom, &right) < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
len = right - left;
|
||||||
|
for (; top <= bottom; top++)
|
||||||
|
{
|
||||||
|
Termcell *cells = &(TERMPTY_SCREEN(ty, left, top));
|
||||||
|
termpty_cells_clear(ty, cells, len);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_handle_esc_csi_cursor_pos_set(Termpty *ty, Eina_Unicode **b,
|
_handle_esc_csi_cursor_pos_set(Termpty *ty, Eina_Unicode **b,
|
||||||
const Eina_Unicode *cc)
|
const Eina_Unicode *cc)
|
||||||
|
@ -1296,6 +1342,9 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
|
||||||
TERMPTY_RESTRICT_FIELD(ty->cursor_state.cx, 0, ty->w);
|
TERMPTY_RESTRICT_FIELD(ty->cursor_state.cx, 0, ty->w);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'z':
|
||||||
|
_handle_esc_csi_decera(ty, &b);
|
||||||
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
arg = _csi_arg_get(&b);
|
arg = _csi_arg_get(&b);
|
||||||
TERMPTY_RESTRICT_FIELD(arg, 1, ty->w);
|
TERMPTY_RESTRICT_FIELD(arg, 1, ty->w);
|
||||||
|
|
Loading…
Reference in New Issue