- Implemented execp*.
[planlOS.git] / system / include / sys / terminal.h
blob69a8f3f877c7daadb3dfd029e2d5e739070f9695
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 struct KeProcess *owner;
44 int opencount;
45 } SysTextTerminal;
47 typedef struct
49 FsDeviceFile file;
50 } SysGfxTerminal;
52 #define SYS_KEY_ESCAPE 256
53 #define SYS_KEY_BACKSPACE 257
54 #define SYS_KEY_LCONTROL 258
55 #define SYS_KEY_LSHIFT 259
56 #define SYS_KEY_RSHIFT 260
57 #define SYS_KEY_LALT 261
58 #define SYS_KEY_CAPS 262
59 #define SYS_KEY_F1 263
60 #define SYS_KEY_F2 264
61 #define SYS_KEY_F3 265
62 #define SYS_KEY_F4 266
63 #define SYS_KEY_F5 267
64 #define SYS_KEY_F6 268
65 #define SYS_KEY_F7 269
66 #define SYS_KEY_F8 270
67 #define SYS_KEY_F9 271
68 #define SYS_KEY_F10 272
69 #define SYS_KEY_F11 273
70 #define SYS_KEY_F12 274
71 #define SYS_KEY_NUM 275
72 #define SYS_KEY_SCROLL 276
74 #define SYS_MODIFIER_SHIFT 1
76 int sysInitTerminals(void);
78 void sysSetCurrentTerminal(int terminal);
79 int sysGetCurrentTerminal(void);
81 int sysTerminalInjectKey(int key, int modifiers, int down);
83 char *sysTerminalPreparePanic(int *width, int *height);
85 #endif