[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:18:46 +0000 (UTC)
commit 6620724a6e5280ed9128c45e2f236df5d0278553
Author: Christian Persch <chpe gnome org>
Date: Wed Nov 18 21:15:41 2015 +0100
widget: Move some methods to VteTerminalPrivate
src/vte.cc | 50 ++++++++++++++++++++++++++++++++++++--------------
src/vteinternal.hh | 2 ++
2 files changed, 38 insertions(+), 14 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 171ff57..ff2785f 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -8419,38 +8419,60 @@ VteTerminalPrivate::widget_focus_out(GdkEventFocus *event)
static gboolean
vte_terminal_enter(GtkWidget *widget, GdkEventCrossing *event)
{
- gboolean ret = FALSE;
- _vte_debug_print(VTE_DEBUG_EVENTS, "Enter.\n");
+ VteTerminal *terminal = VTE_TERMINAL(widget);
+ gboolean ret = FALSE;
+
if (GTK_WIDGET_CLASS (vte_terminal_parent_class)->enter_notify_event) {
ret = GTK_WIDGET_CLASS (vte_terminal_parent_class)->enter_notify_event (widget, event);
}
- if (gtk_widget_get_realized (widget)) {
- VteTerminal *terminal = VTE_TERMINAL (widget);
+
+ terminal->pvt->widget_enter(event);
+
+ return ret;
+}
+
+void
+VteTerminalPrivate::widget_enter(GdkEventCrossing *event)
+{
+ _vte_debug_print(VTE_DEBUG_EVENTS, "Enter.\n");
+
+ if (gtk_widget_get_realized(m_widget)) {
/* Hilite any matches. */
- terminal->pvt->match_hilite_show(
- event->x - terminal->pvt->padding.left,
- event->y - terminal->pvt->padding.top);
+ match_hilite_show(
+ event->x - m_padding.left,
+ event->y - m_padding.top);
}
- return ret;
}
+
static gboolean
vte_terminal_leave(GtkWidget *widget, GdkEventCrossing *event)
{
+ VteTerminal *terminal = VTE_TERMINAL(widget);
gboolean ret = FALSE;
- _vte_debug_print(VTE_DEBUG_EVENTS, "Leave.\n");
+
if (GTK_WIDGET_CLASS (vte_terminal_parent_class)->leave_notify_event) {
ret = GTK_WIDGET_CLASS (vte_terminal_parent_class)->leave_notify_event (widget, event);
}
- if (gtk_widget_get_realized (widget)) {
- VteTerminal *terminal = VTE_TERMINAL (widget);
- terminal->pvt->match_hilite_hide();
+
+ terminal->pvt->widget_leave(event);
+
+ return ret;
+}
+
+void
+VteTerminalPrivate::widget_leave(GdkEventCrossing *event)
+{
+ _vte_debug_print(VTE_DEBUG_EVENTS, "Leave.\n");
+
+ if (gtk_widget_get_realized(m_widget)) {
+ match_hilite_hide();
+
/* Mark the cursor as invisible to disable hilite updating,
* whilst the cursor is absent (otherwise we copy the entire
* buffer after each update for nothing...)
*/
- terminal->pvt->mouse_cursor_visible = FALSE;
+ m_mouse_cursor_visible = FALSE;
}
- return ret;
}
static G_GNUC_UNUSED inline const char *
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 6030434..ea257e3 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -459,6 +459,8 @@ public:
bool widget_key_release(GdkEventKey *event);
bool widget_button_press(GdkEventButton *event);
bool widget_button_release(GdkEventButton *event);
+ void widget_enter(GdkEventCrossing *event);
+ void widget_leave(GdkEventCrossing *event);
void read_modifiers(GdkEvent *event);
guint translate_ctrlkey(GdkEventKey *event);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]