17 #ifndef HH_SENF_Utils_Termlib_Terminfo_ 18 #define HH_SENF_Utils_Termlib_Terminfo_ 1 25 #include <boost/cstdint.hpp> 116 KeyDown,
KeyEic,
KeyEol,
KeyEos,
KeyF0,
KeyF1,
KeyF10,
KeyF2,
KeyF3,
KeyF4,
KeyF5,
117 KeyF6,
KeyF7,
KeyF8,
KeyF9,
KeyHome,
KeyIc,
KeyIl,
KeyLeft,
KeyLl,
KeyNpage,
119 LabF1,
LabF10,
LabF2,
LabF3,
LabF4,
LabF5,
LabF6,
LabF7,
LabF8,
LabF9,
MetaOff,
136 KeyF11,
KeyF12,
KeyF13,
KeyF14,
KeyF15,
KeyF16,
KeyF17,
KeyF18,
KeyF19,
KeyF20,
137 KeyF21,
KeyF22,
KeyF23,
KeyF24,
KeyF25,
KeyF26,
KeyF27,
KeyF28,
KeyF29,
KeyF30,
138 KeyF31,
KeyF32,
KeyF33,
KeyF34,
KeyF35,
KeyF36,
KeyF37,
KeyF38,
KeyF39,
KeyF40,
139 KeyF41,
KeyF42,
KeyF43,
KeyF44,
KeyF45,
KeyF46,
KeyF47,
KeyF48,
KeyF49,
KeyF50,
140 KeyF51,
KeyF52,
KeyF53,
KeyF54,
KeyF55,
KeyF56,
KeyF57,
KeyF58,
KeyF59,
KeyF60,
144 User2,
User3,
User4,
User5,
User6,
User7,
User8,
User9,
OrigPair,
OrigColors,
180 explicit Terminfo(std::string
const & term);
181 void load(std::string
const & term);
203 void dump(std::ostream & os)
const;
211 typedef std::vector<bool> BoolVec;
212 typedef std::vector<number_t> NumberVec;
213 typedef std::vector<string_t> StringVec;
214 typedef std::vector<char> StringPool;
216 static std::string findTerminfo(std::string
const &
name);
217 void load(std::istream & is);
223 StringPool stringPool_;
244 Space =
' ',
Tab =
'\t', Return =
'\r', First = 0xE000, Esc = First, Backspace, Backtab,
245 Begin, CATab,
CTab, Cancel, Center, Clear, ClearToEOL, ClearToEOS, Close, Command, Copy,
246 Create, Delete,
DeleteLine, Down, DownLeft, DownRight, End, Enter, Exit, F0, F1, F2,
F3,
247 F4, F5, F6, F7, F8,
F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22,
248 F23, F24, F25, F26, F27, F28, F29, F30, F31, F32, F33, F34, F35, F36, F37, F38,
F39,
249 F40, F41, F42, F43, F44, F45, F46, F47, F48, F49, F50, F51, F52, F53, F54, F55,
F56,
250 F57, F58, F59, F60, F61, F62, F63, Find, Help, Home, Insert,
InsertLine, Left,
Mark,
251 Message, Mouse, Move, Next, Open, Options, PageDown, PageUp, Previous, Print,
Redo,
252 Reference, Refresh, Replace, Restart, Resume, Right, Save, Select,
ShiftBegin,
254 ShiftEnd, ShiftClearToEOL, ShiftExit, ShiftFind, ShiftHelp, ShiftHome,
ShiftInsert,
255 ShiftLeft, ShiftMessage, ShiftMove, ShiftNext, ShiftOptions, ShiftPrevious,
ShiftPrint,
256 ShiftRedo, ShiftReplace, ShiftResume, ShiftRight, ShiftSave, ShiftSuspend,
ShiftTab,
257 ShiftUndo, Suspend, Undo, Up, UpLeft,
UpRight, Incomplete = 0xE0FF };
261 static char const *
const KeyNames[];
267 static keycode_t
Ctrl(
char ch) {
return ch-
'@'; }
275 std::pair<keycode_t, size_type> lookup(std::string
const & key)
const;
296 static std::string describe(keycode_t key);
298 void dump(std::ostream & os)
const;
301 typedef std::map<std::string, KeyCode> Keytable;
char const * string_t
String terminfo property type.
KeyCode
Special keyboard key codes.
void load(std::string const &term)
Load terminfo entry term.
wchar_t keycode_t
Key code data type.
boost::int16_t number_t
Numeric terminfo property type.
number_t getNumber(properties::Numeric p) const
Get numeric property value.
bool hasProperty(properties::Boolean p) const
true, if boolean property p exists
bool getFlag(properties::Boolean p) const
Get boolean property value.
Numeric
Numeric terminfo properties.
Parse key escape sequences.
static char const *const NumericNames[]
Numeric property names.
Invalid, incomplete or non-existent terminfo entry exception.
string_t getString(properties::String p) const
Get string property value.
void dump(std::ostream &os) const
Dump a description of the terminfo entry.
std::string::size_type size_type
String length type.
String
String terminfo properties.
Boolean
Boolean terminfo properties.
static keycode_t Ctrl(char ch)
Helper to convert uppercase char to Control key code.
Terminfo property constants.
static char const *const StringNames[]
String property names.
unspecified_keyword_type name
std::string formatString(properties::String p, number_t arg1=NoValue, number_t arg2=NoValue, number_t arg3=NoValue, number_t arg4=NoValue, number_t arg5=NoValue, number_t arg6=NoValue, number_t arg7=NoValue, number_t arg8=NoValue, number_t arg9=NoValue) const
Format string property value.
static char const *const BooleanNames[]
Boolean property names.