LibVT: Replace escape$h_l with SM (Set Mode) / RM (Reset Mode)

This commit is contained in:
Linus Groh 2020-01-26 14:21:54 +00:00 committed by Andreas Kling
parent be57b81336
commit fd8c250866
Notes: sideshowbarker 2024-07-19 09:47:18 +09:00
2 changed files with 20 additions and 4 deletions

View File

@ -124,7 +124,7 @@ inline bool is_valid_final_character(u8 ch)
return ch >= 0x40 && ch <= 0x7e;
}
void Terminal::escape$h_l(bool should_set, bool question_param, const ParamVector& params)
void Terminal::alter_mode(bool should_set, bool question_param, const ParamVector& params)
{
int mode = 2;
if (params.size() > 0) {
@ -153,6 +153,19 @@ void Terminal::escape$h_l(bool should_set, bool question_param, const ParamVecto
}
}
void Terminal::RM(bool question_param, const ParamVector& params)
{
// RM Reset Mode
alter_mode(true, question_param, params);
}
void Terminal::SM(bool question_param, const ParamVector& params)
{
// SM Set Mode
alter_mode(false, question_param, params);
}
void Terminal::SGR(const ParamVector& params)
{
// SGR Select Graphic Rendition
@ -679,10 +692,10 @@ void Terminal::execute_escape_sequence(u8 final)
escape$r(params);
break;
case 'l':
escape$h_l(true, question_param, params);
RM(question_param, params);
break;
case 'h':
escape$h_l(false, question_param, params);
SM(question_param, params);
break;
case 'c':
DA(params);

View File

@ -148,6 +148,8 @@ private:
void emit_string(const StringView&);
void alter_mode(bool, bool, const ParamVector&);
void CUU(const ParamVector&);
void CUD(const ParamVector&);
void CUF(const ParamVector&);
@ -169,7 +171,8 @@ private:
void escape$S(const ParamVector&);
void escape$T(const ParamVector&);
void escape$L(const ParamVector&);
void escape$h_l(bool, bool, const ParamVector&);
void RM(bool, const ParamVector&);
void SM(bool, const ParamVector&);
void DA(const ParamVector&);
void HVP(const ParamVector&);
void NEL();