rename a bunch of _termpty_*() to termpty_*()

This commit is contained in:
Boris Faure 2015-06-01 22:52:07 +02:00
parent 9ecda225b8
commit c86b35309c
4 changed files with 82 additions and 76 deletions

View File

@ -307,7 +307,7 @@ termpty_new(const char *cmd, Eina_Bool login_shell, const char *cd,
ty->h = h; ty->h = h;
ty->backmax = backscroll; ty->backmax = backscroll;
_termpty_reset_state(ty); termpty_reset_state(ty);
ty->screen = calloc(1, sizeof(Termcell) * ty->w * ty->h); ty->screen = calloc(1, sizeof(Termcell) * ty->w * ty->h);
if (!ty->screen) if (!ty->screen)

View File

@ -91,7 +91,7 @@ _handle_cursor_control(Termpty *ty, const Eina_Unicode *cc)
ty->termstate.wrapnext = 0; ty->termstate.wrapnext = 0;
if (ty->termstate.crlf) ty->cursor_state.cx = 0; if (ty->termstate.crlf) ty->cursor_state.cx = 0;
ty->cursor_state.cy++; ty->cursor_state.cy++;
_termpty_text_scroll_test(ty, EINA_TRUE); termpty_text_scroll_test(ty, EINA_TRUE);
return; return;
case 0x0d: // CR '\r' (carriage ret) case 0x0d: // CR '\r' (carriage ret)
DBG("->CR"); DBG("->CR");
@ -119,7 +119,7 @@ _switch_to_alternative_screen(Termpty *ty, int mode)
// clear main buf before we swap it back // clear main buf before we swap it back
// into the screen2 save (so save is // into the screen2 save (so save is
// clear) // clear)
_termpty_clear_all(ty); termpty_clear_all(ty);
} }
// swap screen content now // swap screen content now
if (mode != ty->altbuf) if (mode != ty->altbuf)
@ -170,8 +170,8 @@ _handle_esc_csi_reset_mode(Termpty *ty, Eina_Unicode cc, Eina_Unicode *b)
4 + ty->h * h); 4 + ty->h * h);
termpty_resize(ty, mode ? 132 : 80, termpty_resize(ty, mode ? 132 : 80,
ty->h); ty->h);
_termpty_reset_state(ty); termpty_reset_state(ty);
_termpty_clear_screen(ty, termpty_clear_screen(ty,
TERMPTY_CLR_ALL); TERMPTY_CLR_ALL);
} }
#endif #endif
@ -312,7 +312,7 @@ _handle_esc_csi_reset_mode(Termpty *ty, Eina_Unicode cc, Eina_Unicode *b)
break; break;
case 1048: case 1048:
case 1049: case 1049:
_termpty_cursor_copy(ty, mode); termpty_cursor_copy(ty, mode);
if (arg == 1049) if (arg == 1049)
_switch_to_alternative_screen(ty, mode); _switch_to_alternative_screen(ty, mode);
break; break;
@ -378,14 +378,14 @@ _handle_esc_csi_color_set(Termpty *ty, Eina_Unicode **ptr)
{ {
int arg = _csi_arg_get(&b); int arg = _csi_arg_get(&b);
if ((first) && (!b)) if ((first) && (!b))
_termpty_reset_att(&(ty->termstate.att)); termpty_reset_att(&(ty->termstate.att));
else if (b) else if (b)
{ {
first = 0; first = 0;
switch (arg) switch (arg)
{ {
case 0: // reset to normal case 0: // reset to normal
_termpty_reset_att(&(ty->termstate.att)); termpty_reset_att(&(ty->termstate.att));
break; break;
case 1: // bold/bright case 1: // bold/bright
ty->termstate.att.bold = 1; ty->termstate.att.bold = 1;
@ -679,7 +679,7 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
ty->termstate.wrapnext = 0; ty->termstate.wrapnext = 0;
ty->termstate.insert = 1; ty->termstate.insert = 1;
for (i = 0; i < arg; i++) for (i = 0; i < arg; i++)
_termpty_text_append(ty, blank, 1); termpty_text_append(ty, blank, 1);
ty->termstate.insert = pi; ty->termstate.insert = pi;
ty->cursor_state.cx = cx; ty->cursor_state.cx = cx;
} }
@ -793,19 +793,21 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
arg = _csi_arg_get(&b); arg = _csi_arg_get(&b);
if (arg < 1) arg = 1; if (arg < 1) arg = 1;
DBG("erase %d chars", arg); DBG("erase %d chars", arg);
_termpty_clear_line(ty, TERMPTY_CLR_END, arg); termpty_clear_line(ty, TERMPTY_CLR_END, arg);
break; break;
case 'S': // scroll up N lines case 'S': // scroll up N lines
arg = _csi_arg_get(&b); arg = _csi_arg_get(&b);
if (arg < 1) arg = 1; if (arg < 1) arg = 1;
DBG("scroll up %d lines", arg); DBG("scroll up %d lines", arg);
for (i = 0; i < arg; i++) _termpty_text_scroll(ty, EINA_TRUE); for (i = 0; i < arg; i++)
termpty_text_scroll(ty, EINA_TRUE);
break; break;
case 'T': // scroll down N lines case 'T': // scroll down N lines
arg = _csi_arg_get(&b); arg = _csi_arg_get(&b);
if (arg < 1) arg = 1; if (arg < 1) arg = 1;
DBG("scroll down %d lines", arg); DBG("scroll down %d lines", arg);
for (i = 0; i < arg; i++) _termpty_text_scroll_rev(ty, EINA_TRUE); for (i = 0; i < arg; i++)
termpty_text_scroll_rev(ty, EINA_TRUE);
break; break;
case 'M': // delete N lines - cy case 'M': // delete N lines - cy
case 'L': // insert N lines - cy case 'L': // insert N lines - cy
@ -830,8 +832,10 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
} }
for (i = 0; i < arg; i++) for (i = 0; i < arg; i++)
{ {
if (*cc == 'M') _termpty_text_scroll(ty, EINA_TRUE); if (*cc == 'M')
else _termpty_text_scroll_rev(ty, EINA_TRUE); termpty_text_scroll(ty, EINA_TRUE);
else
termpty_text_scroll_rev(ty, EINA_TRUE);
} }
ty->termstate.scroll_y1 = sy1; ty->termstate.scroll_y1 = sy1;
ty->termstate.scroll_y2 = sy2; ty->termstate.scroll_y2 = sy2;
@ -899,11 +903,12 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
if (b) if (b)
{ {
if ((arg >= TERMPTY_CLR_END) && (arg <= TERMPTY_CLR_ALL)) if ((arg >= TERMPTY_CLR_END) && (arg <= TERMPTY_CLR_ALL))
_termpty_clear_screen(ty, arg); termpty_clear_screen(ty, arg);
else else
ERR("invalid clr scr %i", arg); ERR("invalid clr scr %i", arg);
} }
else _termpty_clear_screen(ty, TERMPTY_CLR_END); else
termpty_clear_screen(ty, TERMPTY_CLR_END);
break; break;
case 'K': // 0K erase to end of line, 1K erase from screen start to cursor, 2K erase all of line case 'K': // 0K erase to end of line, 1K erase from screen start to cursor, 2K erase all of line
arg = _csi_arg_get(&b); arg = _csi_arg_get(&b);
@ -911,11 +916,11 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
if (b) if (b)
{ {
if ((arg >= TERMPTY_CLR_END) && (arg <= TERMPTY_CLR_ALL)) if ((arg >= TERMPTY_CLR_END) && (arg <= TERMPTY_CLR_ALL))
_termpty_clear_line(ty, arg, ty->w); termpty_clear_line(ty, arg, ty->w);
else else
ERR("invalid clr lin %i", arg); ERR("invalid clr lin %i", arg);
} }
else _termpty_clear_line(ty, TERMPTY_CLR_END, ty->w); else termpty_clear_line(ty, TERMPTY_CLR_END, ty->w);
break; break;
case 'h': case 'h':
case 'l': case 'l':
@ -963,16 +968,16 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
} }
break; break;
case 's': // store cursor pos case 's': // store cursor pos
_termpty_cursor_copy(ty, EINA_TRUE); termpty_cursor_copy(ty, EINA_TRUE);
break; break;
case 'u': // restore cursor pos case 'u': // restore cursor pos
_termpty_cursor_copy(ty, EINA_FALSE); termpty_cursor_copy(ty, EINA_FALSE);
break; break;
case 'p': // define key assignments based on keycode case 'p': // define key assignments based on keycode
if (b && *b == '!') if (b && *b == '!')
{ {
DBG("soft reset (DECSTR)"); DBG("soft reset (DECSTR)");
_termpty_reset_state(ty); termpty_reset_state(ty);
} }
else else
{ {
@ -1564,26 +1569,26 @@ _handle_esc(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
case 'M': // move to prev line case 'M': // move to prev line
ty->termstate.wrapnext = 0; ty->termstate.wrapnext = 0;
ty->cursor_state.cy--; ty->cursor_state.cy--;
_termpty_text_scroll_rev_test(ty, EINA_TRUE); termpty_text_scroll_rev_test(ty, EINA_TRUE);
return 1; return 1;
case 'D': // move to next line case 'D': // move to next line
ty->termstate.wrapnext = 0; ty->termstate.wrapnext = 0;
ty->cursor_state.cy++; ty->cursor_state.cy++;
_termpty_text_scroll_test(ty, EINA_FALSE); termpty_text_scroll_test(ty, EINA_FALSE);
return 1; return 1;
case 'E': // add \n\r case 'E': // add \n\r
ty->termstate.wrapnext = 0; ty->termstate.wrapnext = 0;
ty->cursor_state.cx = 0; ty->cursor_state.cx = 0;
ty->cursor_state.cy++; ty->cursor_state.cy++;
_termpty_text_scroll_test(ty, EINA_FALSE); termpty_text_scroll_test(ty, EINA_FALSE);
return 1; return 1;
case 'Z': // same a 'ESC [ Pn c' case 'Z': // same a 'ESC [ Pn c'
_term_txt_write(ty, "\033[?1;2C"); _term_txt_write(ty, "\033[?1;2C");
return 1; return 1;
case 'c': // reset terminal to initial state case 'c': // reset terminal to initial state
DBG("reset to init mode and clear"); DBG("reset to init mode and clear");
_termpty_reset_state(ty); termpty_reset_state(ty);
_termpty_clear_screen(ty, TERMPTY_CLR_ALL); termpty_clear_screen(ty, TERMPTY_CLR_ALL);
if (ty->cb.cancel_sel.func) if (ty->cb.cancel_sel.func)
ty->cb.cancel_sel.func(ty->cb.cancel_sel.data); ty->cb.cancel_sel.func(ty->cb.cancel_sel.data);
return 1; return 1;
@ -1621,8 +1626,8 @@ _handle_esc(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
Termcell *cells; Termcell *cells;
DBG("reset to init mode and clear then fill with E"); DBG("reset to init mode and clear then fill with E");
_termpty_reset_state(ty); termpty_reset_state(ty);
_termpty_clear_screen(ty, TERMPTY_CLR_ALL); termpty_clear_screen(ty, TERMPTY_CLR_ALL);
if (ty->cb.cancel_sel.func) if (ty->cb.cancel_sel.func)
ty->cb.cancel_sel.func(ty->cb.cancel_sel.data); ty->cb.cancel_sel.func(ty->cb.cancel_sel.data);
cells = ty->screen; cells = ty->screen;
@ -1640,10 +1645,10 @@ _handle_esc(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
if (len < 2) return 0; if (len < 2) return 0;
return 2; return 2;
case '7': // save cursor pos case '7': // save cursor pos
_termpty_cursor_copy(ty, EINA_TRUE); termpty_cursor_copy(ty, EINA_TRUE);
return 1; return 1;
case '8': // restore cursor pos case '8': // restore cursor pos
_termpty_cursor_copy(ty, EINA_FALSE); termpty_cursor_copy(ty, EINA_FALSE);
return 1; return 1;
case 'H': // set tab at current column case 'H': // set tab at current column
DBG("Character Tabulation Set (HTS)"); DBG("Character Tabulation Set (HTS)");
@ -1808,7 +1813,7 @@ termpty_handle_seq(Termpty *ty, Eina_Unicode *c, Eina_Unicode *ce)
ex->y++; ex->y++;
} }
ex->left--; ex->left--;
_termpty_text_append(ty, &cp, 1); termpty_text_append(ty, &cp, 1);
if (ex->left <= 0) if (ex->left <= 0)
{ {
ty->block.expecting = ty->block.expecting =
@ -1821,7 +1826,7 @@ termpty_handle_seq(Termpty *ty, Eina_Unicode *c, Eina_Unicode *ce)
return 1; return 1;
} }
} }
_termpty_text_append(ty, c, 1); termpty_text_append(ty, c, 1);
return 1; return 1;
} }
else else
@ -1837,7 +1842,7 @@ termpty_handle_seq(Termpty *ty, Eina_Unicode *c, Eina_Unicode *ce)
len++; len++;
} }
DBG("]"); DBG("]");
_termpty_text_append(ty, c, len); termpty_text_append(ty, c, len);
ty->termstate.had_cr = 0; ty->termstate.had_cr = 0;
return len; return len;
} }

View File

@ -20,14 +20,14 @@
#define INF(...) EINA_LOG_DOM_INFO(_termpty_log_dom, __VA_ARGS__) #define INF(...) EINA_LOG_DOM_INFO(_termpty_log_dom, __VA_ARGS__)
#define DBG(...) EINA_LOG_DOM_DBG(_termpty_log_dom, __VA_ARGS__) #define DBG(...) EINA_LOG_DOM_DBG(_termpty_log_dom, __VA_ARGS__)
static void void
_text_clear(Termpty *ty, Termcell *cells, int count, int val, Eina_Bool inherit_att) termpty_cells_clear(Termpty *ty, Termcell *cells, int count)
{ {
Termcell src; Termcell src;
memset(&src, 0, sizeof(src)); memset(&src, 0, sizeof(src));
src.codepoint = val; src.codepoint = 0;
if (inherit_att) src.att = ty->termstate.att; src.att = ty->termstate.att;
termpty_cell_fill(ty, &src, cells, count); termpty_cell_fill(ty, &src, cells, count);
} }
@ -60,7 +60,7 @@ termpty_text_save_top(Termpty *ty, Termcell *cells, ssize_t w_max)
} }
void void
_termpty_text_scroll(Termpty *ty, Eina_Bool clear) termpty_text_scroll(Termpty *ty, Eina_Bool clear)
{ {
Termcell *cells = NULL, *cells2; Termcell *cells = NULL, *cells2;
int y, start_y = 0, end_y = ty->h - 1; int y, start_y = 0, end_y = ty->h - 1;
@ -82,7 +82,7 @@ _termpty_text_scroll(Termpty *ty, Eina_Bool clear)
// screen is a circular buffer now // screen is a circular buffer now
cells = &(ty->screen[ty->circular_offset * ty->w]); cells = &(ty->screen[ty->circular_offset * ty->w]);
if (clear) if (clear)
_text_clear(ty, cells, ty->w, 0, EINA_TRUE); termpty_cells_clear(ty, cells, ty->w);
ty->circular_offset++; ty->circular_offset++;
if (ty->circular_offset >= ty->h) if (ty->circular_offset >= ty->h)
@ -98,12 +98,12 @@ _termpty_text_scroll(Termpty *ty, Eina_Bool clear)
termpty_cell_copy(ty, cells, cells2, ty->w); termpty_cell_copy(ty, cells, cells2, ty->w);
} }
if (clear) if (clear)
_text_clear(ty, cells, ty->w, 0, EINA_TRUE); termpty_cells_clear(ty, cells, ty->w);
} }
} }
void void
_termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear) termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear)
{ {
Termcell *cells, *cells2 = NULL; Termcell *cells, *cells2 = NULL;
int y, start_y = 0, end_y = ty->h - 1; int y, start_y = 0, end_y = ty->h - 1;
@ -125,7 +125,7 @@ _termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear)
cells = &(ty->screen[ty->circular_offset * ty->w]); cells = &(ty->screen[ty->circular_offset * ty->w]);
if (clear) if (clear)
_text_clear(ty, cells, ty->w, 0, EINA_TRUE); termpty_cells_clear(ty, cells, ty->w);
} }
else else
{ {
@ -137,38 +137,38 @@ _termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear)
termpty_cell_copy(ty, cells, cells2, ty->w); termpty_cell_copy(ty, cells, cells2, ty->w);
} }
if (clear) if (clear)
_text_clear(ty, cells, ty->w, 0, EINA_TRUE); termpty_cells_clear(ty, cells, ty->w);
} }
} }
void void
_termpty_text_scroll_test(Termpty *ty, Eina_Bool clear) termpty_text_scroll_test(Termpty *ty, Eina_Bool clear)
{ {
int e = ty->h; int e = ty->h;
if (ty->termstate.scroll_y2 != 0) e = ty->termstate.scroll_y2; if (ty->termstate.scroll_y2 != 0) e = ty->termstate.scroll_y2;
if (ty->cursor_state.cy >= e) if (ty->cursor_state.cy >= e)
{ {
_termpty_text_scroll(ty, clear); termpty_text_scroll(ty, clear);
ty->cursor_state.cy = e - 1; ty->cursor_state.cy = e - 1;
} }
} }
void void
_termpty_text_scroll_rev_test(Termpty *ty, Eina_Bool clear) termpty_text_scroll_rev_test(Termpty *ty, Eina_Bool clear)
{ {
int b = 0; int b = 0;
if (ty->termstate.scroll_y1 != 0) b = ty->termstate.scroll_y1; if (ty->termstate.scroll_y1 != 0) b = ty->termstate.scroll_y1;
if (ty->cursor_state.cy < b) if (ty->cursor_state.cy < b)
{ {
_termpty_text_scroll_rev(ty, clear); termpty_text_scroll_rev(ty, clear);
ty->cursor_state.cy = b; ty->cursor_state.cy = b;
} }
} }
void void
_termpty_text_append(Termpty *ty, const Eina_Unicode *codepoints, int len) termpty_text_append(Termpty *ty, const Eina_Unicode *codepoints, int len)
{ {
Termcell *cells; Termcell *cells;
int i, j; int i, j;
@ -186,7 +186,7 @@ _termpty_text_append(Termpty *ty, const Eina_Unicode *codepoints, int len)
ty->termstate.wrapnext = 0; ty->termstate.wrapnext = 0;
ty->cursor_state.cx = 0; ty->cursor_state.cx = 0;
ty->cursor_state.cy++; ty->cursor_state.cy++;
_termpty_text_scroll_test(ty, EINA_TRUE); termpty_text_scroll_test(ty, EINA_TRUE);
cells = &(TERMPTY_SCREEN(ty, 0, ty->cursor_state.cy)); cells = &(TERMPTY_SCREEN(ty, 0, ty->cursor_state.cy));
} }
if (ty->termstate.insert) if (ty->termstate.insert)
@ -242,7 +242,7 @@ _termpty_text_append(Termpty *ty, const Eina_Unicode *codepoints, int len)
} }
void void
_termpty_clear_line(Termpty *ty, Termpty_Clear mode, int limit) termpty_clear_line(Termpty *ty, Termpty_Clear mode, int limit)
{ {
Termcell *cells; Termcell *cells;
int n = 0; int n = 0;
@ -266,18 +266,18 @@ _termpty_clear_line(Termpty *ty, Termpty_Clear mode, int limit)
cells = &(TERMPTY_SCREEN(ty, x, y)); cells = &(TERMPTY_SCREEN(ty, x, y));
if (n > limit) n = limit; if (n > limit) n = limit;
termio_content_change(ty->obj, x, y, n); termio_content_change(ty->obj, x, y, n);
_text_clear(ty, cells, n, 0, EINA_TRUE); termpty_cells_clear(ty, cells, n);
} }
void void
_termpty_clear_screen(Termpty *ty, Termpty_Clear mode) termpty_clear_screen(Termpty *ty, Termpty_Clear mode)
{ {
Termcell *cells; Termcell *cells;
switch (mode) switch (mode)
{ {
case TERMPTY_CLR_END: case TERMPTY_CLR_END:
_termpty_clear_line(ty, mode, ty->w); termpty_clear_line(ty, mode, ty->w);
if (ty->cursor_state.cy < (ty->h - 1)) if (ty->cursor_state.cy < (ty->h - 1))
{ {
int l = ty->h - (ty->cursor_state.cy + 1); int l = ty->h - (ty->cursor_state.cy + 1);
@ -287,7 +287,7 @@ _termpty_clear_screen(Termpty *ty, Termpty_Clear mode)
while (l) while (l)
{ {
cells = &(TERMPTY_SCREEN(ty, 0, (ty->cursor_state.cy + l))); cells = &(TERMPTY_SCREEN(ty, 0, (ty->cursor_state.cy + l)));
_text_clear(ty, cells, ty->w, 0, EINA_TRUE); termpty_cells_clear(ty, cells, ty->w);
l--; l--;
} }
} }
@ -304,22 +304,22 @@ _termpty_clear_screen(Termpty *ty, Termpty_Clear mode)
if (y < ty->h) if (y < ty->h)
{ {
_text_clear(ty, cells, ty->w * ty->cursor_state.cy, 0, EINA_TRUE); termpty_cells_clear(ty, cells, ty->w * ty->cursor_state.cy);
} }
else else
{ {
int yt = y % ty->w; int yt = y % ty->w;
int yb = ty->h - ty->circular_offset; int yb = ty->h - ty->circular_offset;
_text_clear(ty, cells, ty->w * yb, 0, EINA_TRUE); termpty_cells_clear(ty, cells, ty->w * yb);
_text_clear(ty, ty->screen, ty->w * yt, 0, EINA_TRUE); termpty_cells_clear(ty, ty->screen, ty->w * yt);
} }
} }
_termpty_clear_line(ty, mode, ty->w); termpty_clear_line(ty, mode, ty->w);
break; break;
case TERMPTY_CLR_ALL: case TERMPTY_CLR_ALL:
ty->circular_offset = 0; ty->circular_offset = 0;
_text_clear(ty, ty->screen, ty->w * ty->h, 0, EINA_TRUE); termpty_cells_clear(ty, ty->screen, ty->w * ty->h);
ty->termstate.scroll_y2 = 0; ty->termstate.scroll_y2 = 0;
if (ty->cb.cancel_sel.func) if (ty->cb.cancel_sel.func)
ty->cb.cancel_sel.func(ty->cb.cancel_sel.data); ty->cb.cancel_sel.func(ty->cb.cancel_sel.data);
@ -330,14 +330,14 @@ _termpty_clear_screen(Termpty *ty, Termpty_Clear mode)
} }
void void
_termpty_clear_all(Termpty *ty) termpty_clear_all(Termpty *ty)
{ {
if (!ty->screen) return; if (!ty->screen) return;
termpty_cell_fill(ty, NULL, ty->screen, ty->w * ty->h); termpty_cell_fill(ty, NULL, ty->screen, ty->w * ty->h);
} }
void void
_termpty_reset_att(Termatt *att) termpty_reset_att(Termatt *att)
{ {
att->fg = COL_DEF; att->fg = COL_DEF;
att->bg = COL_DEF; att->bg = COL_DEF;
@ -365,7 +365,7 @@ _termpty_reset_att(Termatt *att)
} }
void void
_termpty_reset_state(Termpty *ty) termpty_reset_state(Termpty *ty)
{ {
ty->cursor_state.cx = 0; ty->cursor_state.cx = 0;
ty->cursor_state.cy = 0; ty->cursor_state.cy = 0;
@ -373,7 +373,7 @@ _termpty_reset_state(Termpty *ty)
ty->termstate.scroll_y2 = 0; ty->termstate.scroll_y2 = 0;
ty->termstate.had_cr_x = 0; ty->termstate.had_cr_x = 0;
ty->termstate.had_cr_y = 0; ty->termstate.had_cr_y = 0;
_termpty_reset_att(&(ty->termstate.att)); termpty_reset_att(&(ty->termstate.att));
ty->termstate.charset = 0; ty->termstate.charset = 0;
ty->termstate.charsetch = 'B'; ty->termstate.charsetch = 'B';
ty->termstate.chset[0] = 'B'; ty->termstate.chset[0] = 'B';
@ -416,7 +416,7 @@ _termpty_reset_state(Termpty *ty)
} }
void void
_termpty_cursor_copy(Termpty *ty, Eina_Bool save) termpty_cursor_copy(Termpty *ty, Eina_Bool save)
{ {
if (save) if (save)
{ {

View File

@ -9,18 +9,19 @@ typedef enum _Termpty_Clear
} Termpty_Clear; } Termpty_Clear;
void termpty_text_save_top(Termpty *ty, Termcell *cells, ssize_t w_max); void termpty_text_save_top(Termpty *ty, Termcell *cells, ssize_t w_max);
void _termpty_text_copy(Termpty *ty, Termcell *cells, Termcell *dest, int count); void termpty_cells_copy(Termpty *ty, Termcell *cells, Termcell *dest, int count);
void _termpty_text_scroll(Termpty *ty, Eina_Bool clear); void termpty_cells_clear(Termpty *ty, Termcell *cells, int count);
void _termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear); void termpty_text_scroll(Termpty *ty, Eina_Bool clear);
void _termpty_text_scroll_test(Termpty *ty, Eina_Bool clear); void termpty_text_scroll_rev(Termpty *ty, Eina_Bool clear);
void _termpty_text_scroll_rev_test(Termpty *ty, Eina_Bool clear); void termpty_text_scroll_test(Termpty *ty, Eina_Bool clear);
void _termpty_text_append(Termpty *ty, const Eina_Unicode *codepoints, int len); void termpty_text_scroll_rev_test(Termpty *ty, Eina_Bool clear);
void _termpty_clear_line(Termpty *ty, Termpty_Clear mode, int limit); void termpty_text_append(Termpty *ty, const Eina_Unicode *codepoints, int len);
void _termpty_clear_screen(Termpty *ty, Termpty_Clear mode); void termpty_clear_line(Termpty *ty, Termpty_Clear mode, int limit);
void _termpty_clear_all(Termpty *ty); void termpty_clear_screen(Termpty *ty, Termpty_Clear mode);
void _termpty_reset_att(Termatt *att); void termpty_clear_all(Termpty *ty);
void _termpty_reset_state(Termpty *ty); void termpty_reset_att(Termatt *att);
void _termpty_cursor_copy(Termpty *ty, Eina_Bool save); void termpty_reset_state(Termpty *ty);
void termpty_cursor_copy(Termpty *ty, Eina_Bool save);
#define _term_txt_write(ty, txt) termpty_write(ty, txt, sizeof(txt) - 1) #define _term_txt_write(ty, txt) termpty_write(ty, txt, sizeof(txt) - 1)