[vte] widget: Move some methods to VteTerminalPrivate
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] widget: Move some methods to VteTerminalPrivate
- Date: Thu, 14 Jan 2016 16:13:16 +0000 (UTC)
commit ef3258e8c3a1d4f5bb81766a3c7127a523eeda0f
Author: Christian Persch <chpe gnome org>
Date: Thu Jan 14 17:05:37 2016 +0100
widget: Move some methods to VteTerminalPrivate
src/vteinternal.hh | 2 +
src/vteseq.cc | 54 +++++++++++++++++++++++++++++----------------------
2 files changed, 33 insertions(+), 23 deletions(-)
---
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index d1f881a..35c81f9 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -1154,6 +1154,8 @@ public:
inline void set_current_directory_uri_changed(char* uri /* adopted */);
inline void set_current_file_uri_changed(char* uri /* adopted */);
inline void set_keypad_mode(VteKeymode mode);
+ inline void seq_erase_in_display(long param);
+ inline void seq_erase_in_line(long param);
};
#define m_invalidated_all invalidated_all
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 3d9d762..8c07504 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -2602,92 +2602,100 @@ vte_sequence_handler_decreset (VteTerminal *terminal, GValueArray *params)
static void
vte_sequence_handler_erase_in_display (VteTerminal *terminal, GValueArray *params)
{
- GValue *value;
- long param;
- guint i;
/* The default parameter is 0. */
- param = 0;
+ long param = 0;
/* Pull out the first parameter. */
- for (i = 0; (params != NULL) && (i < params->n_values); i++) {
- value = g_value_array_get_nth(params, i);
+ for (guint i = 0; (params != NULL) && (i < params->n_values); i++) {
+ GValue* value = g_value_array_get_nth(params, i);
if (!G_VALUE_HOLDS_LONG(value)) {
continue;
}
param = g_value_get_long(value);
break;
}
+
+ terminal->pvt->seq_erase_in_display(param);
+}
+
+void
+VteTerminalPrivate::seq_erase_in_display(long param)
+{
/* Clear the right area. */
switch (param) {
case 0:
/* Clear below the current line. */
- terminal->pvt->seq_cd();
+ seq_cd();
break;
case 1:
/* Clear above the current line. */
- terminal->pvt->seq_clear_above_current();
+ seq_clear_above_current();
/* Clear everything to the left of the cursor, too. */
/* FIXME: vttest. */
- terminal->pvt->seq_cb();
+ seq_cb();
break;
case 2:
/* Clear the entire screen. */
- terminal->pvt->seq_clear_screen();
+ seq_clear_screen();
break;
case 3:
/* Drop the scrollback. */
- terminal->pvt->drop_scrollback();
+ drop_scrollback();
break;
default:
break;
}
/* We've modified the display. Make a note of it. */
- terminal->pvt->text_deleted_flag = TRUE;
+ m_text_deleted_flag = TRUE;
}
/* Erase certain parts of the current line in the display. */
static void
vte_sequence_handler_erase_in_line (VteTerminal *terminal, GValueArray *params)
{
- GValue *value;
- long param;
- guint i;
/* The default parameter is 0. */
- param = 0;
+ long param = 0;
/* Pull out the first parameter. */
- for (i = 0; (params != NULL) && (i < params->n_values); i++) {
- value = g_value_array_get_nth(params, i);
+ for (guint i = 0; (params != NULL) && (i < params->n_values); i++) {
+ GValue* value = g_value_array_get_nth(params, i);
if (!G_VALUE_HOLDS_LONG(value)) {
continue;
}
param = g_value_get_long(value);
break;
}
+
+ terminal->pvt->seq_erase_in_line(param);
+}
+
+void
+VteTerminalPrivate::seq_erase_in_line(long param)
+{
/* Clear the right area. */
switch (param) {
case 0:
/* Clear to end of the line. */
- terminal->pvt->seq_ce();
+ seq_ce();
break;
case 1:
/* Clear to start of the line. */
- terminal->pvt->seq_cb();
+ seq_cb();
break;
case 2:
/* Clear the entire line. */
- terminal->pvt->seq_clear_current_line();
+ seq_clear_current_line();
break;
default:
break;
}
/* We've modified the display. Make a note of it. */
- terminal->pvt->text_deleted_flag = TRUE;
+ m_text_deleted_flag = TRUE;
}
/* Perform a full-bore reset. */
static void
vte_sequence_handler_full_reset (VteTerminal *terminal, GValueArray *params)
{
- vte_terminal_reset(terminal, TRUE, TRUE);
+ terminal->pvt->reset(true, true);
}
/* Insert a certain number of lines below the current cursor. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]