1
2
3
4
5
6 #ifndef CMAJOR_RT_SCREEN_INCLUDED
7 #define CMAJOR_RT_SCREEN_INCLUDED
8 #include <cmajor/rt/RtApi.hpp>
9
10 extern "C" void RtInitScreen();
11 extern "C" void RtDoneScreen();
12 extern "C" void RtRaw();
13 extern "C" void RtNoRaw();
14 extern "C" void RtCBreak();
15 extern "C" void RtNoCBreak();
16 extern "C" void RtKeyPad();
17 extern "C" void RtEcho();
18 extern "C" void RtNoEcho();
19 extern "C" void RtCursSet(int visibility);
20 extern "C" void RtRefresh();
21 extern "C" void RtGetMaxYX(int* rows, int* cols);
22 extern "C" void RtErase();
23 extern "C" void RtClear();
24 extern "C" void RtClearToEol();
25 extern "C" void RtGetYX(int* row, int* col);
26 extern "C" void RtMove(int row, int col);
27 extern "C" void RtAddCh(int ch);
28 extern "C" void RtAddStr(const char* str);
29 extern "C" int RtGetCh();
30 extern "C" int RtGetRawCh();
31 extern "C" int RtTranslateCh(int ch);
32 extern "C" void RtGetNStr(char* str, int size);
33 extern "C" void RtAttrOn(int attrs);
34 extern "C" void RtAttrOff(int attrs);
35 extern "C" void RtAttrSet(int attrs);
36 extern "C" void RtStartColor();
37 extern "C" void RtInitPair(short n, short backgroundColor, short foregroundColor);
38 extern "C" int RtColorPair(short n);
39 extern "C" short RtWhite();
40 extern "C" short RtBlack();
41 extern "C" short RtBlue();
42 extern "C" short RtGreen();
43 extern "C" short RtRed();
44 extern "C" short RtCyan();
45 extern "C" short RtMagenta();
46 extern "C" short RtYellow();
47 extern "C" bool RtRunningOnWsl();
48
49
50
51 const int keyBackspace = '\b';
52 const int keyTab = '\t';
53
54 const int keyControlA = 0x001;
55 const int keyControlB = 0x002;
56 const int keyControlC = 0x003;
57 const int keyControlD = 0x004;
58 const int keyControlE = 0x005;
59 const int keyControlF = 0x006;
60 const int keyControlG = 0x007;
61 const int keyControlH = 0x008;
62 const int keyControlI = 0x009;
63 const int keyControlJ = 0x00A;
64 const int keyControlK = 0x00B;
65 const int keyControlL = 0x00C;
66 const int keyControlM = 0x00D;
67 const int keyControlN = 0x00E;
68 const int keyControlO = 0x00F;
69 const int keyControlP = 0x010;
70 const int keyControlQ = 0x011;
71 const int keyControlR = 0x012;
72 const int keyControlS = 0x013;
73 const int keyControlT = 0x014;
74 const int keyControlU = 0x015;
75 const int keyControlV = 0x016;
76 const int keyControlW = 0x017;
77 const int keyControlX = 0x018;
78 const int keyControlY = 0x019;
79 const int keyControlZ = 0x01A;
80 const int keyEscape = 0x01B;
81 const int keyFS = 0x01C;
82 const int keyGS = 0x01D;
83 const int keyRS = 0x01E;
84 const int keyUS = 0x01F;
85
86
87
88 const int specialKeyStart = 0xE000;
89
90 const int keyEnter = specialKeyStart + 0;
91 const int keyDown = specialKeyStart + 1;
92 const int keyUp = specialKeyStart + 2;
93 const int keyLeft = specialKeyStart + 3;
94 const int keyRight = specialKeyStart + 4;
95 const int keyHome = specialKeyStart + 5;
96 const int keyF0 = specialKeyStart + 6;
97 const int keyF1 = specialKeyStart + 7;
98 const int keyF2 = specialKeyStart + 8;
99 const int keyF3 = specialKeyStart + 9;
100 const int keyF4 = specialKeyStart + 10;
101 const int keyF5 = specialKeyStart + 11;
102 const int keyF6 = specialKeyStart + 12;
103 const int keyF7 = specialKeyStart + 13;
104 const int keyF8 = specialKeyStart + 14;
105 const int keyF9 = specialKeyStart + 15;
106 const int keyF10 = specialKeyStart + 16;
107 const int keyF11 = specialKeyStart + 17;
108 const int keyF12 = specialKeyStart + 18;
109 const int keyDel = specialKeyStart + 19;
110 const int keyIns = specialKeyStart + 20;
111 const int keyPgDown = specialKeyStart + 21;
112 const int keyPgUp = specialKeyStart + 22;
113 const int keyPrint = specialKeyStart + 23;
114 const int keyEnd = specialKeyStart + 24;
115 const int keyShiftDel = specialKeyStart + 25;
116 const int keyShiftEnd = specialKeyStart + 26;
117 const int keyShiftHome = specialKeyStart + 27;
118 const int keyShiftLeft = specialKeyStart + 28;
119 const int keyShiftRight = specialKeyStart + 29;
120 const int keyResize = specialKeyStart + 30;
121 const int keyShiftUp = specialKeyStart + 31;
122 const int keyShiftDown = specialKeyStart + 32;
123 const int keyControlUp = specialKeyStart + 33;
124 const int keyControlDown = specialKeyStart + 34;
125 const int keyControlLeft = specialKeyStart + 35;
126 const int keyControlRight = specialKeyStart + 36;
127 const int keyControlPgUp = specialKeyStart + 37;
128 const int keyControlPgDown = specialKeyStart + 38;
129 const int keyControlHome = specialKeyStart + 39;
130 const int keyControlEnd = specialKeyStart + 40;
131
132 const int keyControlDel = specialKeyStart + 41;
133 const int keyControlF1 = specialKeyStart + 42;
134 const int keyControlF2 = specialKeyStart + 43;
135 const int keyControlF3 = specialKeyStart + 44;
136 const int keyControlF4 = specialKeyStart + 45;
137 const int keyControlF5 = specialKeyStart + 46;
138 const int keyControlF6 = specialKeyStart + 47;
139 const int keyControlF7 = specialKeyStart + 48;
140 const int keyControlF8 = specialKeyStart + 49;
141 const int keyControlF9 = specialKeyStart + 50;
142 const int keyControlF10 = specialKeyStart + 51;
143 const int keyControlF11 = specialKeyStart + 52;
144 const int keyControlF12 = specialKeyStart + 53;
145 const int keyShiftPgUp = specialKeyStart + 54;
146 const int keyShiftPgDown = specialKeyStart + 55;
147 const int keyShiftF1 = specialKeyStart + 56;
148 const int keyShiftF2 = specialKeyStart + 57;
149 const int keyShiftF3 = specialKeyStart + 58;
150 const int keyShiftF4 = specialKeyStart + 59;
151 const int keyShiftF5 = specialKeyStart + 60;
152 const int keyShiftF6 = specialKeyStart + 61;
153 const int keyShiftF7 = specialKeyStart + 62;
154 const int keyShiftF8 = specialKeyStart + 63;
155 const int keyShiftF9 = specialKeyStart + 64;
156 const int keyShiftF10 = specialKeyStart + 65;
157 const int keyShiftF11 = specialKeyStart + 66;
158 const int keyShiftF12 = specialKeyStart + 67;
159
160 const int specialKeyEnd = specialKeyStart + 67;
161
162 namespace cmajor { namespace rt {
163
164 void InitScreen();
165 void DoneScreen();
166
167 } }
168
169 #endif // CMAJOR_RT_SCREEN_INCLUDED