summaryrefslogtreecommitdiff
path: root/src/kernel/ui/vt.h
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-18 13:09:28 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-18 13:09:28 +0200
commitf56aa2f7e4b8e6430e123f714507032a33955a09 (patch)
tree0381e4cbff6e5e856a3218d811da22fa12c97fcf /src/kernel/ui/vt.h
parentf3e03796652b792bb3fd5d3d25b687b9a7f14633 (diff)
downloadTCE-f56aa2f7e4b8e6430e123f714507032a33955a09.tar.gz
TCE-f56aa2f7e4b8e6430e123f714507032a33955a09.zip
The keyboard handling, it's getting better. + Funny screenshot.
Diffstat (limited to 'src/kernel/ui/vt.h')
-rw-r--r--src/kernel/ui/vt.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/kernel/ui/vt.h b/src/kernel/ui/vt.h
index ebafe5f..b26e95a 100644
--- a/src/kernel/ui/vt.h
+++ b/src/kernel/ui/vt.h
@@ -3,6 +3,9 @@
#include <vfs/node.h>
#include <dev/display.h>
+#include <dev/keyboard.h>
+
+#define KBD_BUFFER_SIZE 256
struct vt_char {
int ch;
@@ -18,15 +21,21 @@ class vt : public node {
void put_at(int l, int c, int ch);
bool cursor_visible;
+ int kbd_buffer_filled;
+ char kbd_buffer[KBD_BUFFER_SIZE];
+ thread *kbd_waiter;
+
public:
uint8_t fgcolor, bgcolor;
vt(node* parent, int w, int h);
+ virtual ~vt() {}
+ virtual vt* as_vt() { return this; }
// internal use
void put(int c);
void clear();
- void writeStr(char* str);
+ void writeStr(char* str) { write(0, strlen(str), str); }
void writeHex(uint32_t v);
void writeDec(int v);
// shortcuts
@@ -35,10 +44,13 @@ class vt : public node {
vt& operator<< (int i) { writeDec(i); return *this; }
- int outputTo(display *display);
+ void outputTo(display *display);
+ void keyboardInput(keypress kp);
virtual int write(size_t offset, size_t len, char* buffer);
+ virtual int read(size_t offset, size_t len, char* buffer); // get keyboard input
virtual size_t get_size();
+ virtual int link(node* to, int mode);
};
extern vt *ke_vt;