[vte] widget: Move some methods to VteTerminalPrivate



commit 380e3512fc23963cf7ad55994931a52480eda536
Author: Christian Persch <chpe gnome org>
Date:   Sun Nov 22 21:07:03 2015 +0100

    widget: Move some methods to VteTerminalPrivate

 src/vte.cc         |   38 +++++++++++++++++++-------------------
 src/vteinternal.hh |    2 ++
 2 files changed, 21 insertions(+), 19 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 8f31b12..572d651 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -5659,7 +5659,7 @@ VteTerminalPrivate::maybe_feed_focus_event(bool in)
 }
 
 /*
- * vte_terminal_maybe_send_mouse_button:
+ * VteTerminalPrivate::maybe_send_mouse_button:
  * @terminal:
  * @event:
  *
@@ -6560,29 +6560,29 @@ VteTerminalPrivate::start_selection(long x,
        disconnect_pty_read();
 }
 
-static gboolean
-_vte_terminal_maybe_end_selection (VteTerminal *terminal)
+bool
+VteTerminalPrivate::maybe_end_selection()
 {
-       if (terminal->pvt->selecting) {
+       if (m_selecting) {
                /* Copy only if something was selected. */
-               if (terminal->pvt->has_selection &&
-                   !terminal->pvt->selecting_restart &&
-                   terminal->pvt->selecting_had_delta) {
-                       vte_terminal_copy_primary(terminal);
-                       terminal->pvt->emit_selection_changed();
+               if (m_has_selection &&
+                   !m_selecting_restart &&
+                   m_selecting_had_delta) {
+                       vte_terminal_copy_primary(m_terminal);
+                       emit_selection_changed();
                }
-               terminal->pvt->selecting = FALSE;
+               m_selecting = false;
 
                /* Reconnect to input from the child if we paused it. */
-               terminal->pvt->connect_pty_read();
+               connect_pty_read();
 
-               return TRUE;
+               return true;
        }
 
-        if (terminal->pvt->selecting_after_threshold)
-                return TRUE;
+        if (m_selecting_after_threshold)
+                return true;
 
-        return FALSE;
+        return false;
 }
 
 static long
@@ -7383,7 +7383,7 @@ VteTerminalPrivate::widget_button_press(GdkEventButton *event)
 bool
 VteTerminalPrivate::widget_button_release(GdkEventButton *event)
 {
-       gboolean handled = FALSE;
+       bool handled = false;
        int x, y;
 
        x = event->x - m_padding.left;
@@ -7405,7 +7405,7 @@ VteTerminalPrivate::widget_button_release(GdkEventButton *event)
                switch (event->button) {
                case 1:
                         if ((m_mouse_handled_buttons & 1) != 0)
-                                handled = _vte_terminal_maybe_end_selection(m_terminal);
+                                handled = maybe_end_selection();
                        break;
                case 2:
                         handled = (m_mouse_handled_buttons & 2) != 0;
@@ -7432,7 +7432,7 @@ VteTerminalPrivate::widget_button_release(GdkEventButton *event)
                                             x, y,
                                             &m_mouse_last_column,
                                             &m_mouse_last_row);
-       m_selecting_after_threshold = FALSE;
+       m_selecting_after_threshold = false;
 
        return handled;
 }
@@ -7475,7 +7475,7 @@ VteTerminalPrivate::widget_focus_out(GdkEventFocus *event)
        if (gtk_widget_get_realized(m_widget)) {
                 maybe_feed_focus_event(false);
 
-               _vte_terminal_maybe_end_selection(m_terminal);
+               maybe_end_selection();
 
                gtk_im_context_focus_out(m_im_context);
                invalidate_cursor_once();
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 33e4275..9b70440 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -528,6 +528,8 @@ public:
         void start_selection(long x,
                              long y,
                              enum vte_selection_type selection_type);
+        bool maybe_end_selection();
+
         void select_all();
         void deselect_all();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]