Diffstat (limited to 'noncore/apps/opie-console/history.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/history.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/history.h b/noncore/apps/opie-console/history.h new file mode 100644 index 0000000..aa77ebb --- a/dev/null +++ b/noncore/apps/opie-console/history.h | |||
@@ -0,0 +1,82 @@ | |||
1 | /* -------------------------------------------------------------------------- */ | ||
2 | /* */ | ||
3 | /* [history.h] History Buffer */ | ||
4 | /* */ | ||
5 | /* -------------------------------------------------------------------------- */ | ||
6 | /* */ | ||
7 | /* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */ | ||
8 | /* */ | ||
9 | /* This file is part of Konsole - an X terminal for KDE */ | ||
10 | /* */ | ||
11 | /* -------------------------------------------------------------------------- */ | ||
12 | /* */ | ||
13 | /* */ | ||
14 | /* Ported Konsole to Qt/Embedded */ | ||
15 | /* */ | ||
16 | /* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */ | ||
17 | /* */ | ||
18 | /* -------------------------------------------------------------------------- */ | ||
19 | /* */ | ||
20 | /* ported embedded_konsole to opie-console */ | ||
21 | /* */ | ||
22 | /* Copyright (C) 2002 by opie developers <opie@handhelds.org> */ | ||
23 | /* */ | ||
24 | /* -------------------------------------------------------------------------- */ | ||
25 | |||
26 | #ifndef HISTORY_H | ||
27 | #define HISTORY_H | ||
28 | |||
29 | #include "common.h" | ||
30 | |||
31 | /* | ||
32 | An extendable tmpfile(1) based buffer. | ||
33 | */ | ||
34 | class HistoryBuffer | ||
35 | { | ||
36 | public: | ||
37 | HistoryBuffer(); | ||
38 | ~HistoryBuffer(); | ||
39 | |||
40 | public: | ||
41 | void setScroll(bool on); | ||
42 | bool hasScroll(); | ||
43 | |||
44 | public: | ||
45 | void add(const unsigned char* bytes, int len); | ||
46 | void get(unsigned char* bytes, int len, int loc); | ||
47 | int len(); | ||
48 | |||
49 | private: | ||
50 | int ion; | ||
51 | int length; | ||
52 | }; | ||
53 | |||
54 | class HistoryScroll | ||
55 | { | ||
56 | public: | ||
57 | HistoryScroll(); | ||
58 | ~HistoryScroll(); | ||
59 | |||
60 | public: | ||
61 | void setScroll(bool on); | ||
62 | bool hasScroll(); | ||
63 | |||
64 | public: // access to history | ||
65 | int getLines(); | ||
66 | int getLineLen(int lineno); | ||
67 | void getCells(int lineno, int colno, int count, Character res[]); | ||
68 | |||
69 | public: // backward compatibility (obsolete) | ||
70 | Character getCell(int lineno, int colno) { Character res; getCells(lineno,colno,1,&res); return res; } | ||
71 | |||
72 | public: // adding lines. | ||
73 | void addCells(Character a[], int count); | ||
74 | void addLine(); | ||
75 | |||
76 | private: | ||
77 | int startOfLine(int lineno); | ||
78 | HistoryBuffer index; // lines Row(int) | ||
79 | HistoryBuffer cells; // text Row(Character) | ||
80 | }; | ||
81 | |||
82 | #endif // HISTORY_H | ||