[vte] widget: Move some methods to VteTerminalPrivate



commit 76b955db2ca84787947089073d8d2ae445c0c7ae
Author: Christian Persch <chpe gnome org>
Date:   Mon Nov 30 17:23:34 2015 +0100

    widget: Move some methods to VteTerminalPrivate

 src/vte.cc         |   32 +++++++++++++++-----------------
 src/vteinternal.hh |    2 ++
 2 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index c2c30c8..d03d574 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -4536,27 +4536,28 @@ VteTerminalPrivate::feed_child_binary(guint8 const* data,
        }
 }
 
-static void
-vte_terminal_feed_child_using_modes(VteTerminal *terminal,
-                                   const char *data, glong length)
+void
+VteTerminalPrivate::feed_child_using_modes(char const* data,
+                                           gssize length)
 {
-       if (length == ((gssize)-1)) {
+       if (length == -1)
                length = strlen(data);
-       }
-       if (length > 0) {
-               terminal->pvt->send_child(data, length,
-                                          !terminal->pvt->sendrecv_mode,
-                                          terminal->pvt->linefeed_mode);
-       }
+
+       if (length > 0)
+               send_child(data, length,
+                           !m_sendrecv_mode,
+                           m_linefeed_mode);
 }
 
 /* Send text from the input method to the child. */
 static void
-vte_terminal_im_commit(GtkIMContext *im_context, gchar *text, VteTerminal *terminal)
+vte_terminal_im_commit(GtkIMContext *im_context,
+                       char const* text,
+                       VteTerminal *terminal)
 {
        _vte_debug_print(VTE_DEBUG_EVENTS,
                        "Input method committed `%s'.\n", text);
-       vte_terminal_feed_child_using_modes(terminal, text, -1);
+       terminal->pvt->feed_child_using_modes(text, -1);
        /* Committed text was committed because the user pressed a key, so
         * we need to obey the scroll-on-keystroke setting. */
        if (terminal->pvt->scroll_on_keystroke) {
@@ -5171,9 +5172,7 @@ VteTerminalPrivate::widget_key_press(GdkEventKey *event)
                                                        1);
                        }
                        if (normal_length > 0) {
-                               vte_terminal_feed_child_using_modes(m_terminal,
-                                                                   normal,
-                                                                   normal_length);
+                               feed_child_using_modes(normal, normal_length);
                        }
                        g_free(normal);
                }
@@ -10016,8 +10015,7 @@ VteTerminalPrivate::widget_scroll(GdkEventScroll *event)
                if (cnt < 0)
                        cnt = -cnt;
                for (i = 0; i < cnt; i++) {
-                       vte_terminal_feed_child_using_modes (m_terminal,
-                                       normal, normal_length);
+                       feed_child_using_modes(normal, normal_length);
                }
                g_free (normal);
        } else {
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index dca0fa4..ea169d1 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -545,6 +545,8 @@ public:
                         gssize length,
                         bool local_echo,
                         bool newline_stuff);
+        void feed_child_using_modes(char const* data,
+                                    gssize length);
 
         void watch_child (GPid child_pid);
         void child_watch_done(GPid pid,


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