terminal: add page handling for terminals

System Internals / systemd - David Herrmann [gmail.com] - 18 July 2014 05:53 UTC

The page-layer is a one-dimensional array of lines. Combined with the one-dimensional lines, you get a two-dimensional page. However, both implementations, lines and pages only deal with their own dimension. That means, lines don't know anything about other lines, and pages don't know anything about cells.

Apart from pages, this also introduces history objects. A history object is a scroll-back buffer. As some pages like alt-buffers don't have histories, we keep them separate.

Pages itself forward all cell-related operations to the related line. Only line-related operations are directly handled by the page. This is mostly scrolling and history. To support proper resizing, we also keep a fill-state just like lines do for cells.

28622e8 terminal: add page handling for terminals
src/libsystemd-terminal/term-internal.h | 82 +++
src/libsystemd-terminal/term-page.c | 954 +++++++++++++++++++++++++++++++
2 files changed, 1036 insertions(+)

Upstream: github.com


  • Share