X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibsystemd-terminal%2Fterm-internal.h;h=8c6a00188c34ccb17ab14e187d5f1f38ce51d019;hb=b762fbd128480426d225596b18604a45042339c5;hp=f0f4432c800380a694bf0e52c8d8b06769b03957;hpb=a30f1425133d2b64a1c3f0113a710528872a3cbb;p=elogind.git diff --git a/src/libsystemd-terminal/term-internal.h b/src/libsystemd-terminal/term-internal.h index f0f4432c8..8c6a00188 100644 --- a/src/libsystemd-terminal/term-internal.h +++ b/src/libsystemd-terminal/term-internal.h @@ -37,6 +37,7 @@ typedef struct term_page term_page; typedef struct term_history term_history; typedef uint32_t term_charset[96]; +typedef struct term_state term_state; /* * Miscellaneous @@ -471,7 +472,7 @@ enum { TERM_CMD_VPR, /* vertical-line-position-relative */ TERM_CMD_VT, /* vertical-tab */ TERM_CMD_XTERM_CLLHP, /* xterm-cursor-lower-left-hp-bugfix */ - TERM_CMD_XTERM_IHMT, /* xterm-initiate-highlight-mouse-tracking*/ + TERM_CMD_XTERM_IHMT, /* xterm-initiate-highlight-mouse-tracking */ TERM_CMD_XTERM_MLHP, /* xterm-memory-lock-hp-bugfix */ TERM_CMD_XTERM_MUHP, /* xterm-memory-unlock-hp-bugfix */ TERM_CMD_XTERM_RPM, /* xterm-restore-private-mode */ @@ -582,15 +583,13 @@ struct term_parser { */ enum { - TERM_FLAG_7BIT_MODE = (1U << 0), /* 7bit mode (default: off) */ + TERM_FLAG_7BIT_MODE = (1U << 0), /* 7bit mode (default: on) */ TERM_FLAG_HIDE_CURSOR = (1U << 1), /* hide cursor caret (default: off) */ TERM_FLAG_INHIBIT_TPARM = (1U << 2), /* do not send TPARM unrequested (default: off) */ TERM_FLAG_NEWLINE_MODE = (1U << 3), /* perform carriage-return on line-feeds (default: off) */ - TERM_FLAG_ORIGIN_MODE = (1U << 4), /* in origin mode, the cursor is bound by the margins (default: off) */ - TERM_FLAG_PENDING_WRAP = (1U << 5), /* wrap-around is pending */ - TERM_FLAG_AUTO_WRAP = (1U << 6), /* auto-wrap mode causes line-wraps at line-ends (default: off) */ - TERM_FLAG_KEYPAD_MODE = (1U << 7), /* application-keypad mode (default: off) */ - TERM_FLAG_CURSOR_KEYS = (1U << 8), /* enable application cursor-keys (default: off) */ + TERM_FLAG_PENDING_WRAP = (1U << 4), /* wrap-around is pending */ + TERM_FLAG_KEYPAD_MODE = (1U << 5), /* application-keypad mode (default: off) */ + TERM_FLAG_CURSOR_KEYS = (1U << 6), /* enable application cursor-keys (default: off) */ }; enum { @@ -600,6 +599,19 @@ enum { TERM_CONFORMANCE_LEVEL_CNT, }; +struct term_state { + unsigned int cursor_x; + unsigned int cursor_y; + term_attr attr; + term_charset **gl; + term_charset **gr; + term_charset **glt; + term_charset **grt; + + bool auto_wrap : 1; + bool origin_mode : 1; +}; + struct term_screen { unsigned long ref; term_age_t age; @@ -623,15 +635,8 @@ struct term_screen { unsigned int flags; unsigned int conformance_level; - unsigned int cursor_x; - unsigned int cursor_y; - term_attr attr; term_attr default_attr; - term_charset **gl; - term_charset **gr; - term_charset **glt; - term_charset **grt; term_charset *g0; term_charset *g1; term_charset *g2; @@ -639,14 +644,7 @@ struct term_screen { char *answerback; - struct { - unsigned int cursor_x; - unsigned int cursor_y; - term_attr attr; - term_charset **gl; - term_charset **gr; - term_charset **glt; - term_charset **grt; - unsigned int flags; - } saved; + term_state state; + term_state saved; + term_state saved_alt; };