[vte] widget: Move some methods to VteTerminalPrivate



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

    widget: Move some methods to VteTerminalPrivate

 src/vte.cc         |   16 ++++++++--------
 src/vtegtk.cc      |   18 ++++++++++--------
 src/vtegtk.hh      |    2 ++
 src/vteinternal.hh |    2 ++
 4 files changed, 22 insertions(+), 16 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 93d1320..db68ff0 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -906,21 +906,21 @@ VteTerminalPrivate::emit_char_size_changed(int width,
 }
 
 /* Emit an "increase-font-size" signal. */
-static void
-vte_terminal_emit_increase_font_size(VteTerminal *terminal)
+void
+VteTerminalPrivate::emit_increase_font_size()
 {
        _vte_debug_print(VTE_DEBUG_SIGNALS,
                        "Emitting `increase-font-size'.\n");
-       g_signal_emit_by_name(terminal, "increase-font-size");
+       g_signal_emit(m_terminal, signals[SIGNAL_INCREASE_FONT_SIZE], 0);
 }
 
 /* Emit a "decrease-font-size" signal. */
-static void
-vte_terminal_emit_decrease_font_size(VteTerminal *terminal)
+void
+VteTerminalPrivate::emit_decrease_font_size()
 {
        _vte_debug_print(VTE_DEBUG_SIGNALS,
                        "Emitting `decrease-font-size'.\n");
-       g_signal_emit_by_name(terminal, "decrease-font-size");
+       g_signal_emit(m_terminal, signals[SIGNAL_DECREASE_FONT_SIZE], 0);
 }
 
 /* Emit a "text-inserted" signal. */
@@ -5190,12 +5190,12 @@ VteTerminalPrivate::widget_key_press(GdkEventKey *event)
                        if (m_modifiers & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) {
                                switch (keyval) {
                                case GDK_KEY_KP_Add:
-                                       vte_terminal_emit_increase_font_size(m_terminal);
+                                       emit_increase_font_size();
                                        handled = TRUE;
                                        suppress_meta_esc = TRUE;
                                        break;
                                case GDK_KEY_KP_Subtract:
-                                       vte_terminal_emit_decrease_font_size(m_terminal);
+                                       emit_decrease_font_size();
                                        handled = TRUE;
                                        suppress_meta_esc = TRUE;
                                        break;
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index 0dfb496..bb78ed2 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -987,6 +987,7 @@ vte_terminal_class_init(VteTerminalClass *klass)
          *
          * Emitted when the user hits the '+' key while holding the Control key.
          */
+        signals[SIGNAL_INCREASE_FONT_SIZE] =
        g_signal_new(I_("increase-font-size"),
                     G_OBJECT_CLASS_TYPE(klass),
                     G_SIGNAL_RUN_LAST,
@@ -1002,14 +1003,15 @@ vte_terminal_class_init(VteTerminalClass *klass)
          *
          * Emitted when the user hits the '-' key while holding the Control key.
          */
-       g_signal_new(I_("decrease-font-size"),
-                    G_OBJECT_CLASS_TYPE(klass),
-                    G_SIGNAL_RUN_LAST,
-                    G_STRUCT_OFFSET(VteTerminalClass, decrease_font_size),
-                    NULL,
-                    NULL,
-                    g_cclosure_marshal_VOID__VOID,
-                    G_TYPE_NONE, 0);
+        signals[SIGNAL_DECREASE_FONT_SIZE] =
+                g_signal_new(I_("decrease-font-size"),
+                             G_OBJECT_CLASS_TYPE(klass),
+                             G_SIGNAL_RUN_LAST,
+                             G_STRUCT_OFFSET(VteTerminalClass, decrease_font_size),
+                             NULL,
+                             NULL,
+                             g_cclosure_marshal_VOID__VOID,
+                             G_TYPE_NONE, 0);
 
         /**
          * VteTerminal::text-modified:
diff --git a/src/vtegtk.hh b/src/vtegtk.hh
index 86b8f1f..cab0743 100644
--- a/src/vtegtk.hh
+++ b/src/vtegtk.hh
@@ -33,9 +33,11 @@ enum {
         SIGNAL_CURRENT_DIRECTORY_URI_CHANGED,
         SIGNAL_CURRENT_FILE_URI_CHANGED,
         SIGNAL_CURSOR_MOVED,
+        SIGNAL_DECREASE_FONT_SIZE,
         SIGNAL_ENCODING_CHANGED,
         SIGNAL_EOF,
         SIGNAL_ICON_TITLE_CHANGED,
+        SIGNAL_INCREASE_FONT_SIZE,
         SIGNAL_SELECTION_CHANGED,
         SIGNAL_TEXT_DELETED,
         SIGNAL_TEXT_INSERTED,
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index a824452..63644fc 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -559,6 +559,8 @@ public:
         void emit_pending_signals();
         void emit_char_size_changed(int width,
                                     int height);
+        void emit_increase_font_size();
+        void emit_decrease_font_size();
 
         void process_incoming();
 


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