[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:43:48 +0000 (UTC)
commit f96b1326ab5db3701ef0dfda1044b76bede6bbe9
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/vteseq-list.hh | 5 ---
src/vteseq.cc | 75 ++++++++++++---------------------------------------
2 files changed, 18 insertions(+), 62 deletions(-)
---
diff --git a/src/vteseq-list.hh b/src/vteseq-list.hh
index 1c84aa9..741eab3 100644
--- a/src/vteseq-list.hh
+++ b/src/vteseq-list.hh
@@ -2,8 +2,6 @@ SEQUENCE_HANDLER(ansi_conformance_level_1)
SEQUENCE_HANDLER(ansi_conformance_level_2)
SEQUENCE_HANDLER(ansi_conformance_level_3)
SEQUENCE_HANDLER(application_keypad)
-SEQUENCE_HANDLER(backspace)
-SEQUENCE_HANDLER(bell)
SEQUENCE_HANDLER(change_background_color_bel)
SEQUENCE_HANDLER(change_background_color_st)
SEQUENCE_HANDLER(change_color_bel)
@@ -43,9 +41,7 @@ SEQUENCE_HANDLER(enable_locator_reporting)
SEQUENCE_HANDLER(end_of_guarded_area)
SEQUENCE_HANDLER(erase_in_display)
SEQUENCE_HANDLER(erase_in_line)
-SEQUENCE_HANDLER(form_feed)
SEQUENCE_HANDLER(full_reset)
-SEQUENCE_HANDLER(index)
SEQUENCE_HANDLER(initiate_hilite_mouse_tracking)
SEQUENCE_HANDLER(insert_lines)
SEQUENCE_HANDLER(invoke_g1_character_set_as_gr)
@@ -60,7 +56,6 @@ SEQUENCE_HANDLER(media_copy)
SEQUENCE_HANDLER(memory_lock)
SEQUENCE_HANDLER(memory_unlock)
SEQUENCE_HANDLER(next_line)
-SEQUENCE_HANDLER(nop)
SEQUENCE_HANDLER(normal_keypad)
SEQUENCE_HANDLER(request_locator_position)
SEQUENCE_HANDLER(request_terminal_parameters)
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 1af6109..91b853c 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -867,11 +867,6 @@ VteTerminalPrivate::decset(long setting,
/* Do nothing. */
void
-VteTerminalPrivate::seq_nop(vte::parser::Params const& params)
-{
-}
-
-void
VteTerminalPrivate::set_character_replacement(unsigned slot)
{
g_assert(slot < G_N_ELEMENTS(m_character_replacements));
@@ -892,13 +887,6 @@ VteTerminalPrivate::seq_shift_out(vte::parser::Params const& params)
set_character_replacement(1);
}
-/* Beep. */
-void
-VteTerminalPrivate::seq_bell(vte::parser::Params const& params)
-{
- m_bell_pending = true;
-}
-
/* Clear from the cursor position (inclusive!) to the beginning of the line. */
void
VteTerminalPrivate::clear_to_bol()
@@ -1218,13 +1206,6 @@ VteTerminalPrivate::erase_characters(long count)
m_text_deleted_flag = TRUE;
}
-/* Form-feed / next-page. */
-void
-VteTerminalPrivate::seq_form_feed(vte::parser::Params const& params)
-{
- line_feed();
-}
-
/* Insert a blank character. */
void
VteTerminalPrivate::insert_blank_character()
@@ -1236,25 +1217,6 @@ VteTerminalPrivate::insert_blank_character()
m_screen->cursor = save;
}
-/* Cursor down 1 line, with scrolling. */
-void
-VteTerminalPrivate::seq_index(vte::parser::Params const& params)
-{
- line_feed();
-}
-
-/* Cursor left. */
-void
-VteTerminalPrivate::seq_backspace(vte::parser::Params const& params)
-{
- ensure_cursor_is_onscreen();
-
- if (m_screen->cursor.col > 0) {
- /* There's room to move left, so do so. */
- m_screen->cursor.col--;
- }
-}
-
void
VteTerminalPrivate::move_cursor_backward(vte::grid::column_t columns)
{
@@ -2418,17 +2380,12 @@ VteTerminalPrivate::BEL(vte::parser::Sequence const& seq)
{
/*
* BEL - sound bell tone
- * This command should trigger an acoustic bell. Usually, this is
- * forwarded directly to the pcspkr. However, bells have become quite
- * uncommon and annoying, so we're not implementing them here. Instead,
- * it's one of the commands we forward to the caller.
+ * This command should trigger an acoustic bell.
+ *
+ * References: ECMA-48 § 8.3.3
*/
-#if 0
- screen_forward(screen, VTE_CMD_BEL, seq);
-#endif
-
- seq_bell(seq);
+ m_bell_pending = true;
}
void
@@ -2438,6 +2395,8 @@ VteTerminalPrivate::BS(vte::parser::Sequence const& seq)
* BS - backspace
* Move cursor one cell to the left. If already at the left margin,
* nothing happens.
+ *
+ * References: ECMA-48 § 8.3.5
*/
#if 0
@@ -2445,7 +2404,12 @@ VteTerminalPrivate::BS(vte::parser::Sequence const& seq)
screen_cursor_left(screen, 1);
#endif
- seq_backspace(seq);
+ ensure_cursor_is_onscreen();
+
+ if (m_screen->cursor.col > 0) {
+ /* There's room to move left, so do so. */
+ m_screen->cursor.col--;
+ }
}
void
@@ -4393,13 +4357,11 @@ VteTerminalPrivate::FF(vte::parser::Sequence const& seq)
* FF - form-feed
* This causes the cursor to jump to the next line. It is treated the
* same as LF.
+ *
+ * References: ECMA-48 § 8.3.51
*/
-#if 0
- screen_LF(screen, seq);
-#endif
-
- seq_form_feed(seq);
+ LF(seq);
}
void
@@ -4664,12 +4626,11 @@ VteTerminalPrivate::IND(vte::parser::Sequence const& seq)
{
/*
* IND - index - DEPRECATED
+ *
+ * References: ECMA-48 § F.8.2
*/
-#if 0
- screen_cursor_down(screen, 1, true);
-#endif
- seq_index(seq);
+ LF(seq);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]