- Implemented first time functions.
[planlOS.git] / system / include / sys / terminal.h
blob690c7276a950382c009c63e24a96641d8b44fe6e
1 /*
2 Copyright (C) 2008 Mathias Gottschlag
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 #ifndef SYS_TERMINAL_H_INCLUDED
23 #define SYS_TERMINAL_H_INCLUDED
25 #include "fs/devfs.h"
26 #include "fs/request.h"
28 typedef struct
30 FsDeviceFile file;
31 char *inputbuffer;
32 int inputbuffer_size;
33 int inputbuffer_pos;
34 char *screendata;
35 int fgcolor;
36 int brightfg;
37 int bgcolor;
38 int x;
39 int y;
40 int echo;
41 FsRequest **requests;
42 int requestcount;
43 } SysTextTerminal;
45 typedef struct
47 FsDeviceFile file;
48 } SysGfxTerminal;
50 #define SYS_KEY_ESCAPE 256
51 #define SYS_KEY_BACKSPACE 257
52 #define SYS_KEY_LCONTROL 258
53 #define SYS_KEY_LSHIFT 259
54 #define SYS_KEY_RSHIFT 260
55 #define SYS_KEY_LALT 261
56 #define SYS_KEY_CAPS 262
57 #define SYS_KEY_F1 263
58 #define SYS_KEY_F2 264
59 #define SYS_KEY_F3 265
60 #define SYS_KEY_F4 266
61 #define SYS_KEY_F5 267
62 #define SYS_KEY_F6 268
63 #define SYS_KEY_F7 269
64 #define SYS_KEY_F8 270
65 #define SYS_KEY_F9 271
66 #define SYS_KEY_F10 272
67 #define SYS_KEY_F11 273
68 #define SYS_KEY_F12 274
69 #define SYS_KEY_NUM 275
70 #define SYS_KEY_SCROLL 276
72 #define SYS_MODIFIER_SHIFT 1
74 int sysInitTerminals(void);
76 void sysSetCurrentTerminal(int terminal);
77 int sysGetCurrentTerminal(void);
79 int sysTerminalInjectKey(int key, int modifiers, int down);
81 char *sysTerminalPreparePanic(int *width, int *height);
83 #endif