[vte/vte-next: 130/223] Move method to VteBuffer
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-next: 130/223] Move method to VteBuffer
- Date: Wed, 22 Jun 2011 20:59:31 +0000 (UTC)
commit a3f2cba22e8e5d113c4615bc057cfc83af28d8e3
Author: Christian Persch <chpe gnome org>
Date: Thu Jun 9 22:03:24 2011 +0200
Move method to VteBuffer
src/vte-private.h | 3 +--
src/vte.c | 25 ++++++++++++-------------
src/vteseq.c | 11 +++++++----
3 files changed, 20 insertions(+), 19 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index ea68cf5..842cb35 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -425,7 +425,6 @@ struct _VteTerminalClassPrivate {
GtkStyleProvider *style_provider;
};
-VteRowData *_vte_terminal_ensure_row(VteTerminal *terminal);
void _vte_terminal_set_pointer_visible(VteTerminal *terminal, gboolean visible);
void _vte_invalidate_all(VteTerminal *terminal);
void _vte_invalidate_cells(VteTerminal *terminal,
@@ -433,7 +432,6 @@ void _vte_invalidate_cells(VteTerminal *terminal,
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_adjust_adjustments(VteTerminal *terminal);
void _vte_terminal_queue_contents_changed(VteTerminal *terminal);
void _vte_terminal_emit_text_deleted(VteTerminal *terminal);
@@ -484,6 +482,7 @@ void _vte_buffer_clear_tabstop(VteBuffer *buffer, int column);
void _vte_buffer_clear_tabstops(VteBuffer *buffer);
gboolean _vte_buffer_get_tabstop(VteBuffer *buffer, int column);
void _vte_buffer_set_tabstop(VteBuffer *buffer, int column);
+VteRowData *_vte_buffer_ensure_row(VteBuffer *buffer);
/* private VteScreen methods */
void _vte_screen_set_default_attributes(VteScreen *screen);
diff --git a/src/vte.c b/src/vte.c
index 0f598d8..d07c689 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -2063,20 +2063,19 @@ vte_terminal_get_encoding(VteTerminal *terminal)
}
static inline VteRowData *
-vte_terminal_insert_rows (VteTerminal *terminal, guint cnt)
+vte_buffer_insert_rows (VteBuffer *buffer, guint cnt)
{
VteRowData *row;
do {
- row = _vte_buffer_ring_append (terminal->term_pvt->buffer, FALSE);
+ row = _vte_buffer_ring_append (buffer, FALSE);
} while(--cnt);
return row;
}
-
/* Make sure we have enough rows and columns to hold data at the current
* cursor position. */
VteRowData *
-_vte_terminal_ensure_row (VteTerminal *terminal)
+_vte_buffer_ensure_row (VteBuffer *buffer)
{
VteRowData *row;
VteScreen *screen;
@@ -2084,14 +2083,14 @@ _vte_terminal_ensure_row (VteTerminal *terminal)
glong v;
/* Must make sure we're in a sane area. */
- screen = terminal->pvt->screen;
+ screen = buffer->pvt->screen;
v = screen->cursor_current.row;
/* Figure out how many rows we need to add. */
delta = v - _vte_ring_next(screen->row_data) + 1;
if (delta > 0) {
- row = vte_terminal_insert_rows (terminal, delta);
- _vte_terminal_adjust_adjustments(terminal);
+ row = vte_buffer_insert_rows (buffer, delta);
+ _vte_terminal_adjust_adjustments(buffer->pvt->terminal);
} else {
/* Find the row the cursor is in. */
row = _vte_ring_index_writable (screen->row_data, v);
@@ -2106,7 +2105,7 @@ vte_terminal_ensure_cursor(VteTerminal *terminal)
{
VteRowData *row;
- row = _vte_terminal_ensure_row (terminal);
+ row = _vte_buffer_ensure_row (terminal->term_pvt->buffer);
_vte_row_data_fill (row, &basic_cell.cell, terminal->pvt->screen->cursor_current.col);
return row;
@@ -2127,7 +2126,7 @@ _vte_terminal_update_insert_delta(VteTerminal *terminal)
rows = _vte_ring_next (screen->row_data);
delta = screen->cursor_current.row - rows + 1;
if (G_UNLIKELY (delta > 0)) {
- vte_terminal_insert_rows (terminal, delta);
+ vte_buffer_insert_rows (terminal->term_pvt->buffer, delta);
rows = _vte_ring_next (screen->row_data);
}
@@ -2310,7 +2309,7 @@ vte_terminal_generate_bold(const GdkRGBA *foreground,
void
_vte_terminal_cleanup_tab_fragments_at_cursor (VteTerminal *terminal)
{
- VteRowData *row = _vte_terminal_ensure_row (terminal);
+ VteRowData *row = _vte_buffer_ensure_row (terminal->term_pvt->buffer);
VteScreen *screen = terminal->pvt->screen;
long col = screen->cursor_current.col;
const VteCell *pcell = _vte_row_data_get (row, col);
@@ -2357,7 +2356,7 @@ _vte_terminal_cursor_down (VteTerminal *terminal)
/* Match xterm and fill to the end of row when scrolling. */
if (screen->fill_defaults.attr.back != VTE_DEF_BG) {
VteRowData *rowdata;
- rowdata = _vte_terminal_ensure_row (terminal);
+ rowdata = _vte_buffer_ensure_row (terminal->term_pvt->buffer);
_vte_row_data_fill (rowdata, &screen->fill_defaults, terminal->pvt->column_count);
}
@@ -2402,7 +2401,7 @@ _vte_terminal_cursor_down (VteTerminal *terminal)
/* Match xterm and fill the new row when scrolling. */
if (screen->fill_defaults.attr.back != VTE_DEF_BG) {
VteRowData *rowdata;
- rowdata = _vte_terminal_ensure_row (terminal);
+ rowdata = _vte_buffer_ensure_row (terminal->term_pvt->buffer);
_vte_row_data_fill (rowdata, &screen->fill_defaults, terminal->pvt->column_count);
}
} else {
@@ -2463,7 +2462,7 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
/* XXX clear to the end of line */
col = screen->cursor_current.col = 0;
/* Mark this line as soft-wrapped. */
- row = _vte_terminal_ensure_row (terminal);
+ row = _vte_buffer_ensure_row (terminal->term_pvt->buffer);
row->attr.soft_wrapped = 1;
_vte_terminal_cursor_down (terminal);
} else {
diff --git a/src/vteseq.c b/src/vteseq.c
index 0d61b11..083b56b 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -1014,6 +1014,7 @@ vte_sequence_handler_bt (VteTerminal *terminal, GValueArray *params)
static void
vte_sequence_handler_cb (VteTerminal *terminal, GValueArray *params)
{
+ VteBuffer *buffer = terminal->term_pvt->buffer;
VteRowData *rowdata;
long i;
VteScreen *screen;
@@ -1021,7 +1022,7 @@ vte_sequence_handler_cb (VteTerminal *terminal, GValueArray *params)
screen = terminal->pvt->screen;
/* Get the data for the row which the cursor points to. */
- rowdata = _vte_terminal_ensure_row(terminal);
+ rowdata = _vte_buffer_ensure_row(buffer);
/* Clear the data up to the current column with the default
* attributes. If there is no such character cell, we need
* to add one. */
@@ -1101,12 +1102,13 @@ vte_sequence_handler_cd (VteTerminal *terminal, GValueArray *params)
static void
vte_sequence_handler_ce (VteTerminal *terminal, GValueArray *params)
{
+ VteBuffer *buffer = terminal->term_pvt->buffer;
VteRowData *rowdata;
VteScreen *screen;
screen = terminal->pvt->screen;
/* Get the data for the row which the cursor points to. */
- rowdata = _vte_terminal_ensure_row(terminal);
+ rowdata = _vte_buffer_ensure_row(buffer);
g_assert(rowdata != NULL);
/* Remove the data at the end of the array until the current column
* is the end of the array. */
@@ -1485,6 +1487,7 @@ vte_sequence_handler_eA (VteTerminal *terminal, GValueArray *params)
static void
vte_sequence_handler_ec (VteTerminal *terminal, GValueArray *params)
{
+ VteBuffer *buffer = terminal->term_pvt->buffer;
VteScreen *screen;
VteRowData *rowdata;
GValue *value;
@@ -1503,7 +1506,7 @@ vte_sequence_handler_ec (VteTerminal *terminal, GValueArray *params)
}
/* Clear out the given number of characters. */
- rowdata = _vte_terminal_ensure_row(terminal);
+ rowdata = _vte_buffer_ensure_row(buffer);
if (_vte_ring_next(screen->row_data) > screen->cursor_current.row) {
g_assert(rowdata != NULL);
/* Write over the characters. (If there aren't enough, we'll
@@ -2061,7 +2064,7 @@ vte_sequence_handler_ta (VteTerminal *terminal, GValueArray *params)
/* but make sure we don't move cursor back (bug #340631) */
if (col < newcol) {
- VteRowData *rowdata = _vte_terminal_ensure_row (terminal);
+ VteRowData *rowdata = _vte_buffer_ensure_row (buffer);
/* Smart tab handling: bug 353610
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]