[vte] widget: Move some methods to VteTerminalPrivate



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

    widget: Move some methods to VteTerminalPrivate

 src/vte-private.h |    6 ----
 src/vte.cc        |   83 ++++++++++++++++++----------------------------------
 src/vteseq.cc     |   18 ++++++------
 3 files changed, 38 insertions(+), 69 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 4fff894..c74fd16 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -54,12 +54,6 @@
 G_BEGIN_DECLS
 
 VteRowData *_vte_terminal_ensure_row(VteTerminal *terminal);
-void _vte_invalidate_all(VteTerminal *terminal);
-void _vte_invalidate_cells(VteTerminal *terminal,
-                          glong column_start, gint column_count,
-                          glong row_start, gint row_count);
-void _vte_invalidate_cell(VteTerminal *terminal, glong col, glong row);
-void _vte_invalidate_cursor_once(VteTerminal *terminal, gboolean periodic);
 VteRowData * _vte_new_row_data(VteTerminal *terminal);
 void _vte_terminal_queue_contents_changed(VteTerminal *terminal);
 void _vte_terminal_emit_text_deleted(VteTerminal *terminal);
diff --git a/src/vte.cc b/src/vte.cc
index 03baba9..8f31b12 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -359,15 +359,6 @@ VteTerminalPrivate::mouse_pixels_to_grid (long x,
         return true;
 }
 
-/* Cause certain cells to be repainted. */
-void
-_vte_invalidate_cells(VteTerminal *terminal,
-                     glong column_start, gint n_columns,
-                     glong row_start, gint n_rows)
-{
-        terminal->pvt->invalidate_cells(column_start, n_columns, row_start, n_rows);
-}
-
 void
 VteTerminalPrivate::invalidate_cells(vte::grid::column_t column_start,
                                      int n_columns,
@@ -449,15 +440,6 @@ VteTerminalPrivate::invalidate_cells(vte::grid::column_t column_start,
        _vte_debug_print (VTE_DEBUG_WORK, "!");
 }
 
-static void
-_vte_invalidate_region (VteTerminal *terminal,
-                       glong scolumn, glong ecolumn,
-                       glong srow, glong erow,
-                       gboolean block)
-{
-        terminal->pvt->invalidate_region(scolumn, ecolumn, srow, erow, block);
-}
-
 void
 VteTerminalPrivate::invalidate_region(vte::grid::column_t scolumn,
                                       vte::grid::column_t ecolumn,
@@ -545,7 +527,7 @@ _vte_terminal_scroll_region (VteTerminal *terminal,
        } else {
                /* We have to repaint the area which is to be
                 * scrolled. */
-               _vte_invalidate_cells(terminal,
+               terminal->pvt->invalidate_cells(
                                     0, terminal->pvt->column_count,
                                     row, count);
        }
@@ -673,13 +655,6 @@ VteTerminalPrivate::get_preedit_length(bool left_only)
        return i;
 }
 
-/* Cause the cell to be redrawn. */
-void
-_vte_invalidate_cell(VteTerminal *terminal, glong col, glong row)
-{
-        terminal->pvt->invalidate_cell(col, row);
-}
-
 void
 VteTerminalPrivate::invalidate_cell(vte::grid::column_t col,
                                     vte::grid::row_t row)
@@ -3111,7 +3086,7 @@ _vte_terminal_cleanup_fragments(VteTerminal *terminal,
                         cell_end->c = ' ';
                         cell_end->attr.fragment = 0;
                         cell_end->attr.columns = 1;
-                        _vte_invalidate_cells(terminal,
+                        terminal->pvt->invalidate_cells(
                                               end, 1,
                                               terminal->pvt->cursor.row, 1);
                 }
@@ -3137,7 +3112,7 @@ _vte_terminal_cleanup_fragments(VteTerminal *terminal,
                                                          "Cleaning CJK left half at %ld\n",
                                                          col);
                                         g_assert(start - col == 1);
-                                        _vte_invalidate_cells(terminal,
+                                        terminal->pvt->invalidate_cells(
                                                               col, 1,
                                                               terminal->pvt->cursor.row, 1);
                                 }
@@ -3194,7 +3169,7 @@ _vte_terminal_cursor_down (VteTerminal *terminal)
                                /* Update the display. */
                                _vte_terminal_scroll_region(terminal, start,
                                                           end - start + 1, -1);
-                               _vte_invalidate_cells(terminal,
+                               terminal->pvt->invalidate_cells(
                                                      0, terminal->pvt->column_count,
                                                      end - 2, 2);
                        }
@@ -3425,7 +3400,7 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
 
                /* Always invalidate since we put the mark on the *previous* cell
                 * and the higher level code doesn't know this. */
-               _vte_invalidate_cells(terminal,
+               terminal->pvt->invalidate_cells(
                                      col - columns,
                                      columns,
                                      row_num, 1);
@@ -3472,7 +3447,7 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
 
        /* Signal that this part of the window needs drawing. */
        if (G_UNLIKELY (invalidate_now)) {
-               _vte_invalidate_cells(terminal,
+               terminal->pvt->invalidate_cells(
                                col - columns,
                                insert ? terminal->pvt->column_count : columns,
                                 terminal->pvt->cursor.row, 1);
@@ -6492,7 +6467,7 @@ VteTerminalPrivate::widget_paste(GdkAtom board)
 static void
 vte_terminal_invalidate_selection (VteTerminal *terminal)
 {
-       _vte_invalidate_region (terminal,
+       terminal->pvt->invalidate_region(
                                terminal->pvt->selection_start.col,
                                terminal->pvt->selection_end.col,
                                terminal->pvt->selection_start.row,
@@ -6974,69 +6949,69 @@ vte_terminal_extend_selection(VteTerminal *terminal, long x, long y,
                        /* Update the selection area diff in block mode. */
 
                        /* The top band */
-                       _vte_invalidate_region (terminal,
+                       terminal->pvt->invalidate_region(
                                                MIN(sc->col, so->col),
                                                MAX(ec->col, eo->col),
                                                MIN(sc->row, so->row),
                                                MAX(sc->row, so->row) - 1,
-                                               TRUE);
+                                               true);
                        /* The bottom band */
-                       _vte_invalidate_region (terminal,
+                       terminal->pvt->invalidate_region(
                                                MIN(sc->col, so->col),
                                                MAX(ec->col, eo->col),
                                                MIN(ec->row, eo->row) + 1,
                                                MAX(ec->row, eo->row),
-                                               TRUE);
+                                               true);
                        /* The left band */
-                       _vte_invalidate_region (terminal,
+                       terminal->pvt->invalidate_region(
                                                MIN(sc->col, so->col),
                                                MAX(sc->col, so->col) - 1 + (VTE_TAB_WIDTH_MAX - 1),
                                                MIN(sc->row, so->row),
                                                MAX(ec->row, eo->row),
-                                               TRUE);
+                                               true);
                        /* The right band */
-                       _vte_invalidate_region (terminal,
+                       terminal->pvt->invalidate_region(
                                                MIN(ec->col, eo->col) + 1,
                                                MAX(ec->col, eo->col) + (VTE_TAB_WIDTH_MAX - 1),
                                                MIN(sc->row, so->row),
                                                MAX(ec->row, eo->row),
-                                               TRUE);
+                                               true);
                } else {
                        /* Update the selection area diff in non-block mode. */
 
                        /* The before band */
                        if (sc->row < so->row)
-                               _vte_invalidate_region (terminal,
+                               terminal->pvt->invalidate_region(
                                                        sc->col, so->col - 1,
                                                        sc->row, so->row,
-                                                       FALSE);
+                                                       false);
                        else if (sc->row > so->row)
-                               _vte_invalidate_region (terminal,
+                               terminal->pvt->invalidate_region(
                                                        so->col, sc->col - 1,
                                                        so->row, sc->row,
-                                                       FALSE);
+                                                       false);
                        else
-                               _vte_invalidate_region (terminal,
+                               terminal->pvt->invalidate_region(
                                                        MIN(sc->col, so->col), MAX(sc->col, so->col) - 1,
                                                        sc->row, sc->row,
-                                                       TRUE);
+                                                       true);
 
                        /* The after band */
                        if (ec->row < eo->row)
-                               _vte_invalidate_region (terminal,
+                               terminal->pvt->invalidate_region(
                                                        ec->col + 1, eo->col,
                                                        ec->row, eo->row,
-                                                       FALSE);
+                                                       false);
                        else if (ec->row > eo->row)
-                               _vte_invalidate_region (terminal,
+                               terminal->pvt->invalidate_region(
                                                        eo->col + 1, ec->col,
                                                        eo->row, ec->row,
-                                                       FALSE);
+                                                       false);
                        else
-                               _vte_invalidate_region (terminal,
+                               terminal->pvt->invalidate_region(
                                                        MIN(ec->col, eo->col) + 1, MAX(ec->col, eo->col),
                                                        ec->row, ec->row,
-                                                       TRUE);
+                                                       true);
                }
        }
 
@@ -10668,10 +10643,10 @@ _vte_terminal_select_text(VteTerminal *terminal,
        vte_terminal_copy_primary(terminal);
        terminal->pvt->emit_selection_changed();
 
-       _vte_invalidate_region (terminal,
+       terminal->pvt->invalidate_region(
                        MIN (start_col, end_col), MAX (start_col, end_col),
                        MIN (start_row, end_row), MAX (start_row, end_row),
-                       FALSE);
+                       false);
 
 }
 
diff --git a/src/vteseq.cc b/src/vteseq.cc
index b231d0b..5c96c06 100644
--- a/src/vteseq.cc
+++ b/src/vteseq.cc
@@ -328,7 +328,7 @@ _vte_terminal_clear_current_line (VteTerminal *terminal)
                 _vte_row_data_fill (rowdata, &terminal->pvt->fill_defaults, terminal->pvt->column_count);
                rowdata->attr.soft_wrapped = 0;
                /* Repaint this row. */
-               _vte_invalidate_cells(terminal,
+               terminal->pvt->invalidate_cells(
                                      0, terminal->pvt->column_count,
                                       terminal->pvt->cursor.row, 1);
        }
@@ -358,7 +358,7 @@ _vte_terminal_clear_above_current (VteTerminal *terminal)
                         _vte_row_data_fill (rowdata, &terminal->pvt->fill_defaults, 
terminal->pvt->column_count);
                        rowdata->attr.soft_wrapped = 0;
                        /* Repaint the row. */
-                       _vte_invalidate_cells(terminal,
+                       terminal->pvt->invalidate_cells(
                                        0, terminal->pvt->column_count, i, 1);
                }
        }
@@ -1082,7 +1082,7 @@ _vte_sequence_handler_cb (VteTerminal *terminal, GValueArray *params)
                }
        }
        /* Repaint this row. */
-       _vte_invalidate_cells(terminal,
+       terminal->pvt->invalidate_cells(
                               0, terminal->pvt->cursor.col+1,
                               terminal->pvt->cursor.row, 1);
 
@@ -1141,7 +1141,7 @@ _vte_sequence_handler_cd (VteTerminal *terminal, GValueArray *params)
                }
                rowdata->attr.soft_wrapped = 0;
                /* Repaint this row. */
-               _vte_invalidate_cells(terminal,
+               terminal->pvt->invalidate_cells(
                                      0, terminal->pvt->column_count,
                                      i, 1);
        }
@@ -1182,7 +1182,7 @@ _vte_sequence_handler_ce (VteTerminal *terminal, GValueArray *params)
        }
        rowdata->attr.soft_wrapped = 0;
        /* Repaint this row. */
-       _vte_invalidate_cells(terminal,
+       terminal->pvt->invalidate_cells(
                               terminal->pvt->cursor.col,
                              terminal->pvt->column_count -
                               terminal->pvt->cursor.col,
@@ -1388,7 +1388,7 @@ _vte_sequence_handler_dc (VteTerminal *terminal, GValueArray *params)
                                len = terminal->pvt->column_count;
                        }
                        /* Repaint this row. */
-                       _vte_invalidate_cells(terminal,
+                       terminal->pvt->invalidate_cells(
                                        col, len - col,
                                         terminal->pvt->cursor.row, 1);
                }
@@ -1483,7 +1483,7 @@ vte_sequence_handler_erase_characters (VteTerminal *terminal, GValueArray *param
                        }
                }
                /* Repaint this row. */
-               _vte_invalidate_cells(terminal,
+               terminal->pvt->invalidate_cells(
                                       terminal->pvt->cursor.col, count,
                                       terminal->pvt->cursor.row, 1);
        }
@@ -1770,7 +1770,7 @@ vte_sequence_handler_reverse_index (VteTerminal *terminal, GValueArray *params)
                _vte_terminal_ring_insert (terminal, start, TRUE);
                /* Update the display. */
                _vte_terminal_scroll_region(terminal, start, end - start + 1, 1);
-               _vte_invalidate_cells(terminal,
+               terminal->pvt->invalidate_cells(
                                      0, terminal->pvt->column_count,
                                      start, 2);
        } else {
@@ -1872,7 +1872,7 @@ vte_sequence_handler_tab (VteTerminal *terminal, GValueArray *params)
                        }
                }
 
-               _vte_invalidate_cells (terminal,
+               terminal->pvt->invalidate_cells(
                                 terminal->pvt->cursor.col,
                                 newcol - terminal->pvt->cursor.col,
                                 terminal->pvt->cursor.row, 1);


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