00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef HISTORY_H
00027 #define HISTORY_H
00028
00029 #include "common.h"
00030
00031
00032
00033
00034 class HistoryBuffer
00035 {
00036 public:
00037 HistoryBuffer();
00038 ~HistoryBuffer();
00039
00040 public:
00041 void setScroll(bool on);
00042 bool hasScroll();
00043
00044 public:
00045 void add(const unsigned char* bytes, int len);
00046 void get(unsigned char* bytes, int len, int loc);
00047 int len();
00048
00049 private:
00050 int ion;
00051 int length;
00052 };
00053
00054 class HistoryScroll
00055 {
00056 public:
00057 HistoryScroll();
00058 ~HistoryScroll();
00059
00060 public:
00061 void setScroll(bool on);
00062 bool hasScroll();
00063
00064 public:
00065 int getLines();
00066 int getLineLen(int lineno);
00067 void getCells(int lineno, int colno, int count, Character res[]);
00068
00069 public:
00070 Character getCell(int lineno, int colno) { Character res; getCells(lineno,colno,1,&res); return res; }
00071
00072 public:
00073 void addCells(Character a[], int count);
00074 void addLine();
00075
00076 private:
00077 int startOfLine(int lineno);
00078 HistoryBuffer index;
00079 HistoryBuffer cells;
00080 };
00081
00082 #endif // HISTORY_H