LF OS
Hobby operating system for amd64 with high ambitions
|
Go to the source code of this file.
Macros | |
#define | strneq(a, b, n) (strncmp(a,b,n)==0) |
#define | NO_FORCE 0 |
#define | FORCE 1 |
#define | DWL_OFF 0 |
#define | DWL_ON 1 |
#define | DHL_OFF 0 |
#define | DHL_TOP 1 |
#define | DHL_BOTTOM 2 |
#define | LBOUND(v, min) if((v) < (min)) (v) = (min) |
#define | UBOUND(v, max) if((v) > (max)) (v) = (max) |
#define | LEADER(l, b) ((l << 8) | b) |
#define | INTERMED(i, b) ((i << 16) | b) |
Variables | |
static const VTermParserCallbacks | parser_callbacks |
#define INTERMED | ( | i, | |
b | |||
) | ((i << 16) | b) |
#define LBOUND | ( | v, | |
min | |||
) | if((v) < (min)) (v) = (min) |
#define LEADER | ( | l, | |
b | |||
) | ((l << 8) | b) |
#define UBOUND | ( | v, | |
max | |||
) | if((v) > (max)) (v) = (max) |
|
static |
|
static |
Definition at line 193 of file state.c.
References state, and VTermState::tabstops.
|
static |
Definition at line 44 of file state.c.
References VTermState::callbacks, VTermState::cbdata, VTermState::cols, VTermLineInfo::continuation, VTermRect::end_col, VTermRect::end_row, VTermStateCallbacks::erase, VTermState::lineinfo, VTermState::rows, VTermRect::start_row, and state.
|
static |
Definition at line 174 of file state.c.
References VTermState::combine_chars, VTermState::combine_chars_size, memcpy(), state, VTermState::vt, vterm_allocator_free(), and vterm_allocator_malloc().
|
static |
Definition at line 199 of file state.c.
References state, and VTermState::tabstops.
|
static |
Definition at line 205 of file state.c.
References VTermPos::col, VTermState::pos, VTermPos::row, SCROLLREGION_BOTTOM, SCROLLREGION_LEFT, SCROLLREGION_RIGHT, VTermState::scrollregion_top, and state.
|
static |
Definition at line 158 of file state.c.
References VTermState::pos, VTermPos::row, VTermState::rows, scroll(), SCROLLREGION_BOTTOM, SCROLLREGION_LEFT, SCROLLREGION_RIGHT, VTermState::scrollregion_top, VTermRect::start_row, and state.
|
static |
Definition at line 1913 of file state.c.
References VTermStateFallbacks::apc, VTermState::fallbacks, VTermState::fbdata, and state.
|
static |
Definition at line 449 of file state.c.
References VTermStateCallbacks::bell, VTermState::callbacks, VTermState::cbdata, VTermPos::col, VTermState::cols, VTermStateFallbacks::control, VTermState::fallbacks, VTermState::fbdata, VTermState::gl_set, VTermState::gsingle_set, linefeed(), VTermState::mode, VTermState::pos, VTermPos::row, VTermState::rows, scroll(), SCROLLREGION_BOTTOM, SCROLLREGION_LEFT, SCROLLREGION_RIGHT, VTermState::scrollregion_top, set_col_tabstop(), VTermRect::start_row, state, tab(), and updatecursor().
|
static |
Definition at line 926 of file state.c.
References VTermState::at_phantom, C1_CSI, VTermState::callbacks, VTermState::cbdata, clear_col_tabstop(), VTermPos::col, VTermState::cols, VTermState::combine_chars, VTermState::combine_width, VTermStateFallbacks::csi, CSI_ARG, CSI_ARG_COUNT, CSI_ARG_IS_MISSING, CSI_ARG_MISSING, CSI_ARG_OR, DHL_OFF, DWL_OFF, VTermRect::end_col, VTermRect::end_row, erase(), VTermState::fallbacks, VTermState::fbdata, FORCE, INTERMED, is_cursor_in_scrollregion(), LBOUND, LEADER, VTermState::mode, VTermState::pos, VTermState::protected_cell, putglyph(), request_dec_mode(), request_version_string(), VTermPos::row, VTermState::rows, VTermStateCallbacks::sb_clear, scroll(), VTermState::scrollregion_bottom, SCROLLREGION_BOTTOM, VTermState::scrollregion_left, SCROLLREGION_LEFT, VTermState::scrollregion_right, SCROLLREGION_RIGHT, VTermState::scrollregion_top, set_dec_mode(), set_lineinfo(), set_mode(), settermprop_bool(), settermprop_int(), VTermRect::start_col, VTermRect::start_row, state, tab(), THISROWWIDTH, UBOUND, updatecursor(), VTermState::vt, VTERM_PROP_CURSORBLINK, VTERM_PROP_CURSORSHAPE, VTERM_PROP_CURSORSHAPE_BAR_LEFT, VTERM_PROP_CURSORSHAPE_BLOCK, VTERM_PROP_CURSORSHAPE_UNDERLINE, vterm_push_output_sprintf_ctrl(), vterm_state_reset(), and vterm_state_setpen().
|
static |
Definition at line 1897 of file state.c.
References VTermStateFallbacks::dcs, DEBUG_LOG, VTermState::fallbacks, VTermState::fbdata, request_status_string(), state, and strneq.
|
static |
Definition at line 591 of file state.c.
References VTermState::callbacks, VTermState::cbdata, VTermPos::col, VTermEncodingInstance::data, DHL_BOTTOM, DHL_OFF, DHL_TOP, DWL_OFF, DWL_ON, VTermEncodingInstance::enc, ENC_SINGLE_94, VTermState::encoding, VTermState::gl_set, VTermState::gr_set, VTermEncoding::init, VTermState::mode, VTerm::mode, VTermStateCallbacks::movecursor, NO_FORCE, VTermState::pos, putglyph(), VTermPos::row, VTermState::rows, ROWWIDTH, savecursor(), set_lineinfo(), state, VTermState::vt, vterm_lookup_encoding(), and vterm_state_reset().
|
static |
Definition at line 1777 of file state.c.
References VTermState::callbacks, VTermState::fallbacks, VTermState::fbdata, VTermStateFallbacks::osc, osc_selection(), VTermState::selection, settermprop_string(), state, VTERM_PROP_ICONNAME, and VTERM_PROP_TITLE.
|
static |
Definition at line 1925 of file state.c.
References VTermState::fallbacks, VTermState::fbdata, VTermStateFallbacks::pm, and state.
|
static |
Definition at line 1949 of file state.c.
References VTermState::at_phantom, BUFIDX_ALTSCREEN, BUFIDX_PRIMARY, VTermState::callbacks, VTermState::cbdata, VTermPos::col, cols, VTermState::cols, VTermLineInfo::doublewidth, VTermState::lineinfo, VTermStateFields::lineinfos, VTermState::lineinfos, VTermState::mode, VTermStateFields::pos, VTermState::pos, VTermStateCallbacks::resize, VTermPos::row, rows, VTermState::rows, VTermState::scrollregion_bottom, VTermState::scrollregion_right, state, VTermState::tabstops, UBOUND, updatecursor(), VTermState::vt, vterm_allocator_free(), and vterm_allocator_malloc().
|
static |
Definition at line 1937 of file state.c.
References VTermState::fallbacks, VTermState::fbdata, VTermStateFallbacks::sos, and state.
|
static |
Definition at line 272 of file state.c.
References VTermState::at_phantom, VTermPos::col, VTermState::cols, VTermState::combine_chars, VTermState::combine_chars_size, VTermState::combine_pos, VTermState::combine_width, VTermLineInfo::continuation, VTermEncodingInstance::data, DEBUG_LOG, VTermEncoding::decode, VTermEncodingInstance::enc, VTermState::encoding, encoding, VTermState::encoding_utf8, VTermState::gl_set, VTermState::gr_set, grow_combine_buffer(), VTermState::gsingle_set, linefeed(), VTermState::lineinfo, VTermState::mode, VTerm::mode, VTermState::pos, putglyph(), VTermPos::row, VTermState::rows, scroll(), VTermRect::start_row, state, THISROWWIDTH, VTerm::tmpbuffer, VTerm::tmpbuffer_len, updatecursor(), VTermState::vt, VTERM_MAX_CHARS_PER_CELL, vterm_unicode_is_combining(), vterm_unicode_width(), and width.
|
static |
Definition at line 1617 of file state.c.
References VTermState::callbacks, DEBUG_LOG, VTermStringFragment::final, VTermStringFragment::initial, VTermStringFragment::len, VTermState::selection, state, VTermStringFragment::str, VTermState::tmp, unbase64one(), VTERM_SELECTION_CLIPBOARD, VTERM_SELECTION_CUT0, VTERM_SELECTION_PRIMARY, VTERM_SELECTION_SECONDARY, and VTERM_SELECTION_SELECT.
|
static |
Definition at line 14 of file state.c.
References VTermState::callbacks, VTermState::cbdata, VTermGlyphInfo::chars, VTermPos::col, DEBUG_LOG, VTermLineInfo::doubleheight, VTermLineInfo::doublewidth, info, VTermState::lineinfo, VTermState::protected_cell, VTermStateCallbacks::putglyph, VTermPos::row, state, and width.
|
static |
Definition at line 843 of file state.c.
References C1_CSI, VTermState::mode, VTermState::mouse_flags, VTermState::mouse_protocol, MOUSE_WANT_CLICK, MOUSE_WANT_DRAG, MOUSE_WANT_MOVE, num, state, VTermState::vt, and vterm_push_output_sprintf_ctrl().
|
static |
Definition at line 1810 of file state.c.
References C1_DCS, CSI_ARG, CSI_ARG_HAS_MORE, ESC_S, VTermStringFragment::final, VTermStringFragment::initial, VTermStringFragment::len, VTermState::mode, VTerm::mode, VTermState::protected_cell, SCROLLREGION_BOTTOM, SCROLLREGION_LEFT, SCROLLREGION_RIGHT, VTermState::scrollregion_top, state, VTermStringFragment::str, VTermState::tmp, VTerm::tmpbuffer, VTerm::tmpbuffer_len, vt, VTermState::vt, VTERM_PROP_CURSORSHAPE_BAR_LEFT, VTERM_PROP_CURSORSHAPE_BLOCK, VTERM_PROP_CURSORSHAPE_UNDERLINE, vterm_push_output_bytes(), vterm_push_output_sprintf_str(), and vterm_state_getpen().
|
static |
Definition at line 920 of file state.c.
References C1_DCS, state, VTermState::vt, vterm_push_output_sprintf_str(), VTERM_VERSION_MAJOR, and VTERM_VERSION_MINOR.
|
static |
Definition at line 566 of file state.c.
References VTermState::mode, VTermState::pos, VTermState::saved, settermprop_bool(), settermprop_int(), state, updatecursor(), VTERM_PROP_CURSORBLINK, VTERM_PROP_CURSORSHAPE, VTERM_PROP_CURSORVISIBLE, and vterm_state_savepen().
|
static |
Definition at line 112 of file state.c.
References VTermState::callbacks, VTermState::cbdata, cols, VTermState::cols, VTermRect::end_col, VTermRect::end_row, VTermStateCallbacks::erase, height, VTermState::lineinfo, memmove(), VTermStateCallbacks::moverect, rows, VTermStateCallbacks::scrollrect, VTermRect::start_col, VTermRect::start_row, state, and vterm_scroll_rect().
|
static |
Definition at line 187 of file state.c.
References state, and VTermState::tabstops.
|
static |
Definition at line 749 of file state.c.
References VTermPos::col, DEBUG_LOG, DHL_OFF, DWL_OFF, FORCE, VTermState::mode, VTermState::mouse_protocol, num, VTermState::pos, VTermPos::row, VTermState::rows, savecursor(), SCROLLREGION_LEFT, VTermState::scrollregion_top, set_lineinfo(), settermprop_bool(), settermprop_int(), state, updatecursor(), VTERM_PROP_ALTSCREEN, VTERM_PROP_CURSORBLINK, VTERM_PROP_CURSORVISIBLE, VTERM_PROP_FOCUSREPORT, VTERM_PROP_MOUSE, VTERM_PROP_MOUSE_CLICK, VTERM_PROP_MOUSE_DRAG, VTERM_PROP_MOUSE_MOVE, VTERM_PROP_MOUSE_NONE, and VTERM_PROP_REVERSE.
|
static |
Definition at line 248 of file state.c.
References VTermState::callbacks, VTermState::cbdata, DHL_BOTTOM, DHL_OFF, DHL_TOP, VTermLineInfo::doublewidth, DWL_OFF, DWL_ON, info, VTermState::lineinfo, VTermStateCallbacks::setlineinfo, and state.
|
static |
|
static |
Definition at line 548 of file state.c.
References VTermValue::boolean, state, and vterm_state_set_termprop().
|
static |
Definition at line 554 of file state.c.
References VTermValue::number, state, and vterm_state_set_termprop().
|
static |
Definition at line 560 of file state.c.
References state, VTermValue::string, and vterm_state_set_termprop().
|
static |
Definition at line 217 of file state.c.
References VTermPos::col, is_col_tabstop(), VTermState::pos, state, and THISROWWIDTH.
|
static |
|
static |
Definition at line 31 of file state.c.
References VTermState::at_phantom, VTermState::callbacks, VTermState::cbdata, VTermPos::col, VTermState::mode, VTermStateCallbacks::movecursor, VTermState::pos, VTermPos::row, and state.
VTermState * vterm_obtain_state | ( | VTerm * | vt | ) |
Definition at line 2059 of file state.c.
References parser_callbacks, VTerm::state, state, vt, vterm_parser_set_callbacks(), and vterm_state_new().
void vterm_state_focus_in | ( | VTermState * | state | ) |
Definition at line 2239 of file state.c.
References C1_CSI, VTermState::mode, state, VTermState::vt, and vterm_push_output_sprintf_ctrl().
void vterm_state_focus_out | ( | VTermState * | state | ) |
Definition at line 2245 of file state.c.
References C1_CSI, VTermState::mode, state, VTermState::vt, and vterm_push_output_sprintf_ctrl().
INTERNAL void vterm_state_free | ( | VTermState * | state | ) |
Definition at line 102 of file state.c.
References BUFIDX_ALTSCREEN, BUFIDX_PRIMARY, VTermState::combine_chars, VTermState::lineinfos, state, VTermState::tabstops, VTermState::vt, and vterm_allocator_free().
void * vterm_state_get_cbdata | ( | VTermState * | state | ) |
Definition at line 2159 of file state.c.
References VTermState::cbdata, and state.
void vterm_state_get_cursorpos | ( | const VTermState * | state, |
VTermPos * | cursorpos | ||
) |
Definition at line 2139 of file state.c.
References VTermState::pos, and state.
const VTermLineInfo * vterm_state_get_lineinfo | ( | const VTermState * | state, |
int | row | ||
) |
Definition at line 2251 of file state.c.
References VTermState::lineinfo, and state.
void * vterm_state_get_unrecognised_fbdata | ( | VTermState * | state | ) |
Definition at line 2176 of file state.c.
References VTermState::fbdata, and state.
|
static |
Definition at line 59 of file state.c.
References VTermState::bold_is_highbright, BUFIDX_ALTSCREEN, BUFIDX_PRIMARY, VTermState::callbacks, VTermState::cbdata, VTermState::cols, VTerm::cols, VTermState::combine_chars, VTermState::combine_chars_size, VTermEncodingInstance::data, VTermEncodingInstance::enc, ENC_UTF8, VTermState::encoding_utf8, VTermEncoding::init, VTermState::lineinfo, VTermState::lineinfos, VTermState::mouse_buttons, VTermState::mouse_col, VTermState::mouse_protocol, VTermState::mouse_row, VTermState::rows, VTerm::rows, VTermState::selection, state, VTermState::tabstops, vt, VTermState::vt, vterm_allocator_malloc(), vterm_lookup_encoding(), and vterm_state_newpen().
void vterm_state_reset | ( | VTermState * | state, |
int | hard | ||
) |
Definition at line 2072 of file state.c.
References VTermState::at_phantom, VTermState::callbacks, VTermState::cbdata, clear_col_tabstop(), VTermPos::col, VTermState::cols, VTermEncodingInstance::data, DHL_OFF, DWL_OFF, VTermEncodingInstance::enc, ENC_SINGLE_94, ENC_UTF8, VTermState::encoding, erase(), FORCE, VTermState::gl_set, VTermState::gr_set, VTermState::gsingle_set, VTermEncoding::init, VTermStateCallbacks::initpen, VTermState::mode, VTerm::mode, VTermState::mouse_flags, VTermState::pos, VTermState::protected_cell, VTermPos::row, VTermState::rows, VTermState::scrollregion_bottom, VTermState::scrollregion_left, VTermState::scrollregion_right, VTermState::scrollregion_top, set_col_tabstop(), set_lineinfo(), settermprop_bool(), settermprop_int(), state, VTermState::vt, vterm_lookup_encoding(), VTERM_PROP_CURSORBLINK, VTERM_PROP_CURSORSHAPE, VTERM_PROP_CURSORSHAPE_BLOCK, VTERM_PROP_CURSORVISIBLE, and vterm_state_resetpen().
void vterm_state_send_selection | ( | VTermState * | state, |
VTermSelectionMask | mask, | ||
VTermStringFragment | frag | ||
) |
Definition at line 2268 of file state.c.
References base64_one(), C1_OSC, VTermStringFragment::final, VTermStringFragment::initial, VTermStringFragment::len, VTermState::selection, state, VTermStringFragment::str, VTermState::tmp, vt, VTermState::vt, vterm_push_output_bytes(), and vterm_push_output_sprintf_str().
void vterm_state_set_callbacks | ( | VTermState * | state, |
const VTermStateCallbacks * | callbacks, | ||
void * | user | ||
) |
Definition at line 2144 of file state.c.
References VTermState::callbacks, VTermState::cbdata, VTermStateCallbacks::initpen, and state.
void vterm_state_set_selection_callbacks | ( | VTermState * | state, |
const VTermSelectionCallbacks * | callbacks, | ||
void * | user, | ||
char * | buffer, | ||
size_t | buflen | ||
) |
Definition at line 2256 of file state.c.
References VTermState::callbacks, VTermState::selection, state, VTermState::vt, and vterm_allocator_malloc().
int vterm_state_set_termprop | ( | VTermState * | state, |
VTermProp | prop, | ||
VTermValue * | val | ||
) |
Definition at line 2181 of file state.c.
References VTermValue::boolean, BUFIDX_ALTSCREEN, BUFIDX_PRIMARY, VTermState::callbacks, VTermState::cbdata, VTermState::cols, erase(), VTermState::lineinfo, VTermState::lineinfos, VTermState::mode, VTermState::mouse_flags, MOUSE_WANT_CLICK, MOUSE_WANT_DRAG, MOUSE_WANT_MOVE, VTermValue::number, VTermState::rows, VTermStateCallbacks::settermprop, VTermRect::start_row, state, VTERM_N_PROPS, VTERM_PROP_ALTSCREEN, VTERM_PROP_CURSORBLINK, VTERM_PROP_CURSORSHAPE, VTERM_PROP_CURSORVISIBLE, VTERM_PROP_FOCUSREPORT, VTERM_PROP_ICONNAME, VTERM_PROP_MOUSE, VTERM_PROP_MOUSE_DRAG, VTERM_PROP_MOUSE_MOVE, VTERM_PROP_REVERSE, and VTERM_PROP_TITLE.
void vterm_state_set_unrecognised_fallbacks | ( | VTermState * | state, |
const VTermStateFallbacks * | fallbacks, | ||
void * | user | ||
) |
Definition at line 2164 of file state.c.
References VTermState::fallbacks, fallbacks, VTermState::fbdata, and state.
|
static |