summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/history.h
authoribotty <ibotty>2002-10-05 21:19:16 (UTC)
committer ibotty <ibotty>2002-10-05 21:19:16 (UTC)
commit6e217b24b1eb09d922e35dc5126fa5ec578915b8 (patch) (side-by-side diff)
tree478d1018936e5846ed916263c27d856f886290b8 /noncore/apps/opie-console/history.h
parent76feb33042f707be87763308eb76dd8c9fd1bd62 (diff)
downloadopie-6e217b24b1eb09d922e35dc5126fa5ec578915b8.zip
opie-6e217b24b1eb09d922e35dc5126fa5ec578915b8.tar.gz
opie-6e217b24b1eb09d922e35dc5126fa5ec578915b8.tar.bz2
initial commit
to get something started (and increase my stats ;)
Diffstat (limited to 'noncore/apps/opie-console/history.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/history.h82
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 @@
+/* -------------------------------------------------------------------------- */
+/* */
+/* [history.h] History Buffer */
+/* */
+/* -------------------------------------------------------------------------- */
+/* */
+/* Copyright (c) 1997,1998 by Lars Doelle <lars.doelle@on-line.de> */
+/* */
+/* This file is part of Konsole - an X terminal for KDE */
+/* */
+/* -------------------------------------------------------------------------- */
+/* */
+/* */
+/* Ported Konsole to Qt/Embedded */
+/* */
+/* Copyright (C) 2000 by John Ryland <jryland@trolltech.com> */
+/* */
+/* -------------------------------------------------------------------------- */
+/* */
+/* ported embedded_konsole to opie-console */
+/* */
+/* Copyright (C) 2002 by opie developers <opie@handhelds.org> */
+/* */
+/* -------------------------------------------------------------------------- */
+
+#ifndef HISTORY_H
+#define HISTORY_H
+
+#include "common.h"
+
+/*
+ An extendable tmpfile(1) based buffer.
+*/
+class HistoryBuffer
+{
+public:
+ HistoryBuffer();
+ ~HistoryBuffer();
+
+public:
+ void setScroll(bool on);
+ bool hasScroll();
+
+public:
+ void add(const unsigned char* bytes, int len);
+ void get(unsigned char* bytes, int len, int loc);
+ int len();
+
+private:
+ int ion;
+ int length;
+};
+
+class HistoryScroll
+{
+public:
+ HistoryScroll();
+ ~HistoryScroll();
+
+public:
+ void setScroll(bool on);
+ bool hasScroll();
+
+public: // access to history
+ int getLines();
+ int getLineLen(int lineno);
+ void getCells(int lineno, int colno, int count, Character res[]);
+
+public: // backward compatibility (obsolete)
+ Character getCell(int lineno, int colno) { Character res; getCells(lineno,colno,1,&res); return res; }
+
+public: // adding lines.
+ void addCells(Character a[], int count);
+ void addLine();
+
+private:
+ int startOfLine(int lineno);
+ HistoryBuffer index; // lines Row(int)
+ HistoryBuffer cells; // text Row(Character)
+};
+
+#endif // HISTORY_H