[vte] widget: Move some methods to VteTerminalPrivate



commit c5882a0307e11e81d521822f3332830f9fc876d1
Author: Christian Persch <chpe gnome org>
Date:   Sun Jan 31 15:08:45 2016 +0100

    widget: Move some methods to VteTerminalPrivate

 src/vte.cc |   68 ++++++++++++++++++++++++++++-------------------------------
 1 files changed, 32 insertions(+), 36 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 2adc164..b33dc74 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -81,12 +81,6 @@ typedef gunichar wint_t;
 #define I_(string) (g_intern_static_string(string))
 
 static int _vte_unichar_width(gunichar c, int utf8_ambiguous_width);
-static gboolean vte_terminal_io_read_cb(GIOChannel *channel,
-                                        GIOCondition condition,
-                                        VteTerminal *terminal);
-static gboolean vte_terminal_io_write_cb(GIOChannel *channel,
-                                         GIOCondition condition,
-                                         VteTerminal *terminal);
 static void stop_processing(VteTerminalPrivate *that);
 static void add_process_timeout(VteTerminalPrivate *that);
 static void add_update_timeout(VteTerminalPrivate *that);
@@ -3382,10 +3376,20 @@ VteTerminalPrivate::child_watch_done(GPid pid,
         g_object_thaw_notify(object);
 }
 
-static void mark_input_source_invalid(VteTerminal *terminal)
+static void
+mark_input_source_invalid_cb(VteTerminalPrivate *that)
+{
+       _vte_debug_print (VTE_DEBUG_IO, "removed poll of io_read_cb\n");
+       that->m_pty_input_source = 0;
+}
+
+/* Read and handle data from the child. */
+static gboolean
+io_read_cb(GIOChannel *channel,
+           GIOCondition condition,
+           VteTerminalPrivate *that)
 {
-       _vte_debug_print (VTE_DEBUG_IO, "removed poll of vte_terminal_io_read\n");
-       terminal->pvt->m_pty_input_source = 0;
+        return that->pty_io_read(channel, condition);
 }
 
 void
@@ -3400,16 +3404,26 @@ VteTerminalPrivate::connect_pty_read()
                        g_io_add_watch_full(m_pty_channel,
                                            VTE_CHILD_INPUT_PRIORITY,
                                            (GIOCondition)(G_IO_IN | G_IO_PRI | G_IO_HUP),
-                                           (GIOFunc)vte_terminal_io_read_cb,
-                                           m_terminal,
-                                           (GDestroyNotify) mark_input_source_invalid);
+                                           (GIOFunc)io_read_cb,
+                                           this,
+                                           (GDestroyNotify)mark_input_source_invalid_cb);
        }
 }
 
-static void mark_output_source_invalid(VteTerminal *terminal)
+static void
+mark_output_source_invalid_cb(VteTerminalPrivate *that)
+{
+       _vte_debug_print (VTE_DEBUG_IO, "removed poll of io_write_cb\n");
+       that->m_pty_output_source = 0;
+}
+
+/* Send locally-encoded characters to the child. */
+static gboolean
+io_write_cb(GIOChannel *channel,
+            GIOCondition condition,
+            VteTerminalPrivate *that)
 {
-       _vte_debug_print (VTE_DEBUG_IO, "removed poll of vte_terminal_io_write\n");
-       terminal->pvt->m_pty_output_source = 0;
+        return that->pty_io_write(channel, condition);
 }
 
 void
@@ -3431,9 +3445,9 @@ VteTerminalPrivate::connect_pty_write()
                                g_io_add_watch_full(m_pty_channel,
                                                    VTE_CHILD_OUTPUT_PRIORITY,
                                                    G_IO_OUT,
-                                                   (GIOFunc)vte_terminal_io_write_cb,
-                                                   m_terminal,
-                                                   (GDestroyNotify) mark_output_source_invalid);
+                                                   (GIOFunc)io_write_cb,
+                                                   this,
+                                                   (GDestroyNotify)mark_output_source_invalid_cb);
                }
        }
 }
@@ -4068,15 +4082,6 @@ VteTerminalPrivate::feed_chunks(struct _vte_incoming_chunk *chunks)
        m_incoming = chunks;
 }
 
-/* Read and handle data from the child. */
-static gboolean
-vte_terminal_io_read_cb(GIOChannel *channel,
-                        GIOCondition condition,
-                        VteTerminal *terminal)
-{
-        return terminal->pvt->pty_io_read(channel, condition);
-}
-
 bool
 VteTerminalPrivate::pty_io_read(GIOChannel *channel,
                                 GIOCondition condition)
@@ -4291,15 +4296,6 @@ VteTerminalPrivate::feed(char const* data,
        }
 }
 
-/* Send locally-encoded characters to the child. */
-static gboolean
-vte_terminal_io_write_cb(GIOChannel *channel,
-                         GIOCondition condition,
-                         VteTerminal *terminal)
-{
-        return terminal->pvt->pty_io_write(channel, condition);
-}
-
 bool
 VteTerminalPrivate::pty_io_write(GIOChannel *channel,
                                  GIOCondition condition)


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