Diffstat (limited to 'core/apps/embeddedkonsole/TEHistory.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/apps/embeddedkonsole/TEHistory.h | 50 |
1 files changed, 16 insertions, 34 deletions
diff --git a/core/apps/embeddedkonsole/TEHistory.h b/core/apps/embeddedkonsole/TEHistory.h index 11eb150..fcf6496 100644 --- a/core/apps/embeddedkonsole/TEHistory.h +++ b/core/apps/embeddedkonsole/TEHistory.h | |||
@@ -18,58 +18,40 @@ | |||
18 | 18 | ||
19 | #ifndef TEHISTORY_H | 19 | #ifndef TEHISTORY_H |
20 | #define TEHISTORY_H | 20 | #define TEHISTORY_H |
21 | 21 | ||
22 | #include "TECommon.h" | 22 | #include "TECommon.h" |
23 | 23 | ||
24 | /* | ||
25 | An extendable tmpfile(1) based buffer. | ||
26 | */ | ||
27 | class HistoryBuffer | ||
28 | { | ||
29 | public: | ||
30 | HistoryBuffer(); | ||
31 | ~HistoryBuffer(); | ||
32 | |||
33 | public: | ||
34 | void setScroll(bool on); | ||
35 | bool hasScroll(); | ||
36 | |||
37 | public: | ||
38 | void add(const unsigned char* bytes, int len); | ||
39 | void get(unsigned char* bytes, int len, int loc); | ||
40 | int len(); | ||
41 | |||
42 | private: | ||
43 | int ion; | ||
44 | int length; | ||
45 | }; | ||
46 | |||
47 | class HistoryScroll | 24 | class HistoryScroll |
48 | { | 25 | { |
49 | public: | 26 | public: |
50 | HistoryScroll(); | 27 | HistoryScroll(); |
51 | ~HistoryScroll(); | 28 | ~HistoryScroll(); |
52 | 29 | ||
53 | public: | 30 | public: |
54 | void setScroll(bool on); | 31 | void setSize(int lines, int cells); |
55 | bool hasScroll(); | 32 | void setScroll(bool on); |
33 | bool hasScroll(); | ||
56 | 34 | ||
57 | public: // access to history | 35 | int getLines(); |
58 | int getLines(); | 36 | int getLineLen(int lineno); |
59 | int getLineLen(int lineno); | 37 | void getCells(int lineno, int colno, int count, ca *res); |
60 | void getCells(int lineno, int colno, int count, ca res[]); | ||
61 | 38 | ||
62 | public: // backward compatibility (obsolete) | ||
63 | ca getCell(int lineno, int colno) { ca res; getCells(lineno,colno,1,&res); return res; } | 39 | ca getCell(int lineno, int colno) { ca res; getCells(lineno,colno,1,&res); return res; } |
64 | 40 | ||
65 | public: // adding lines. | 41 | void addCells(ca *text, int count); |
66 | void addCells(ca a[], int count); | ||
67 | void addLine(); | 42 | void addLine(); |
68 | 43 | ||
69 | private: | 44 | private: |
70 | int startOfLine(int lineno); | 45 | int startOfLine(int lineno); |
71 | HistoryBuffer index; // lines Row(int) | 46 | |
72 | HistoryBuffer cells; // text Row(ca) | 47 | int m_max_lines; |
48 | int *m_lines; | ||
49 | int m_max_cells; | ||
50 | ca *m_cells; | ||
51 | int m_first_line; | ||
52 | int m_last_cell; | ||
53 | int m_num_lines; | ||
54 | int m_start_line; | ||
73 | }; | 55 | }; |
74 | 56 | ||
75 | #endif // TEHISTORY_H | 57 | #endif // TEHISTORY_H |