screen->cmd_fn_data = cmd_fn_data;
screen->flags = TERM_FLAG_7BIT_MODE;
screen->conformance_level = TERM_CONFORMANCE_LEVEL_VT400;
- screen->gl = &screen->g0;
- screen->gr = &screen->g1;
screen->g0 = &term_unicode_lower;
screen->g1 = &term_unicode_upper;
screen->g2 = &term_unicode_lower;
screen->g3 = &term_unicode_upper;
-
- screen->saved.cursor_x = 0;
- screen->saved.cursor_y = 0;
- screen->saved.attr = screen->attr;
- screen->saved.gl = screen->gl;
- screen->saved.gr = screen->gr;
+ screen->state.gl = &screen->g0;
+ screen->state.gr = &screen->g1;
+ screen->saved = screen->state;
r = term_page_new(&screen->page_main);
if (r < 0)
static inline void screen_age_cursor(term_screen *screen) {
term_cell *cell;
- cell = term_page_get_cell(screen->page, screen->cursor_x, screen->cursor_y);
+ cell = term_page_get_cell(screen->page, screen->state.cursor_x, screen->state.cursor_y);
if (cell)
cell->age = screen->age;
}
x = screen_clamp_x(screen, x);
y = screen_clamp_y(screen, y);
- if (x == screen->cursor_x && y == screen->cursor_y)
+ if (x == screen->state.cursor_x && y == screen->state.cursor_y)
return;
if (!(screen->flags & TERM_FLAG_HIDE_CURSOR))
screen_age_cursor(screen);
- screen->cursor_x = x;
- screen->cursor_y = y;
+ screen->state.cursor_x = x;
+ screen->state.cursor_y = y;
if (!(screen->flags & TERM_FLAG_HIDE_CURSOR))
screen_age_cursor(screen);
}
static void screen_cursor_set_rel(term_screen *screen, unsigned int x, unsigned int y) {
- if (screen->flags & TERM_FLAG_ORIGIN_MODE) {
+ if (screen->state.origin_mode) {
x = screen_clamp_x(screen, x);
y = screen_clamp_x(screen, y) + screen->page->scroll_idx;
}
static void screen_cursor_left(term_screen *screen, unsigned int num) {
- if (num > screen->cursor_x)
- num = screen->cursor_x;
+ if (num > screen->state.cursor_x)
+ num = screen->state.cursor_x;
- screen_cursor_set(screen, screen->cursor_x - num, screen->cursor_y);
+ screen_cursor_set(screen, screen->state.cursor_x - num, screen->state.cursor_y);
}
static void screen_cursor_left_tab(term_screen *screen, unsigned int num) {
unsigned int i;
- i = screen->cursor_x;
+ i = screen->state.cursor_x;
while (i > 0 && num > 0) {
if (screen_tab_is_set(screen, --i))
--num;
}
- screen_cursor_set(screen, i, screen->cursor_y);
+ screen_cursor_set(screen, i, screen->state.cursor_y);
}
static void screen_cursor_right(term_screen *screen, unsigned int num) {
if (num > screen->page->width)
num = screen->page->width;
- screen_cursor_set(screen, screen->cursor_x + num, screen->cursor_y);
+ screen_cursor_set(screen, screen->state.cursor_x + num, screen->state.cursor_y);
}
static void screen_cursor_right_tab(term_screen *screen, unsigned int num) {
unsigned int i;
- i = screen->cursor_x;
+ i = screen->state.cursor_x;
while (i + 1 < screen->page->width && num > 0) {
if (screen_tab_is_set(screen, ++i))
--num;
}
- screen_cursor_set(screen, i, screen->cursor_y);
+ screen_cursor_set(screen, i, screen->state.cursor_y);
}
static void screen_cursor_up(term_screen *screen, unsigned int num, bool scroll) {
unsigned int max;
- if (screen->cursor_y < screen->page->scroll_idx) {
- if (num > screen->cursor_y)
- num = screen->cursor_y;
+ if (screen->state.cursor_y < screen->page->scroll_idx) {
+ if (num > screen->state.cursor_y)
+ num = screen->state.cursor_y;
- screen_cursor_set(screen, screen->cursor_x, screen->cursor_y - num);
+ screen_cursor_set(screen, screen->state.cursor_x, screen->state.cursor_y - num);
} else {
- max = screen->cursor_y - screen->page->scroll_idx;
+ max = screen->state.cursor_y - screen->page->scroll_idx;
if (num > max) {
if (num < 1)
return;
screen_age_cursor(screen);
if (scroll)
- term_page_scroll_down(screen->page, num - max, &screen->attr, screen->age, NULL);
+ term_page_scroll_down(screen->page, num - max, &screen->state.attr, screen->age, NULL);
- screen->cursor_y = screen->page->scroll_idx;
+ screen->state.cursor_y = screen->page->scroll_idx;
if (!(screen->flags & TERM_FLAG_HIDE_CURSOR))
screen_age_cursor(screen);
} else {
- screen_cursor_set(screen, screen->cursor_x, screen->cursor_y - num);
+ screen_cursor_set(screen, screen->state.cursor_x, screen->state.cursor_y - num);
}
}
}
static void screen_cursor_down(term_screen *screen, unsigned int num, bool scroll) {
unsigned int max;
- if (screen->cursor_y >= screen->page->scroll_idx + screen->page->scroll_num) {
+ if (screen->state.cursor_y >= screen->page->scroll_idx + screen->page->scroll_num) {
if (num > screen->page->height)
num = screen->page->height;
- screen_cursor_set(screen, screen->cursor_x, screen->cursor_y - num);
+ screen_cursor_set(screen, screen->state.cursor_x, screen->state.cursor_y - num);
} else {
- max = screen->page->scroll_idx + screen->page->scroll_num - 1 - screen->cursor_y;
+ max = screen->page->scroll_idx + screen->page->scroll_num - 1 - screen->state.cursor_y;
if (num > max) {
if (num < 1)
return;
screen_age_cursor(screen);
if (scroll)
- term_page_scroll_up(screen->page, num - max, &screen->attr, screen->age, screen->history);
+ term_page_scroll_up(screen->page, num - max, &screen->state.attr, screen->age, screen->history);
- screen->cursor_y = screen->page->scroll_idx + screen->page->scroll_num - 1;
+ screen->state.cursor_y = screen->page->scroll_idx + screen->page->scroll_num - 1;
if (!(screen->flags & TERM_FLAG_HIDE_CURSOR))
screen_age_cursor(screen);
} else {
- screen_cursor_set(screen, screen->cursor_x, screen->cursor_y + num);
+ screen_cursor_set(screen, screen->state.cursor_x, screen->state.cursor_y + num);
}
}
}
+static void screen_save_state(term_screen *screen, term_state *where) {
+ *where = screen->state;
+}
+
+static void screen_restore_state(term_screen *screen, term_state *from) {
+ screen_cursor_set(screen, from->cursor_x, from->cursor_y);
+ screen->state = *from;
+}
+
static inline void set_reset(term_screen *screen, unsigned int flag, bool set) {
if (set)
screen->flags |= flag;
* DECOM: origin-mode
* TODO
*/
- set_reset(screen, TERM_FLAG_ORIGIN_MODE, set);
+ screen->state.origin_mode = set;
}
break;
* DECAWN: auto-wrap mode
* TODO
*/
- set_reset(screen, TERM_FLAG_AUTO_WRAP, set);
+ screen->state.auto_wrap = set;
}
break;
* identity. */
switch (val) {
case 33 ... 126:
- if (screen->glt) {
- nval = (**screen->glt)[val - 32];
- screen->glt = NULL;
+ if (screen->state.glt) {
+ nval = (**screen->state.glt)[val - 32];
+ screen->state.glt = NULL;
} else {
- nval = (**screen->gl)[val - 32];
+ nval = (**screen->state.gl)[val - 32];
}
break;
case 160 ... 255:
- if (screen->grt) {
- nval = (**screen->grt)[val - 160];
- screen->grt = NULL;
+ if (screen->state.grt) {
+ nval = (**screen->state.grt)[val - 160];
+ screen->state.grt = NULL;
} else {
- nval = (**screen->gr)[val - 160];
+ nval = (**screen->state.gr)[val - 160];
}
break;
}
term_char_t ch = TERM_CHAR_NULL;
uint32_t c;
- if (screen->cursor_x + 1 == screen->page->width
+ if (screen->state.cursor_x + 1 == screen->page->width
&& screen->flags & TERM_FLAG_PENDING_WRAP
- && screen->flags & TERM_FLAG_AUTO_WRAP) {
+ && screen->state.auto_wrap) {
screen_cursor_down(screen, 1, true);
- screen_cursor_set(screen, 0, screen->cursor_y);
+ screen_cursor_set(screen, 0, screen->state.cursor_y);
}
screen_cursor_clear_wrap(screen);
c = screen_map(screen, seq->terminator);
ch = term_char_merge(ch, screen_map(screen, c));
- term_page_write(screen->page, screen->cursor_x, screen->cursor_y, ch, 1, &screen->attr, screen->age, false);
+ term_page_write(screen->page, screen->state.cursor_x, screen->state.cursor_y, ch, 1, &screen->state.attr, screen->age, false);
- if (screen->cursor_x + 1 == screen->page->width)
+ if (screen->state.cursor_x + 1 == screen->page->width)
screen->flags |= TERM_FLAG_PENDING_WRAP;
else
screen_cursor_right(screen, 1);
pos = seq->args[0];
screen_cursor_clear_wrap(screen);
- screen_cursor_set(screen, pos - 1, screen->cursor_y);
+ screen_cursor_set(screen, pos - 1, screen->state.cursor_y);
return 0;
}
*/
screen_cursor_clear_wrap(screen);
- screen_cursor_set(screen, 0, screen->cursor_y);
+ screen_cursor_set(screen, 0, screen->state.cursor_y);
return 0;
}
num = seq->args[0];
screen_cursor_clear_wrap(screen);
- term_page_delete_cells(screen->page, screen->cursor_x, screen->cursor_y, num, &screen->attr, screen->age);
+ term_page_delete_cells(screen->page, screen->state.cursor_x, screen->state.cursor_y, num, &screen->state.attr, screen->age);
return 0;
}
* state for the main display and the status line.
*/
- screen->attr = screen->saved.attr;
- screen->gl = screen->saved.gl;
- screen->gr = screen->saved.gr;
- screen->glt = screen->saved.glt;
- screen->grt = screen->saved.grt;
- set_reset(screen, TERM_FLAG_AUTO_WRAP, screen->saved.flags & TERM_FLAG_AUTO_WRAP);
- set_reset(screen, TERM_FLAG_ORIGIN_MODE, screen->saved.flags & TERM_FLAG_ORIGIN_MODE);
- screen_cursor_set(screen, screen->saved.cursor_x, screen->saved.cursor_y);
+ screen_restore_state(screen, &screen->saved);
return 0;
}
* * Any single shift 2 (SS2) or single shift 3 (SS3) functions sent
*/
- screen->saved.cursor_x = screen->cursor_x;
- screen->saved.cursor_y = screen->cursor_y;
- screen->saved.attr = screen->attr;
- screen->saved.gl = screen->gl;
- screen->saved.gr = screen->gr;
- screen->saved.glt = screen->glt;
- screen->saved.grt = screen->grt;
- screen->saved.flags = screen->flags & (TERM_FLAG_AUTO_WRAP
- | TERM_FLAG_ORIGIN_MODE);
+ screen_save_state(screen, &screen->saved);
return 0;
}
switch (mode) {
case 0:
case 2:
- screen->attr.protect = 0;
+ screen->state.attr.protect = 0;
break;
case 1:
- screen->attr.protect = 1;
+ screen->state.attr.protect = 1;
break;
}
switch (mode) {
case 0:
term_page_erase(screen->page,
- screen->cursor_x, screen->cursor_y,
+ screen->state.cursor_x, screen->state.cursor_y,
screen->page->width, screen->page->height,
- &screen->attr, screen->age, true);
+ &screen->state.attr, screen->age, true);
break;
case 1:
term_page_erase(screen->page,
0, 0,
- screen->cursor_x, screen->cursor_y,
- &screen->attr, screen->age, true);
+ screen->state.cursor_x, screen->state.cursor_y,
+ &screen->state.attr, screen->age, true);
break;
case 2:
term_page_erase(screen->page,
0, 0,
screen->page->width, screen->page->height,
- &screen->attr, screen->age, true);
+ &screen->state.attr, screen->age, true);
break;
}
switch (mode) {
case 0:
term_page_erase(screen->page,
- screen->cursor_x, screen->cursor_y,
- screen->page->width, screen->cursor_y,
- &screen->attr, screen->age, true);
+ screen->state.cursor_x, screen->state.cursor_y,
+ screen->page->width, screen->state.cursor_y,
+ &screen->state.attr, screen->age, true);
break;
case 1:
term_page_erase(screen->page,
- 0, screen->cursor_y,
- screen->cursor_x, screen->cursor_y,
- &screen->attr, screen->age, true);
+ 0, screen->state.cursor_y,
+ screen->state.cursor_x, screen->state.cursor_y,
+ &screen->state.attr, screen->age, true);
break;
case 2:
term_page_erase(screen->page,
- 0, screen->cursor_y,
- screen->page->width, screen->cursor_y,
- &screen->attr, screen->age, true);
+ 0, screen->state.cursor_y,
+ screen->page->width, screen->state.cursor_y,
+ &screen->state.attr, screen->age, true);
break;
}
if (seq->args[0] > 0)
num = seq->args[0];
- term_page_delete_lines(screen->page, screen->cursor_y, num, &screen->attr, screen->age);
+ term_page_delete_lines(screen->page, screen->state.cursor_y, num, &screen->state.attr, screen->age);
return 0;
}
num = seq->args[0];
term_page_erase(screen->page,
- screen->cursor_x, screen->cursor_y,
- screen->cursor_x + num, screen->cursor_y,
- &screen->attr, screen->age, false);
+ screen->state.cursor_x, screen->state.cursor_y,
+ screen->state.cursor_x + num, screen->state.cursor_y,
+ &screen->state.attr, screen->age, false);
return 0;
}
switch (mode) {
case 0:
term_page_erase(screen->page,
- screen->cursor_x, screen->cursor_y,
+ screen->state.cursor_x, screen->state.cursor_y,
screen->page->width, screen->page->height,
- &screen->attr, screen->age, false);
+ &screen->state.attr, screen->age, false);
break;
case 1:
term_page_erase(screen->page,
0, 0,
- screen->cursor_x, screen->cursor_y,
- &screen->attr, screen->age, false);
+ screen->state.cursor_x, screen->state.cursor_y,
+ &screen->state.attr, screen->age, false);
break;
case 2:
term_page_erase(screen->page,
0, 0,
screen->page->width, screen->page->height,
- &screen->attr, screen->age, false);
+ &screen->state.attr, screen->age, false);
break;
}
switch (mode) {
case 0:
term_page_erase(screen->page,
- screen->cursor_x, screen->cursor_y,
- screen->page->width, screen->cursor_y,
- &screen->attr, screen->age, false);
+ screen->state.cursor_x, screen->state.cursor_y,
+ screen->page->width, screen->state.cursor_y,
+ &screen->state.attr, screen->age, false);
break;
case 1:
term_page_erase(screen->page,
- 0, screen->cursor_y,
- screen->cursor_x, screen->cursor_y,
- &screen->attr, screen->age, false);
+ 0, screen->state.cursor_y,
+ screen->state.cursor_x, screen->state.cursor_y,
+ &screen->state.attr, screen->age, false);
break;
case 2:
term_page_erase(screen->page,
- 0, screen->cursor_y,
- screen->page->width, screen->cursor_y,
- &screen->attr, screen->age, false);
+ 0, screen->state.cursor_y,
+ screen->page->width, screen->state.cursor_y,
+ &screen->state.attr, screen->age, false);
break;
}
num = seq->args[0];
screen_cursor_clear_wrap(screen);
- screen_cursor_set(screen, num - 1, screen->cursor_y);
+ screen_cursor_set(screen, num - 1, screen->state.cursor_y);
return 0;
}
unsigned int pos;
- pos = screen->cursor_x;
+ pos = screen->state.cursor_x;
if (screen->page->width > 0)
screen->tabs[pos / 8] |= 1U << (pos % 8);
num = seq->args[0];
screen_cursor_clear_wrap(screen);
- term_page_insert_cells(screen->page, screen->cursor_x, screen->cursor_y, num, &screen->attr, screen->age);
+ term_page_insert_cells(screen->page, screen->state.cursor_x, screen->state.cursor_y, num, &screen->state.attr, screen->age);
return 0;
}
num = seq->args[0];
screen_cursor_clear_wrap(screen);
- term_page_insert_lines(screen->page, screen->cursor_y, num, &screen->attr, screen->age);
+ term_page_insert_lines(screen->page, screen->state.cursor_y, num, &screen->state.attr, screen->age);
return 0;
}
screen_cursor_down(screen, 1, true);
if (screen->flags & TERM_FLAG_NEWLINE_MODE)
- screen_cursor_left(screen, screen->cursor_x);
+ screen_cursor_left(screen, screen->state.cursor_x);
return 0;
}
* Map G1 into GR.
*/
- screen->gr = &screen->g1;
+ screen->state.gr = &screen->g1;
return 0;
}
* Map G2 into GL.
*/
- screen->gl = &screen->g2;
+ screen->state.gl = &screen->g2;
return 0;
}
* Map G2 into GR.
*/
- screen->gr = &screen->g2;
+ screen->state.gr = &screen->g2;
return 0;
}
* Map G3 into GL.
*/
- screen->gl = &screen->g3;
+ screen->state.gl = &screen->g3;
return 0;
}
* Map G3 into GR.
*/
- screen->gr = &screen->g3;
+ screen->state.gr = &screen->g3;
return 0;
}
screen_cursor_clear_wrap(screen);
screen_cursor_down(screen, 1, true);
- screen_cursor_set(screen, 0, screen->cursor_y);
+ screen_cursor_set(screen, 0, screen->state.cursor_y);
return 0;
}
if (seq->args[0] > 0)
num = seq->args[0];
- term_page_scroll_down(screen->page, num, &screen->attr, screen->age, NULL);
+ term_page_scroll_down(screen->page, num, &screen->state.attr, screen->age, NULL);
return 0;
}
int v;
if (seq->n_args < 1) {
- zero(screen->attr);
+ zero(screen->state.attr);
return 0;
}
v = seq->args[i];
switch (v) {
case 1:
- screen->attr.bold = 1;
+ screen->state.attr.bold = 1;
break;
case 3:
- screen->attr.italic = 1;
+ screen->state.attr.italic = 1;
break;
case 4:
- screen->attr.underline = 1;
+ screen->state.attr.underline = 1;
break;
case 5:
- screen->attr.blink = 1;
+ screen->state.attr.blink = 1;
break;
case 7:
- screen->attr.inverse = 1;
+ screen->state.attr.inverse = 1;
break;
case 8:
- screen->attr.hidden = 1;
+ screen->state.attr.hidden = 1;
break;
case 22:
- screen->attr.bold = 0;
+ screen->state.attr.bold = 0;
break;
case 23:
- screen->attr.italic = 0;
+ screen->state.attr.italic = 0;
break;
case 24:
- screen->attr.underline = 0;
+ screen->state.attr.underline = 0;
break;
case 25:
- screen->attr.blink = 0;
+ screen->state.attr.blink = 0;
break;
case 27:
- screen->attr.inverse = 0;
+ screen->state.attr.inverse = 0;
break;
case 28:
- screen->attr.hidden = 0;
+ screen->state.attr.hidden = 0;
break;
case 30 ... 37:
- screen->attr.fg.ccode = v - 30 + TERM_CCODE_BLACK;
+ screen->state.attr.fg.ccode = v - 30 + TERM_CCODE_BLACK;
break;
case 39:
- screen->attr.fg.ccode = 0;
+ screen->state.attr.fg.ccode = 0;
break;
case 40 ... 47:
- screen->attr.bg.ccode = v - 40 + TERM_CCODE_BLACK;
+ screen->state.attr.bg.ccode = v - 40 + TERM_CCODE_BLACK;
break;
case 49:
- screen->attr.bg.ccode = 0;
+ screen->state.attr.bg.ccode = 0;
break;
case 90 ... 97:
- screen->attr.fg.ccode = v - 90 + TERM_CCODE_LIGHT_BLACK;
+ screen->state.attr.fg.ccode = v - 90 + TERM_CCODE_LIGHT_BLACK;
break;
case 100 ... 107:
- screen->attr.bg.ccode = v - 100 + TERM_CCODE_LIGHT_BLACK;
+ screen->state.attr.bg.ccode = v - 100 + TERM_CCODE_LIGHT_BLACK;
break;
case 38:
/* fallthrough */
case 48:
if (v == 38)
- dst = &screen->attr.fg;
+ dst = &screen->state.attr.fg;
else
- dst = &screen->attr.bg;
+ dst = &screen->state.attr.bg;
++i;
if (i >= seq->n_args)
case -1:
/* fallthrough */
case 0:
- zero(screen->attr);
+ zero(screen->state.attr);
break;
}
}
* Map G0 into GL.
*/
- screen->gl = &screen->g0;
+ screen->state.gl = &screen->g0;
return 0;
}
* Map G1 into GL.
*/
- screen->gl = &screen->g1;
+ screen->state.gl = &screen->g1;
return 0;
}
* Temporarily map G2 into GL for the next graphics character.
*/
- screen->glt = &screen->g2;
+ screen->state.glt = &screen->g2;
return 0;
}
* Temporarily map G3 into GL for the next graphics character
*/
- screen->glt = &screen->g3;
+ screen->state.glt = &screen->g3;
return 0;
}
if (seq->args[0] > 0)
num = seq->args[0];
- term_page_scroll_up(screen->page, num, &screen->attr, screen->age, screen->history);
+ term_page_scroll_up(screen->page, num, &screen->state.attr, screen->age, screen->history);
return 0;
}
switch (mode) {
case 0:
- pos = screen->cursor_x;
+ pos = screen->state.cursor_x;
if (screen->page->width > 0)
screen->tabs[pos / 8] &= ~(1U << (pos % 8));
break;
pos = seq->args[0];
screen_cursor_clear_wrap(screen);
- screen_cursor_set_rel(screen, screen->cursor_x, pos - 1);
+ screen_cursor_set_rel(screen, screen->state.cursor_x, pos - 1);
return 0;
}
assert_return(screen, -EINVAL);
- r = term_page_reserve(screen->page_main, x, y, &screen->attr, screen->age);
+ r = term_page_reserve(screen->page_main, x, y, &screen->state.attr, screen->age);
if (r < 0)
return r;
- r = term_page_reserve(screen->page_alt, x, y, &screen->attr, screen->age);
+ r = term_page_reserve(screen->page_alt, x, y, &screen->state.attr, screen->age);
if (r < 0)
return r;
for (i = (screen->page->width + 7) / 8 * 8; i < x; i += 8)
screen->tabs[i / 8] = 0x1;
- term_page_resize(screen->page_main, x, y, &screen->attr, screen->age, screen->history);
- term_page_resize(screen->page_alt, x, y, &screen->attr, screen->age, NULL);
+ term_page_resize(screen->page_main, x, y, &screen->state.attr, screen->age, screen->history);
+ term_page_resize(screen->page_alt, x, y, &screen->state.attr, screen->age, NULL);
- screen->cursor_x = screen_clamp_x(screen, screen->cursor_x);
- screen->cursor_y = screen_clamp_x(screen, screen->cursor_y);
+ screen->state.cursor_x = screen_clamp_x(screen, screen->state.cursor_x);
+ screen->state.cursor_y = screen_clamp_x(screen, screen->state.cursor_y);
screen_cursor_clear_wrap(screen);
return 0;
assert(screen);
- screen->gl = &screen->g0;
- screen->gr = &screen->g1;
- screen->glt = NULL;
- screen->grt = NULL;
screen->g0 = &term_unicode_lower;
screen->g1 = &term_unicode_upper;
screen->g2 = &term_unicode_lower;
screen->g3 = &term_unicode_upper;
+ screen->state.attr = screen->default_attr;
+ screen->state.gl = &screen->g0;
+ screen->state.gr = &screen->g1;
+ screen->state.glt = NULL;
+ screen->state.grt = NULL;
+ screen->state.auto_wrap = 0;
+ screen->state.origin_mode = 0;
+
+ screen->saved = screen->state;
+ screen->saved.cursor_x = 0;
+ screen->saved.cursor_y = 0;
screen->page = screen->page_main;
screen->history = screen->history_main;
screen->flags = TERM_FLAG_7BIT_MODE;
screen->conformance_level = TERM_CONFORMANCE_LEVEL_VT400;
- screen->attr = screen->default_attr;
-
- screen->saved.cursor_x = 0;
- screen->saved.cursor_y = 0;
- screen->saved.attr = screen->attr;
- screen->saved.gl = screen->gl;
- screen->saved.gr = screen->gr;
- screen->saved.glt = NULL;
- screen->saved.grt = NULL;
- screen->flags = 0;
for (i = 0; i < screen->page->width; i += 8)
screen->tabs[i / 8] = 0x1;
term_screen_soft_reset(screen);
zero(screen->utf8);
- screen->cursor_x = 0;
- screen->cursor_y = 0;
- term_page_erase(screen->page_main, 0, 0, screen->page->width, screen->page->height, &screen->attr, screen->age, false);
- term_page_erase(screen->page_alt, 0, 0, screen->page->width, screen->page->height, &screen->attr, screen->age, false);
+ screen->state.cursor_x = 0;
+ screen->state.cursor_y = 0;
+ term_page_erase(screen->page_main, 0, 0, screen->page->width, screen->page->height, &screen->state.attr, screen->age, false);
+ term_page_erase(screen->page_alt, 0, 0, screen->page->width, screen->page->height, &screen->state.attr, screen->age, false);
}
int term_screen_set_answerback(term_screen *screen, const char *answerback) {
cw = MAX(cell->cwidth, 1U);
attr = cell->attr;
- if (i == screen->cursor_x && j == screen->cursor_y &&
+ if (i == screen->state.cursor_x && j == screen->state.cursor_y &&
!(screen->flags & TERM_FLAG_HIDE_CURSOR))
attr.inverse ^= 1;