teditor
1.8.0@@fee5e94
Terminal based editor written in C++
|
Go to the documentation of this file.
53 int width()
const {
return tsize.
x; }
65 void puts(
const char* data,
size_t len);
66 void puts(
const char* data) {
puts(data, strlen(data)); }
67 void puts(
const std::string& data) {
puts(data.c_str(), data.length()); }
84 const std::string&
getOldSeq()
const {
return oldSeq; }
101 std::string termName;
109 struct termios tios, origTios;
113 std::string seq, oldSeq;
121 static const std::string EnterMouseSeq;
122 static const std::string ExitMouseSeq;
123 static const int BuffSize;
133 void setSignalHandler();
135 ColorSupport colorSupported()
const;
136 const char* func(
int id)
const {
return funcs[id].c_str(); }
137 int readAndExtract();
138 int decodeChar(
key_t ch);
int getWinchFd(int idx) const
Definition: terminal.h:52
void puts(Func f)
Definition: terminal.h:68
void exitGracefully(int signum)
Definition: terminal.cpp:40
@ Event_Mouse
Definition: terminal.h:34
EventType
Definition: terminal.h:31
static const key_t Key_Tilde
Definition: keys.h:180
int width() const
Definition: terminal.h:53
static const key_t Meta_Ctrl
Definition: keys.h:15
#define INFO(fmt,...)
Definition: logger.h:72
@ Event_Key
Definition: terminal.h:32
MetaKey mk
Definition: terminal.h:48
void puts(const char *data)
Definition: terminal.h:66
@ Event_None
Definition: terminal.h:35
static const key_t Key_Enter
Definition: keys.h:62
@ Func_EnterCA
Definition: terminal.h:14
Definition: terminal.cpp:175
void puts(const char *data, size_t len)
append data at the end of the current buffer contents
Definition: terminal.cpp:62
static const key_t Key_Tab
Definition: keys.h:57
@ Func_Blink
Definition: terminal.h:23
T y
Definition: pos2d.h:16
Pos2d< uint16_t > loc
Definition: terminal.h:50
static const key_t Key_Space
Definition: keys.h:88
@ Func_HideCursor
Definition: terminal.h:17
void puts(const std::string &data)
Definition: terminal.h:67
std::vector< std::string > Strings
Definition: utils.h:42
@ Func_FuncsNum
Definition: terminal.h:28
const char * func2terminfo(Func f)
Definition: terminal.cpp:19
static const AllCombos test
Definition: terminal.cpp:186
AllCombos()
Definition: terminal.cpp:184
@ Func_Italic
Definition: terminal.h:21
static const int UndefinedSequence
Definition: terminal.h:95
int height() const
Definition: terminal.h:54
void updateTermSize()
Definition: terminal.cpp:80
void sigwinch_handler(int xxx)
Definition: terminal.cpp:42
EventType type
Definition: terminal.h:46
uint32_t key_t
Definition: keys.h:9
static const key_t Key_Esc
Definition: keys.h:77
Func
Definition: terminal.h:13
Definition: terminal.h:43
@ Func_ExitKeypad
Definition: terminal.h:25
std::string getStrCap(const std::string &cap) const
Definition: infocmp.cpp:51
#define ASSERT(check, fmt,...)
Macro to assert with runtime_error exception if the check fails.
Definition: utils.h:35
void flush()
Definition: terminal.cpp:71
@ Event_Resize
Definition: terminal.h:33
std::string escSeq
Definition: terminal.cpp:177
Definition: terminal.cpp:183
static std::unordered_map< std::string, MetaKey > allKeys
Definition: terminal.cpp:185
@ Func_EnterKeypad
Definition: terminal.h:24
@ Func_EnterMouse
Definition: terminal.h:26
@ Func_ExitMouse
Definition: terminal.h:27
#define DEBUG(fmt,...)
Definition: logger.h:73
@ Func_ClearScreen
Definition: terminal.h:18
static const key_t Meta_Alt
Definition: keys.h:14
@ Func_ShowCursor
Definition: terminal.h:16
MetaKey mk
Definition: terminal.cpp:176
@ Func_Sgr0
Definition: terminal.h:19
@ Func_Bold
Definition: terminal.h:22
static const std::vector< KeyCombo > Combos
Definition: terminal.cpp:178
@ Func_ExitCA
Definition: terminal.h:15
#define ULTRA_DEBUG(fmt,...)
Definition: logger.h:74
static const key_t Key_Backspace2
Definition: keys.h:181
static Terminal & getInstance()
Definition: terminal.cpp:57
@ Func_Underline
Definition: terminal.h:20
T x
Definition: pos2d.h:16
static const key_t Meta_None
Definition: keys.h:12
std::string env(const std::string &s)
Definition: utils.cpp:36