mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
We have one big array of characters in scrollback, with lines of constant width -- there's no reason to have an array of pointers when offsets will do.
26 lines
386 B
C++
26 lines
386 B
C++
#pragma once
|
|
/// \file scrollback.h
|
|
|
|
class screen;
|
|
class font;
|
|
|
|
class scrollback
|
|
{
|
|
public:
|
|
scrollback(unsigned lines, unsigned cols, unsigned margin = 2);
|
|
|
|
void add_line(const char *line, size_t len);
|
|
|
|
char * get_line(unsigned i);
|
|
|
|
void render(screen &scr, font &fnt);
|
|
|
|
private:
|
|
char *m_data;
|
|
unsigned m_rows, m_cols;
|
|
unsigned m_start;
|
|
unsigned m_count;
|
|
unsigned m_margin;
|
|
};
|
|
|