[vte] widget: Move some methods to VteTerminalPrivate



commit 720022456476820d2003a10d28ecb06e2a56a35f
Author: Christian Persch <chpe gnome org>
Date:   Sun Nov 22 21:07:03 2015 +0100

    widget: Move some methods to VteTerminalPrivate

 src/vte.cc         |   23 +++++++++--------------
 src/vteinternal.hh |    1 +
 src/vteseq.cc      |    2 +-
 3 files changed, 11 insertions(+), 15 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index ee91bab..09fdd76 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -10231,23 +10231,18 @@ VteTerminalPrivate::set_cursor_shape(VteCursorShape shape)
 }
 
 /* DECSCUSR set cursor style */
-void
-_vte_terminal_set_cursor_style(VteTerminal *terminal, VteCursorStyle style)
+bool
+VteTerminalPrivate::set_cursor_style(VteCursorStyle style)
 {
-        VteTerminalPrivate *pvt;
-
-        g_return_if_fail(VTE_IS_TERMINAL(terminal));
-        pvt = terminal->pvt;
-
-        if (pvt->cursor_style == style)
-                return;
-
-        pvt->cursor_style = style;
-
-        pvt->update_cursor_blinks();
+        if (m_cursor_style == style)
+                return false;
 
+        m_cursor_style = style;
+        update_cursor_blinks();
         /* and this will also make cursor shape match the DECSCUSR style */
-        terminal->pvt->invalidate_cursor_once();
+        invalidate_cursor_once();
+
+        return true;
 }
 
 /*
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 8b72e72..eca275d 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -743,6 +743,7 @@ public:
                         gsize palette_size);
         bool set_cursor_blink_mode(VteCursorBlinkMode mode);
         bool set_cursor_shape(VteCursorShape shape);
+        bool set_cursor_style(VteCursorStyle style);
         bool set_delete_binding(VteEraseBinding binding);
         bool set_encoding(char const* codeset);
         bool set_font_desc(PangoFontDescription const* desc);
diff --git a/src/vteseq.cc b/src/vteseq.cc
index ee96c7d..b231d0b 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -2876,7 +2876,7 @@ vte_sequence_handler_set_cursor_style (VteTerminal *terminal, GValueArray *param
                 }
         }
 
-        _vte_terminal_set_cursor_style(terminal, (VteCursorStyle)style);
+        terminal->pvt->set_cursor_style((VteCursorStyle)style);
 }
 
 /* Perform a soft reset. */


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