[vte] emulation: Move sequence handler code directly into the handler
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] emulation: Move sequence handler code directly into the handler
- Date: Tue, 27 Mar 2018 17:44:03 +0000 (UTC)
commit 983769e2879a0d3eb31c6e4114d586054f240860
Author: Christian Persch <chpe src gnome org>
Date: Tue Mar 27 19:40:12 2018 +0200
emulation: Move sequence handler code directly into the handler
src/parser-cmd.hh | 4 +-
src/parser.cc | 8 ++--
src/vteseq-list.hh | 4 --
src/vteseq.cc | 79 +++++++++++++++++-----------------------------------
4 files changed, 32 insertions(+), 63 deletions(-)
---
diff --git a/src/parser-cmd.hh b/src/parser-cmd.hh
index 0e03269..a94a308 100644
--- a/src/parser-cmd.hh
+++ b/src/parser-cmd.hh
@@ -160,12 +160,12 @@ _VTE_CMD(RC) /* restore-cursor */
_VTE_CMD(REP) /* repeat */
_VTE_CMD(RI) /* reverse-index */
_VTE_CMD(RIS) /* reset-to-initial-state */
-_VTE_CMD(RM_ANSI) /* reset-mode-ansi */
+_VTE_CMD(RM_ECMA) /* reset-mode-ecma */
_VTE_CMD(RM_DEC) /* reset-mode-dec */
_VTE_CMD(SD) /* scroll-down */
_VTE_CMD(SGR) /* select-graphics-rendition */
_VTE_CMD(SI) /* shift-in */
-_VTE_CMD(SM_ANSI) /* set-mode-ansi */
+_VTE_CMD(SM_ECMA) /* set-mode-ecma */
_VTE_CMD(SM_DEC) /* set-mode-dec */
_VTE_CMD(SO) /* shift-out */
_VTE_CMD(SPA) /* start-of-protected-area */
diff --git a/src/parser.cc b/src/parser.cc
index f1a60e2..6ddc1c4 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -486,8 +486,8 @@ static unsigned int vte_parse_host_csi(const struct vte_seq *seq)
return VTE_CMD_CUP;
break;
case 'h':
- if (flags == 0) /* SM ANSI */
- return VTE_CMD_SM_ANSI;
+ if (flags == 0) /* SM ECMA */
+ return VTE_CMD_SM_ECMA;
else if (flags == VTE_SEQ_FLAG_WHAT) /* SM DEC */
return VTE_CMD_SM_DEC;
break;
@@ -518,8 +518,8 @@ static unsigned int vte_parse_host_csi(const struct vte_seq *seq)
return VTE_CMD_IL;
break;
case 'l':
- if (flags == 0) /* RM ANSI */
- return VTE_CMD_RM_ANSI;
+ if (flags == 0) /* RM ECMA */
+ return VTE_CMD_RM_ECMA;
else if (flags == VTE_SEQ_FLAG_WHAT) /* RM DEC */
return VTE_CMD_RM_DEC;
break;
diff --git a/src/vteseq-list.hh b/src/vteseq-list.hh
index 73b6f7e..7b7f7b5 100644
--- a/src/vteseq-list.hh
+++ b/src/vteseq-list.hh
@@ -29,8 +29,6 @@ SEQUENCE_HANDLER(change_tek_foreground_color_bel)
SEQUENCE_HANDLER(change_tek_foreground_color_st)
SEQUENCE_HANDLER(cursor_lower_left)
SEQUENCE_HANDLER(dec_media_copy)
-SEQUENCE_HANDLER(decreset)
-SEQUENCE_HANDLER(decset)
SEQUENCE_HANDLER(device_control_string)
SEQUENCE_HANDLER(double_height_bottom_half)
SEQUENCE_HANDLER(double_height_top_half)
@@ -64,7 +62,6 @@ SEQUENCE_HANDLER(reset_cursor_background_color)
SEQUENCE_HANDLER(reset_foreground_color)
SEQUENCE_HANDLER(reset_highlight_background_color)
SEQUENCE_HANDLER(reset_highlight_foreground_color)
-SEQUENCE_HANDLER(reset_mode)
SEQUENCE_HANDLER(reset_mouse_cursor_background_color)
SEQUENCE_HANDLER(reset_mouse_cursor_foreground_color)
SEQUENCE_HANDLER(reset_tek_background_color)
@@ -86,7 +83,6 @@ SEQUENCE_HANDLER(set_current_file_uri)
SEQUENCE_HANDLER(set_current_hyperlink)
SEQUENCE_HANDLER(set_icon_and_window_title)
SEQUENCE_HANDLER(set_icon_title)
-SEQUENCE_HANDLER(set_mode)
SEQUENCE_HANDLER(set_text_property_21)
SEQUENCE_HANDLER(set_text_property_2L)
SEQUENCE_HANDLER(set_window_title)
diff --git a/src/vteseq.cc b/src/vteseq.cc
index e7cf2b4..9d649b7 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -473,7 +473,7 @@ VteTerminalPrivate::set_title_internal(vte::parser::Params const& params,
/* Toggle a terminal mode. */
void
-VteTerminalPrivate::set_mode(vte::parser::Params const& params,
+VteTerminalPrivate::set_mode(vte::parser::Sequence const& params,
bool value)
{
auto n_params = params.size();
@@ -534,7 +534,7 @@ decset_cmp(const void *va,
/* Manipulate certain terminal attributes. */
void
-VteTerminalPrivate::decset(vte::parser::Params const& params,
+VteTerminalPrivate::decset(vte::parser::Sequence const& params,
bool restore,
bool save,
bool set)
@@ -1674,40 +1674,6 @@ VteTerminalPrivate::set_keypad_mode(VteKeymode mode)
m_keypad_mode = mode;
}
-/* Set certain terminal attributes. */
-void
-VteTerminalPrivate::seq_set_mode(vte::parser::Params const& params)
-{
- set_mode(params, true);
-}
-
-/* Unset certain terminal attributes. */
-void
-VteTerminalPrivate::seq_reset_mode(vte::parser::Params const& params)
-{
- set_mode(params, false);
-}
-
-/* Set certain terminal attributes. */
-void
-VteTerminalPrivate::seq_decset(vte::parser::Params const& params)
-{
- decset(params, false, false, true);
-}
-
-/* Unset certain terminal attributes. */
-void
-VteTerminalPrivate::seq_decreset(vte::parser::Params const& params)
-{
- decset(params, false, false, false);
-}
-
-/* Erase certain lines in the display. */
-void
-VteTerminalPrivate::seq_erase_in_display(vte::parser::Params const& params)
-{
-}
-
void
VteTerminalPrivate::erase_in_display(vte::parser::Sequence const& seq)
{
@@ -1744,11 +1710,6 @@ VteTerminalPrivate::erase_in_display(vte::parser::Sequence const& seq)
}
void
-VteTerminalPrivate::seq_erase_in_line(vte::parser::Params const& params)
-{
-}
-
-void
VteTerminalPrivate::erase_in_line(vte::parser::Sequence const& seq)
{
/* We don't implement the protected attribute, so we can ignore selective:
@@ -4902,12 +4863,14 @@ VteTerminalPrivate::RIS(vte::parser::Sequence const& seq)
}
void
-VteTerminalPrivate::RM_ANSI(vte::parser::Sequence const& seq)
+VteTerminalPrivate::RM_ECMA(vte::parser::Sequence const& seq)
{
/*
- * RM_ANSI - reset-mode-ansi
+ * RM_ECMA - reset-mode-ecma
+ *
+ * Defaults: none
*
- * TODO: implement (see VT510rm manual)
+ * References: ECMA-48 § 8.3.106
*/
#if 0
unsigned int i;
@@ -4916,7 +4879,7 @@ VteTerminalPrivate::RM_ANSI(vte::parser::Sequence const& seq)
screen_mode_change_ansi(screen, seq->args[i], false);
#endif
- seq_reset_mode(seq);
+ set_mode(seq, false);
}
void
@@ -4924,7 +4887,11 @@ VteTerminalPrivate::RM_DEC(vte::parser::Sequence const& seq)
{
/*
* RM_DEC - reset-mode-dec
- * This is the same as RM_ANSI but for DEC modes.
+ * This is the same as RM_ECMA but for DEC modes.
+ *
+ * Defaults: none
+ *
+ * References: VT525
*/
#if 0
unsigned int i;
@@ -4933,7 +4900,7 @@ VteTerminalPrivate::RM_DEC(vte::parser::Sequence const& seq)
screen_mode_change_dec(screen, seq->args[i], false);
#endif
- seq_decreset(seq);
+ decset(seq, false, false, false);
}
void
@@ -5117,12 +5084,14 @@ VteTerminalPrivate::SI(vte::parser::Sequence const& seq)
}
void
-VteTerminalPrivate::SM_ANSI(vte::parser::Sequence const& seq)
+VteTerminalPrivate::SM_ECMA(vte::parser::Sequence const& seq)
{
/*
- * SM_ANSI - set-mode-ansi
+ * SM_ECMA - set-mode-ecma
*
- * TODO: implement
+ * Defaults: none
+ *
+ * References: ECMA-48 § 8.3.125
*/
#if 0
unsigned int i;
@@ -5131,7 +5100,7 @@ VteTerminalPrivate::SM_ANSI(vte::parser::Sequence const& seq)
screen_mode_change_ansi(screen, seq->args[i], true);
#endif
- seq_set_mode(seq);
+ set_mode(seq, true);
}
void
@@ -5139,7 +5108,11 @@ VteTerminalPrivate::SM_DEC(vte::parser::Sequence const& seq)
{
/*
* SM_DEC - set-mode-dec
- * This is the same as SM_ANSI but for DEC modes.
+ * This is the same as SM_ECMA but for DEC modes.
+ *
+ * Defaults: none
+ *
+ * References: VT525
*/
#if 0
unsigned int i;
@@ -5148,7 +5121,7 @@ VteTerminalPrivate::SM_DEC(vte::parser::Sequence const& seq)
screen_mode_change_dec(screen, seq->args[i], true);
#endif
- seq_decset(seq);
+ decset(seq, false, false, true);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]