[vte] widget: Move some methods to VteTerminalPrivate



commit 63e3cee107d5fa69ff80acb22dfeb190eede5541
Author: Christian Persch <chpe gnome org>
Date:   Thu Jan 14 17:05:34 2016 +0100

    widget: Move some methods to VteTerminalPrivate

 src/vteinternal.hh |    1 +
 src/vteseq.cc      |   23 +++++++++--------------
 2 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 3a8b5c4..f37c803 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -1105,6 +1105,7 @@ public:
         inline void seq_home_cursor();
         inline void seq_clear_screen();
         inline void seq_clear_current_line();
+        inline void seq_clear_above_current();
 };
 
 #define m_invalidated_all invalidated_all
diff --git a/src/vteseq.cc b/src/vteseq.cc
index a1d34f1..5c47160 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -285,32 +285,27 @@ VteTerminalPrivate::seq_clear_current_line()
 }
 
 /* Clear above the current line. */
-static void
-_vte_terminal_clear_above_current (VteTerminal *terminal)
+void
+VteTerminalPrivate::seq_clear_above_current()
 {
-       VteRowData *rowdata;
-       long i;
-       VteScreen *screen;
-       screen = terminal->pvt->screen;
        /* If the cursor is actually on the screen, clear data in the row
         * which corresponds to the cursor. */
-        for (i = screen->insert_delta; i < terminal->pvt->cursor.row; i++) {
-               if (_vte_ring_next(screen->row_data) > i) {
+        for (auto i = m_screen->insert_delta; i < m_cursor.row; i++) {
+                if (_vte_ring_next(m_screen->row_data) > i) {
                        /* Get the data for the row we're erasing. */
-                       rowdata = _vte_ring_index_writable (screen->row_data, i);
+                        auto rowdata = _vte_ring_index_writable(m_screen->row_data, i);
                        g_assert(rowdata != NULL);
                        /* Remove it. */
                        _vte_row_data_shrink (rowdata, 0);
                        /* Add new cells until we fill the row. */
-                        _vte_row_data_fill (rowdata, &terminal->pvt->fill_defaults, 
terminal->pvt->column_count);
+                        _vte_row_data_fill (rowdata, &m_fill_defaults, m_column_count);
                        rowdata->attr.soft_wrapped = 0;
                        /* Repaint the row. */
-                       terminal->pvt->invalidate_cells(
-                                       0, terminal->pvt->column_count, i, 1);
+                       invalidate_cells(0, m_column_count, i, 1);
                }
        }
        /* We've modified the display.  Make a note of it. */
-       terminal->pvt->text_deleted_flag = TRUE;
+        m_text_deleted_flag = TRUE;
 }
 
 /* Scroll the text, but don't move the cursor.  Negative = up, positive = down. */
@@ -2456,7 +2451,7 @@ vte_sequence_handler_erase_in_display (VteTerminal *terminal, GValueArray *param
                break;
        case 1:
                /* Clear above the current line. */
-               _vte_terminal_clear_above_current (terminal);
+               terminal->pvt->seq_clear_above_current();
                /* Clear everything to the left of the cursor, too. */
                /* FIXME: vttest. */
                 _vte_sequence_handler_cb (terminal, NULL);


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