[vte] widget: Move some methods to VteTerminalPrivate



commit bfa4a2bf60d60840380ae452a58bed8c95f47e7d
Author: Christian Persch <chpe gnome org>
Date:   Wed Nov 18 21:15:40 2015 +0100

    widget: Move some methods to VteTerminalPrivate

 src/vte-private.h  |    2 --
 src/vte.cc         |   20 +++++---------------
 src/vteinternal.hh |    3 +++
 src/vteseq.cc      |    2 +-
 4 files changed, 9 insertions(+), 18 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 43be713..5e25f50 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -84,8 +84,6 @@ gboolean _vte_terminal_get_tabstop(VteTerminal *terminal, int column);
 void _vte_terminal_set_tabstop(VteTerminal *terminal, int column);
 void _vte_terminal_update_insert_delta(VteTerminal *terminal);
 void _vte_terminal_cleanup_fragments(VteTerminal *terminal, long start, long end);
-void _vte_terminal_audible_beep(VteTerminal *terminal);
-void _vte_terminal_beep(VteTerminal *terminal);
 PangoColor *_vte_terminal_get_color(const VteTerminal *terminal, int idx);
 void _vte_terminal_set_color_internal(VteTerminal *terminal,
                                       int idx,
diff --git a/src/vte.cc b/src/vte.cc
index 122952f..0d0aad2 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -5442,24 +5442,14 @@ VteTerminalPrivate::check_cursor_blink()
 }
 
 void
-_vte_terminal_audible_beep(VteTerminal *terminal)
+VteTerminalPrivate::beep()
 {
-       GdkDisplay *display;
-
-       g_assert(VTE_IS_TERMINAL(terminal));
-       display = gtk_widget_get_display(&terminal->widget);
-       gdk_display_beep(display);
-}
-
-void
-_vte_terminal_beep(VteTerminal *terminal)
-{
-       if (terminal->pvt->audible_bell) {
-               _vte_terminal_audible_beep (terminal);
+       if (m_audible_bell) {
+                GdkDisplay *display = gtk_widget_get_display(m_widget);
+                gdk_display_beep(display);
        }
 }
 
-
 static guint
 vte_translate_ctrlkey (GdkEventKey *event)
 {
@@ -5564,7 +5554,7 @@ vte_terminal_key_press(GtkWidget *widget, GdkEventKey *event)
                         if ((terminal->pvt->cursor.col +
                             (glong) terminal->pvt->bell_margin) ==
                             terminal->pvt->column_count) {
-                               _vte_terminal_beep (terminal);
+                               terminal->pvt->beep();
                        }
                }
 
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 9e69141..7f55ada 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -460,6 +460,8 @@ public:
 
         void set_pointer_visible(bool visible);
 
+        void beep();
+
         void match_contents_clear();
         void match_contents_refresh();
         void set_cursor_from_regex_match(struct vte_match_regex *regex);
@@ -591,3 +593,4 @@ public:
 #define m_mouse_mousing_cursor mouse_mousing_cursor
 #define m_mouse_default_cursor mouse_default_cursor
 #define m_mouse_inviso_cursor mouse_inviso_cursor
+#define m_audible_bell audible_bell
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 93312b2..e53dd8c 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -1024,7 +1024,7 @@ vte_sequence_handler_shift_out (VteTerminal *terminal, GValueArray *params)
 static void
 vte_sequence_handler_bell (VteTerminal *terminal, GValueArray *params)
 {
-       _vte_terminal_beep (terminal);
+       terminal->pvt->beep();
        g_signal_emit_by_name(terminal, "bell");
 }
 


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