FabGL
ESP32 VGA Controller and Graphics Library
terminfo.h
Go to the documentation of this file.
1 /*
2  Created by Fabrizio Di Vittorio (fdivitto2013@gmail.com) - <http://www.fabgl.com>
3  Copyright (c) 2019 Fabrizio Di Vittorio.
4  All rights reserved.
5 
6  This file is part of FabGL Library.
7 
8  FabGL is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  FabGL is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with FabGL. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 
23 #pragma once
24 
25 
33 #include "keyboard.h"
34 
35 
36 namespace fabgl {
37 
38 
39 
40 
41 constexpr int EmuTerminalMaxChars = 8;
42 
43 
44 enum class ConvCtrl {
45  END,
46  CarriageReturn,
47  LineFeed,
48  CursorLeft,
49  CursorUp,
50  CursorRight,
51  EraseToEndOfScreen,
52  EraseToEndOfLine,
53  CursorHome,
54  AttrNormal,
55  AttrBlank,
56  AttrBlink,
57  AttrBlinkOff,
58  AttrReverse,
59  AttrReverseOff,
60  AttrUnderline,
61  AttrUnderlineOff,
62  AttrReduce,
63  AttrReduceOff,
64  CursorPos,
65  CursorPos2,
66  InsertLine,
67  InsertChar,
68  DeleteLine,
69  DeleteCharacter,
70  CursorOn,
71  CursorOff,
72  SaveCursor,
73  RestoreCursor,
74 };
75 
76 
77 // converts from emulated terminal video control code to ANSI/VT control codes
78 struct TermInfoVideoConv {
79  const char * termSeq; // input terminal control code to match. 0xFF matches any char
80  int termSeqLen; // length of termSeq string
81  ConvCtrl convCtrl[5]; // output video action (will be converted to ANSI control code). Last ctrl must be ConvCtrl::End
82 };
83 
84 
85 // converts from emulated terminal keyboard virtual key to ANSI/VT control codes
86 struct TermInfoKbdConv {
87  VirtualKey vk; // input virtual key
88  const char * ANSICtrlCode; // output ANSI control code
89 };
90 
91 
92 struct TermInfo {
93  char const * initString;
94  TermInfoVideoConv const * videoCtrlSet;
95  TermInfoKbdConv const * kbdCtrlSet;
96 };
97 
98 
99 
103 enum TermType {
111 };
112 
113 
114 
115 
116 // Lear Siegler ADM-3A
117 extern const TermInfo term_ADM3A;
118 
119 // Lear Siegler ADM-31
120 extern const TermInfo term_ADM31;
121 
122 // Hazeltine 1500
123 extern const TermInfo term_Hazeltine1500;
124 
125 // Osborne I
126 extern const TermInfo term_Osborne;
127 
128 // Kaypro
129 extern const TermInfo term_Kaypro;
130 
131 // VT52
132 extern const TermInfo term_VT52;
133 
134 
135 
136 
137 }
This file contains fabgl::KeyboardClass definition and the Keyboard instance.
Definition: terminfo.h:110
VirtualKey
Represents each possible real or derived (SHIFT + real) key.
Definition: fabutils.h:502
Definition: terminfo.h:107
Definition: canvas.cpp:47
TermType
This enum defines supported terminals.
Definition: terminfo.h:103
Definition: terminfo.h:108
Definition: terminfo.h:105
Definition: terminfo.h:106
Definition: terminfo.h:109
Definition: terminfo.h:104