[vte] widget: Move some methods to VteTerminalPrivate



commit 3d5391813bf6842d4d6842716657d68c12742c69
Author: Christian Persch <chpe gnome org>
Date:   Tue Nov 24 23:09:59 2015 +0100

    widget: Move some methods to VteTerminalPrivate

 src/vte-private.h  |    1 -
 src/vte.cc         |   23 +++++++++++------------
 src/vteinternal.hh |    3 +++
 src/vteseq.cc      |   12 ++++++------
 4 files changed, 20 insertions(+), 19 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 5557ea0..e51a41b 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -76,7 +76,6 @@ void _vte_terminal_scroll_region(VteTerminal *terminal,
                                 long row, glong count, glong delta);
 void _vte_terminal_set_default_attributes(VteTerminal *terminal);
 void _vte_terminal_update_insert_delta(VteTerminal *terminal);
-void _vte_terminal_cleanup_fragments(VteTerminal *terminal, long start, long end);
 
 void _vte_terminal_feed_focus_event(VteTerminal *terminal, gboolean in);
 
diff --git a/src/vte.cc b/src/vte.cc
index c141c46..4e37203 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -3021,8 +3021,7 @@ VteTerminalPrivate::set_colors(GdkRGBA const *foreground,
 }
 
 /*
- * _vte_terminal_cleanup_fragments:
- * @terminal: a #VteTerminal
+ * VteTerminalPrivate::cleanup_fragments:
  * @start: the starting column, inclusive
  * @end: the end column, exclusive
  *
@@ -3042,10 +3041,10 @@ VteTerminalPrivate::set_colors(GdkRGBA const *foreground,
  * because the caller can't reasonably be expected to take care of this.
  */
 void
-_vte_terminal_cleanup_fragments(VteTerminal *terminal,
-                                long start, long end)
+VteTerminalPrivate::cleanup_fragments(long start,
+                                      long end)
 {
-        VteRowData *row = terminal->pvt->ensure_row();
+        VteRowData *row = ensure_row();
         const VteCell *cell_start;
         VteCell *cell_end, *cell_col;
         gboolean cell_start_is_fragment;
@@ -3086,9 +3085,9 @@ _vte_terminal_cleanup_fragments(VteTerminal *terminal,
                         cell_end->c = ' ';
                         cell_end->attr.fragment = 0;
                         cell_end->attr.columns = 1;
-                        terminal->pvt->invalidate_cells(
+                        invalidate_cells(
                                               end, 1,
-                                              terminal->pvt->cursor.row, 1);
+                                              m_cursor.row, 1);
                 }
         }
 
@@ -3112,9 +3111,9 @@ _vte_terminal_cleanup_fragments(VteTerminal *terminal,
                                                          "Cleaning CJK left half at %ld\n",
                                                          col);
                                         g_assert(start - col == 1);
-                                        terminal->pvt->invalidate_cells(
+                                        invalidate_cells(
                                                               col, 1,
-                                                              terminal->pvt->cursor.row, 1);
+                                                              m_cursor.row, 1);
                                 }
                                 keep_going = FALSE;
                         }
@@ -3413,11 +3412,11 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
        g_assert(row != NULL);
 
        if (insert) {
-                _vte_terminal_cleanup_fragments (terminal, col, col);
+                terminal->pvt->cleanup_fragments(col, col);
                for (i = 0; i < columns; i++)
                         _vte_row_data_insert (row, col + i, &terminal->pvt->color_defaults);
        } else {
-                _vte_terminal_cleanup_fragments (terminal, col, col + columns);
+                terminal->pvt->cleanup_fragments(col, col + columns);
                _vte_row_data_fill (row, &basic_cell.cell, col + columns);
        }
 
@@ -3442,7 +3441,7 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
                col++;
        }
        if (_vte_row_data_length (row) > terminal->pvt->column_count)
-               _vte_terminal_cleanup_fragments (terminal, terminal->pvt->column_count, _vte_row_data_length 
(row));
+               terminal->pvt->cleanup_fragments(terminal->pvt->column_count, _vte_row_data_length (row));
        _vte_row_data_shrink (row, terminal->pvt->column_count);
 
        /* Signal that this part of the window needs drawing. */
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index d5d3ecf..28d3c8d 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -445,6 +445,9 @@ public:
         VteRowData *ensure_cursor();
         void update_insert_delta();
 
+        void cleanup_fragments(long start,
+                               long end);
+
         void invalidate(vte::grid::span s, bool block = false);
         void invalidate_cell(vte::grid::column_t column, vte::grid::row_t row);
         void invalidate_cells(vte::grid::column_t sc, int cc,
diff --git a/src/vteseq.cc b/src/vteseq.cc
index 2f71503..c1398b8 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -1067,7 +1067,7 @@ _vte_sequence_handler_cb (VteTerminal *terminal, GValueArray *params)
        /* Get the data for the row which the cursor points to. */
        rowdata = terminal->pvt->ensure_row();
         /* Clean up Tab/CJK fragments. */
-        _vte_terminal_cleanup_fragments (terminal, 0, terminal->pvt->cursor.col + 1);
+        terminal->pvt->cleanup_fragments(0, terminal->pvt->cursor.col + 1);
        /* Clear the data up to the current column with the default
         * attributes.  If there is no such character cell, we need
         * to add one. */
@@ -1109,7 +1109,7 @@ _vte_sequence_handler_cd (VteTerminal *terminal, GValueArray *params)
                rowdata = _vte_ring_index_writable (screen->row_data, i);
                 /* Clean up Tab/CJK fragments. */
                 if ((glong) _vte_row_data_length (rowdata) > terminal->pvt->cursor.col)
-                        _vte_terminal_cleanup_fragments (terminal, terminal->pvt->cursor.col, 
_vte_row_data_length (rowdata));
+                        terminal->pvt->cleanup_fragments(terminal->pvt->cursor.col, _vte_row_data_length 
(rowdata));
                /* Clear everything to the right of the cursor. */
                if (rowdata)
                         _vte_row_data_shrink (rowdata, terminal->pvt->cursor.col);
@@ -1169,7 +1169,7 @@ _vte_sequence_handler_ce (VteTerminal *terminal, GValueArray *params)
        g_assert(rowdata != NULL);
         if ((glong) _vte_row_data_length (rowdata) > terminal->pvt->cursor.col) {
                 /* Clean up Tab/CJK fragments. */
-                _vte_terminal_cleanup_fragments (terminal, terminal->pvt->cursor.col, _vte_row_data_length 
(rowdata));
+                terminal->pvt->cleanup_fragments(terminal->pvt->cursor.col, _vte_row_data_length (rowdata));
                 /* Remove the data at the end of the array until the current column
                  * is the end of the array. */
                 _vte_row_data_shrink (rowdata, terminal->pvt->cursor.col);
@@ -1381,7 +1381,7 @@ _vte_sequence_handler_dc (VteTerminal *terminal, GValueArray *params)
                /* Remove the column. */
                if (col < len) {
                         /* Clean up Tab/CJK fragments. */
-                        _vte_terminal_cleanup_fragments (terminal, col, col + 1);
+                        terminal->pvt->cleanup_fragments(col, col + 1);
                        _vte_row_data_remove (rowdata, col);
                         if (terminal->pvt->fill_defaults.attr.back != VTE_DEFAULT_BG) {
                                 _vte_row_data_fill (rowdata, &terminal->pvt->fill_defaults, 
terminal->pvt->column_count);
@@ -1465,7 +1465,7 @@ vte_sequence_handler_erase_characters (VteTerminal *terminal, GValueArray *param
         if (_vte_ring_next(screen->row_data) > terminal->pvt->cursor.row) {
                g_assert(rowdata != NULL);
                 /* Clean up Tab/CJK fragments. */
-                _vte_terminal_cleanup_fragments (terminal, terminal->pvt->cursor.col, 
terminal->pvt->cursor.col + count);
+                terminal->pvt->cleanup_fragments(terminal->pvt->cursor.col, terminal->pvt->cursor.col + 
count);
                /* Write over the characters.  (If there aren't enough, we'll
                 * need to create them.) */
                for (i = 0; i < count; i++) {
@@ -1515,7 +1515,7 @@ _vte_sequence_handler_insert_character (VteTerminal *terminal, GValueArray *para
 }
 
 /* Insert N blank characters. */
-/* TODOegmont: Insert them in a single run, so that we call _vte_terminal_cleanup_fragments only once. */
+/* TODOegmont: Insert them in a single run, so that we call cleanup_fragments only once. */
 static void
 vte_sequence_handler_insert_blank_characters (VteTerminal *terminal, GValueArray *params)
 {


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