[vte] widget: Move some methods to VteTerminalPrivate



commit f05a63142ccd99b7ca8430dc1f5af914278b321f
Author: Christian Persch <chpe gnome org>
Date:   Sun Nov 22 21:07:02 2015 +0100

    widget: Move some methods to VteTerminalPrivate

 src/vte.cc         |   11 ++++++-----
 src/vtegtk.cc      |   17 +++++++++--------
 src/vtegtk.hh      |    1 +
 src/vteinternal.hh |    1 +
 4 files changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 7caedf7..76e8332 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -872,7 +872,7 @@ vte_terminal_emit_eof(VteTerminal *terminal)
        gdk_threads_enter ();
         G_GNUC_END_IGNORE_DEPRECATIONS;
 
-       g_signal_emit_by_name(terminal, "eof");
+       g_signal_emit(terminal, signals[SIGNAL_EOF], 0);
 
         G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
        gdk_threads_leave ();
@@ -881,14 +881,15 @@ vte_terminal_emit_eof(VteTerminal *terminal)
        return FALSE;
 }
 /* Emit a "eof" signal. */
-static void
-vte_terminal_queue_eof(VteTerminal *terminal)
+// FIXMEchpe any particular reason not to handle this immediately?
+void
+VteTerminalPrivate::queue_eof()
 {
        _vte_debug_print(VTE_DEBUG_SIGNALS,
                        "Queueing `eof'.\n");
        g_idle_add_full (G_PRIORITY_HIGH,
                (GSourceFunc) vte_terminal_emit_eof,
-               g_object_ref (terminal),
+               g_object_ref(m_terminal),
                g_object_unref);
 }
 
@@ -3783,7 +3784,7 @@ vte_terminal_eof(GIOChannel *channel, VteTerminal *terminal)
         vte_terminal_set_pty(terminal, NULL);
 
        /* Emit a signal that we read an EOF. */
-       vte_terminal_queue_eof(terminal);
+       terminal->pvt->queue_eof();
 
         g_object_thaw_notify(object);
 }
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index f9a2b56..8abd29b 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -642,14 +642,15 @@ vte_terminal_class_init(VteTerminalClass *klass)
          * is running in the terminal.  This signal is frequently (but not
          * always) emitted with a #VteTerminal::child-exited signal.
          */
-       g_signal_new(I_("eof"),
-                    G_OBJECT_CLASS_TYPE(klass),
-                    G_SIGNAL_RUN_LAST,
-                    G_STRUCT_OFFSET(VteTerminalClass, eof),
-                    NULL,
-                    NULL,
-                    g_cclosure_marshal_VOID__VOID,
-                    G_TYPE_NONE, 0);
+        signals[SIGNAL_EOF] =
+                g_signal_new(I_("eof"),
+                             G_OBJECT_CLASS_TYPE(klass),
+                             G_SIGNAL_RUN_LAST,
+                             G_STRUCT_OFFSET(VteTerminalClass, eof),
+                             NULL,
+                             NULL,
+                             g_cclosure_marshal_VOID__VOID,
+                             G_TYPE_NONE, 0);
 
         /**
          * VteTerminal::child-exited:
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
index 3255eb5..808be1c 100644
--- a/src/vtegtk.hh
+++ b/src/vtegtk.hh
@@ -33,6 +33,7 @@ enum {
         SIGNAL_CURRENT_FILE_URI_CHANGED,
         SIGNAL_CURSOR_MOVED,
         SIGNAL_ENCODING_CHANGED,
+        SIGNAL_EOF,
         SIGNAL_ICON_TITLE_CHANGED,
         SIGNAL_SELECTION_CHANGED,
         SIGNAL_TEXT_DELETED,
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index fa39ee4..96c1ed3 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -550,6 +550,7 @@ public:
 
         void queue_cursor_moved();
         void queue_contents_changed();
+        void queue_eof();
 
         void emit_text_deleted();
         void emit_text_inserted();


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