[vte] widget: Move some methods to VteTerminalPrivate



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

    widget: Move some methods to VteTerminalPrivate

 src/vte.cc         |   14 +++++++-------
 src/vtegtk.cc      |   17 +++++++++--------
 src/vtegtk.hh      |    1 +
 src/vteinternal.hh |    2 ++
 4 files changed, 19 insertions(+), 15 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 76e8332..93d1320 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -894,15 +894,15 @@ VteTerminalPrivate::queue_eof()
 }
 
 /* Emit a "char-size-changed" signal. */
-static void
-vte_terminal_emit_char_size_changed(VteTerminal *terminal,
-                                   guint width, guint height)
+void
+VteTerminalPrivate::emit_char_size_changed(int width,
+                                           int height)
 {
        _vte_debug_print(VTE_DEBUG_SIGNALS,
                        "Emitting `char-size-changed'.\n");
-       g_signal_emit_by_name(terminal, "char-size-changed",
-                             width, height);
-/*         g_object_notify(G_OBJECT(terminal), "char-size"); */
+        /* FIXME on next API break, change the signature */
+       g_signal_emit(m_terminal, signals[SIGNAL_CHAR_SIZE_CHANGED], 0,
+                             (guint)width, (guint)height);
 }
 
 /* Emit an "increase-font-size" signal. */
@@ -7667,7 +7667,7 @@ vte_terminal_apply_metrics(VteTerminal *terminal,
        }
        /* Emit a signal that the font changed. */
        if (cresize) {
-               vte_terminal_emit_char_size_changed(terminal,
+               terminal->pvt->emit_char_size_changed(
                                                    terminal->pvt->char_width,
                                                    terminal->pvt->char_height);
        }
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index 8abd29b..0dfb496 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -782,14 +782,15 @@ vte_terminal_class_init(VteTerminalClass *klass)
          * Emitted whenever selection of a new font causes the values of the
          * %char_width or %char_height fields to change.
          */
-       g_signal_new(I_("char-size-changed"),
-                    G_OBJECT_CLASS_TYPE(klass),
-                    G_SIGNAL_RUN_LAST,
-                    G_STRUCT_OFFSET(VteTerminalClass, char_size_changed),
-                    NULL,
-                    NULL,
-                    _vte_marshal_VOID__UINT_UINT,
-                    G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
+        signals[SIGNAL_CHAR_SIZE_CHANGED] =
+                g_signal_new(I_("char-size-changed"),
+                             G_OBJECT_CLASS_TYPE(klass),
+                             G_SIGNAL_RUN_LAST,
+                             G_STRUCT_OFFSET(VteTerminalClass, char_size_changed),
+                             NULL,
+                             NULL,
+                             _vte_marshal_VOID__UINT_UINT,
+                             G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
 
         /**
          * VteTerminal::selection-changed:
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
index 808be1c..86b8f1f 100644
--- a/src/vtegtk.hh
+++ b/src/vtegtk.hh
@@ -26,6 +26,7 @@
 #pragma once
 
 enum {
+        SIGNAL_CHAR_SIZE_CHANGED,
         SIGNAL_CHILD_EXITED,
         SIGNAL_COMMIT,
         SIGNAL_CONTENTS_CHANGED,
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 96c1ed3..a824452 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -557,6 +557,8 @@ public:
         void emit_text_modified();
         void emit_text_scrolled(long delta);
         void emit_pending_signals();
+        void emit_char_size_changed(int width,
+                                    int height);
 
         void process_incoming();
 


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