[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: Wed, 18 Nov 2015 20:17:55 +0000 (UTC)
commit 18caf6fb7b0ac97b4c19bde859fb1b6955f43017
Author: Christian Persch <chpe gnome org>
Date: Wed Nov 18 21:15:39 2015 +0100
widget: Move some methods to VteTerminalPrivate
src/vte.cc | 18 ++++++++----------
src/vteinternal.hh | 5 +++--
src/vteseq.cc | 2 +-
3 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index d05f096..22dde93 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -6383,22 +6383,20 @@ VteTerminalPrivate::send_mouse_button_internal(int button,
}
void
-_vte_terminal_feed_focus_event(VteTerminal *terminal,
- gboolean in)
+VteTerminalPrivate::feed_focus_event(bool in)
{
char buf[8];
gsize len;
len = g_snprintf(buf, sizeof(buf), _VTE_CAP_CSI "%c", in ? 'I' : 'O');
- vte_terminal_feed_child_binary(terminal, (guint8 *)buf, len);
+ vte_terminal_feed_child_binary(m_terminal, (guint8 *)buf, len);
}
-static void
-vte_terminal_feed_focus_event_internal(VteTerminal *terminal,
- gboolean in)
+void
+VteTerminalPrivate::maybe_feed_focus_event(bool in)
{
- if (terminal->pvt->focus_tracking_mode)
- _vte_terminal_feed_focus_event(terminal, in);
+ if (m_focus_tracking_mode)
+ feed_focus_event(in);
}
/*
@@ -8382,7 +8380,7 @@ vte_terminal_focus_in(GtkWidget *widget, GdkEventFocus *event)
gtk_im_context_focus_in(terminal->pvt->im_context);
_vte_invalidate_cursor_once(terminal, FALSE);
_vte_terminal_set_pointer_visible(terminal, TRUE);
- vte_terminal_feed_focus_event_internal(terminal, TRUE);
+ terminal->pvt->maybe_feed_focus_event(true);
}
return FALSE;
@@ -8399,7 +8397,7 @@ vte_terminal_focus_out(GtkWidget *widget, GdkEventFocus *event)
/* We only have an IM context when we're realized, and there's not much
* point to painting ourselves if we don't have a window. */
if (gtk_widget_get_realized (widget)) {
- vte_terminal_feed_focus_event_internal(terminal, FALSE);
+ terminal->pvt->maybe_feed_focus_event(false);
_vte_terminal_maybe_end_selection (terminal);
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index c10cb31..6745eff 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -520,7 +520,8 @@ public:
bool maybe_send_mouse_button(GdkEventButton *event);
bool maybe_send_mouse_drag(GdkEventMotion *event);
-
+ void feed_focus_event(bool in);
+ void maybe_feed_focus_event(bool in);
};
#define m_invalidated_all invalidated_all
@@ -554,4 +555,4 @@ public:
#define m_mouse_xterm_extension mouse_xterm_extension
#define m_mouse_urxvt_extension mouse_urxvt_extension
#define m_modifiers modifiers
-
+#define m_focus_tracking_mode focus_tracking_mode
diff --git a/src/vteseq.cc b/src/vteseq.cc
index af27ff5..c5b469c 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -608,7 +608,7 @@ vte_set_focus_tracking_mode(VteTerminal *terminal,
/* We immediately send the terminal a focus event, since otherwise
* it has no way to know the current status.
*/
- _vte_terminal_feed_focus_event(terminal, gtk_widget_has_focus(&terminal->widget));
+ terminal->pvt->feed_focus_event(gtk_widget_has_focus(&terminal->widget));
}
struct decset_t {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]