[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:11:20 +0000 (UTC)
commit 8ab57d45da737a7b3449167faeac99290aa5bff2
Author: Christian Persch <chpe gnome org>
Date: Thu Jan 14 17:05:34 2016 +0100
widget: Move some methods to VteTerminalPrivate
src/vteinternal.hh | 3 +++
src/vteseq.cc | 31 +++++++++++++++----------------
2 files changed, 18 insertions(+), 16 deletions(-)
---
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 27aee2e..876446c 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -1114,6 +1114,9 @@ public:
inline void seq_restore_cursor();
inline void seq_normal_screen_and_restore_cursor();
inline void seq_save_cursor_and_alternate_screen();
+ void seq_set_title_internal(GValueArray *params,
+ bool icon_title,
+ bool window_title);
};
#define m_invalidated_all invalidated_all
diff --git a/src/vteseq.cc b/src/vteseq.cc
index d4cdd72..5df09c1 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -443,16 +443,15 @@ VteTerminalPrivate::seq_save_cursor_and_alternate_screen()
}
/* Set icon/window titles. */
-static void
-vte_sequence_handler_set_title_internal(VteTerminal *terminal,
- GValueArray *params,
- gboolean icon_title,
- gboolean window_title)
+void
+VteTerminalPrivate::seq_set_title_internal(GValueArray *params,
+ bool change_icon_title,
+ bool change_window_title)
{
GValue *value;
char *title = NULL;
- if (icon_title == FALSE && window_title == FALSE)
+ if (change_icon_title == FALSE && change_window_title == FALSE)
return;
/* Get the string parameter's value. */
@@ -467,7 +466,7 @@ vte_sequence_handler_set_title_internal(VteTerminal *terminal,
title = g_value_dup_string(value);
} else
if (G_VALUE_HOLDS_POINTER(value)) {
- title = vte_ucs4_to_utf8 (terminal, (const guchar *)g_value_get_pointer (value));
+ title = vte_ucs4_to_utf8(m_terminal, (const guchar *)g_value_get_pointer (value));
}
if (title != NULL) {
char *p, *validated;
@@ -485,14 +484,14 @@ vte_sequence_handler_set_title_internal(VteTerminal *terminal,
}
/* Emit the signal */
- if (window_title) {
- g_free (terminal->pvt->window_title_changed);
- terminal->pvt->window_title_changed = g_strdup (validated);
+ if (change_window_title) {
+ g_free(m_window_title_changed);
+ m_window_title_changed = g_strdup(validated);
}
- if (icon_title) {
- g_free (terminal->pvt->icon_title_changed);
- terminal->pvt->icon_title_changed = g_strdup (validated);
+ if (change_icon_title) {
+ g_free(m_icon_title_changed);
+ m_icon_title_changed = g_strdup(validated);
}
g_free (validated);
@@ -2243,20 +2242,20 @@ vte_sequence_handler_send_secondary_device_attributes (VteTerminal *terminal, GV
static void
vte_sequence_handler_set_icon_title (VteTerminal *terminal, GValueArray *params)
{
- vte_sequence_handler_set_title_internal(terminal, params, TRUE, FALSE);
+ terminal->pvt->seq_set_title_internal(params, true, false);
}
static void
vte_sequence_handler_set_window_title (VteTerminal *terminal, GValueArray *params)
{
- vte_sequence_handler_set_title_internal(terminal, params, FALSE, TRUE);
+ terminal->pvt->seq_set_title_internal(params, false, true);
}
/* Set both the window and icon titles to the same string. */
static void
vte_sequence_handler_set_icon_and_window_title (VteTerminal *terminal, GValueArray *params)
{
- vte_sequence_handler_set_title_internal(terminal, params, TRUE, TRUE);
+ terminal->pvt->seq_set_title_internal(params, true, true);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]