[vte] Rename vtecell to VteCell as it's not a value type
- From: Behdad Esfahbod <behdad src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vte] Rename vtecell to VteCell as it's not a value type
- Date: Sun, 6 Sep 2009 02:06:55 +0000 (UTC)
commit 2ce6acc60f48a0ce929a222a49957e90c0b8e077
Author: Behdad Esfahbod <behdad behdad org>
Date: Sat Sep 5 20:12:14 2009 -0400
Rename vtecell to VteCell as it's not a value type
src/ring.c | 19 ++++++++++---------
src/ring.h | 20 ++++++++++----------
src/vte-private.h | 6 +++---
src/vte.c | 50 +++++++++++++++++++++++++-------------------------
src/vteseq.c | 16 ++++++++--------
5 files changed, 56 insertions(+), 55 deletions(-)
---
diff --git a/src/ring.c b/src/ring.c
index 03cd9eb..65c05f4 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -25,6 +25,7 @@
#include "debug.h"
#include "ring.h"
+
/*
* vtecells: A row's cell array
*/
@@ -34,30 +35,30 @@ struct _vtecells {
unsigned int alloc_size;
union {
vtecells *next;
- vtecell cells[1];
+ VteCell cells[1];
} p;
};
static inline vtecells *
-vtecells_for_cells (vtecell *cells)
+vtecells_for_cells (VteCell *cells)
{
return (vtecells *) (((char *) cells) - G_STRUCT_OFFSET (vtecells, p.cells));
}
-static vtecell *
-_vte_cells_realloc (vtecell *cells, unsigned int len)
+static VteCell *
+_vte_cells_realloc (VteCell *cells, unsigned int len)
{
vtecells *vcells = cells ? vtecells_for_cells (cells) : NULL;
unsigned int new_size = (1 << g_bit_storage (MAX (len, 80)));
- vcells = g_realloc (vcells, sizeof (vtecells) + len * sizeof (vtecell));
+ vcells = g_realloc (vcells, sizeof (vtecells) + len * sizeof (VteCell));
vcells->alloc_size = new_size;
return vcells->p.cells;
}
static void
-_vte_cells_free (vtecell *cells)
+_vte_cells_free (VteCell *cells)
{
vtecells *vcells = vtecells_for_cells (cells);
@@ -93,7 +94,7 @@ _vte_row_data_ensure (VteRowData *row, unsigned int len)
}
void
-_vte_row_data_insert (VteRowData *row, unsigned int col, const vtecell *cell)
+_vte_row_data_insert (VteRowData *row, unsigned int col, const VteCell *cell)
{
unsigned int i;
@@ -106,7 +107,7 @@ _vte_row_data_insert (VteRowData *row, unsigned int col, const vtecell *cell)
row->len++;
}
-void _vte_row_data_append (VteRowData *row, const vtecell *cell)
+void _vte_row_data_append (VteRowData *row, const VteCell *cell)
{
_vte_row_data_ensure (row, row->len + 1);
row->cells[row->len] = *cell;
@@ -124,7 +125,7 @@ void _vte_row_data_remove (VteRowData *row, unsigned int col)
row->len--;
}
-void _vte_row_data_fill (VteRowData *row, const vtecell *cell, unsigned int len)
+void _vte_row_data_fill (VteRowData *row, const VteCell *cell, unsigned int len)
{
if (row->len < len) {
unsigned int i = len - row->len;
diff --git a/src/ring.h b/src/ring.h
index ac79165..13f7c2e 100644
--- a/src/ring.h
+++ b/src/ring.h
@@ -71,15 +71,15 @@ typedef struct _vtecellattr {
/*
- * vtecell: A single cell's data
+ * VteCell: A single cell's data
*/
-typedef struct _vtecell {
+typedef struct _VteCell {
vteunistr c;
vtecellattr attr;
-} vtecell;
+} VteCell;
-static const vtecell basic_cell = {
+static const VteCell basic_cell = {
0,
{
1, /* columns */
@@ -105,16 +105,16 @@ static const vtecell basic_cell = {
*/
typedef struct _VteRowData {
- vtecell *cells;
+ VteCell *cells;
unsigned int len;
guchar soft_wrapped: 1;
} VteRowData;
-#define _vte_row_data_get(__row, __col) ((const vtecell *) _vte_row_data_get_writable (__row, __col))
+#define _vte_row_data_get(__row, __col) ((const VteCell *) _vte_row_data_get_writable (__row, __col))
#define _vte_row_data_length(__row) ((__row)->len + 0)
-static inline vtecell *
+static inline VteCell *
_vte_row_data_get_writable (VteRowData *row, unsigned int col)
{
if (G_UNLIKELY (row->len <= col))
@@ -123,10 +123,10 @@ _vte_row_data_get_writable (VteRowData *row, unsigned int col)
return &row->cells[col];
}
-void _vte_row_data_insert (VteRowData *row, unsigned int col, const vtecell *cell);
-void _vte_row_data_append (VteRowData *row, const vtecell *cell);
+void _vte_row_data_insert (VteRowData *row, unsigned int col, const VteCell *cell);
+void _vte_row_data_append (VteRowData *row, const VteCell *cell);
void _vte_row_data_remove (VteRowData *row, unsigned int col);
-void _vte_row_data_fill (VteRowData *row, const vtecell *cell, unsigned int len);
+void _vte_row_data_fill (VteRowData *row, const VteCell *cell, unsigned int len);
void _vte_row_data_shrink (VteRowData *row, unsigned int max_len);
diff --git a/src/vte-private.h b/src/vte-private.h
index 3c9d052..24702bc 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -226,13 +226,13 @@ struct _VteTerminalPrivate {
gboolean scrolling_restricted;
long scroll_delta; /* scroll offset */
long insert_delta; /* insertion offset */
- vtecell defaults; /* default characteristics
+ VteCell defaults; /* default characteristics
for insertion of any new
characters */
- vtecell color_defaults; /* original defaults
+ VteCell color_defaults; /* original defaults
plus the current
fore/back */
- vtecell fill_defaults; /* original defaults
+ VteCell fill_defaults; /* original defaults
plus the current
fore/back with no
character data */
diff --git a/src/vte.c b/src/vte.c
index 5589e75..8abdb08 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -493,11 +493,11 @@ _vte_terminal_find_row_data(VteTerminal *terminal, glong row)
return rowdata;
}
/* Find the character an the given position in the backscroll buffer. */
-static const vtecell *
+static const VteCell *
vte_terminal_find_charcell(VteTerminal *terminal, gulong col, glong row)
{
VteRowData *rowdata;
- const vtecell *ret = NULL;
+ const VteCell *ret = NULL;
VteScreen *screen;
screen = terminal->pvt->screen;
if (_vte_ring_contains(screen->row_data, row)) {
@@ -514,7 +514,7 @@ find_start_column (VteTerminal *terminal, glong col, glong row)
if (G_UNLIKELY (col < 0))
return col;
if (row_data != NULL) {
- const vtecell *cell = _vte_row_data_get (row_data, col);
+ const VteCell *cell = _vte_row_data_get (row_data, col);
while (cell != NULL && cell->c == FRAGMENT && col > 0) {
cell = _vte_row_data_get (row_data, --col);
}
@@ -529,7 +529,7 @@ find_end_column (VteTerminal *terminal, glong col, glong row)
if (G_UNLIKELY (col < 0))
return col;
if (row_data != NULL) {
- const vtecell *cell = _vte_row_data_get (row_data, col);
+ const VteCell *cell = _vte_row_data_get (row_data, col);
while (cell != NULL && cell->c == FRAGMENT && col > 0) {
cell = _vte_row_data_get (row_data, --col);
}
@@ -603,7 +603,7 @@ _vte_invalidate_cell(VteTerminal *terminal, glong col, glong row)
columns = 1;
row_data = _vte_terminal_find_row_data(terminal, row);
if (row_data != NULL) {
- const vtecell *cell;
+ const VteCell *cell;
cell = _vte_row_data_get (row_data, col);
if (cell != NULL) {
while (cell->c == FRAGMENT && col> 0) {
@@ -634,7 +634,7 @@ void
_vte_invalidate_cursor_once(VteTerminal *terminal, gboolean periodic)
{
VteScreen *screen;
- const vtecell *cell;
+ const VteCell *cell;
gssize preedit_width;
glong column, row;
gint columns;
@@ -2805,11 +2805,11 @@ _vte_terminal_cleanup_tab_fragments_at_cursor (VteTerminal *terminal)
VteRowData *row = _vte_terminal_ensure_row (terminal);
VteScreen *screen = terminal->pvt->screen;
long col = screen->cursor_current.col;
- const vtecell *pcell = _vte_row_data_get (row, col);
+ const VteCell *pcell = _vte_row_data_get (row, col);
if (G_UNLIKELY (pcell != NULL && pcell->c == '\t')) {
long i, num_columns;
- vtecell *cell = _vte_row_data_get_writable (row, col);
+ VteCell *cell = _vte_row_data_get_writable (row, col);
_vte_debug_print(VTE_DEBUG_MISC,
"Cleaning tab fragments at %ld",
@@ -2981,7 +2981,7 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
/* It's a combining mark */
long row_num;
- vtecell *cell;
+ VteCell *cell;
_vte_debug_print(VTE_DEBUG_PARSE, "combining U+%04X", c);
@@ -3060,14 +3060,14 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
* cells. (#514632) */
if (G_LIKELY (col > 0)) {
glong col2 = col - 1;
- vtecell *cell = _vte_row_data_get_writable (row, col2);
+ VteCell *cell = _vte_row_data_get_writable (row, col2);
while (cell != NULL && cell->c == FRAGMENT && col2 > 0)
cell = _vte_row_data_get_writable (row, --col2);
cell->attr.columns = col - col2;
}
{
glong col2 = col + columns;
- vtecell *cell = _vte_row_data_get_writable (row, col2);
+ VteCell *cell = _vte_row_data_get_writable (row, col2);
while (cell != NULL && cell->c == FRAGMENT) {
cell->attr.columns = 1;
cell->c = 0;
@@ -3079,7 +3079,7 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
attr.columns = columns;
if (G_UNLIKELY (c == '_' && terminal->pvt->flags.ul)) {
- const vtecell *pcell = _vte_row_data_get (row, col);
+ const VteCell *pcell = _vte_row_data_get (row, col);
/* Handle overstrike-style underlining. */
if (pcell->c != 0) {
/* restore previous contents */
@@ -3091,7 +3091,7 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
{
- vtecell *pcell = _vte_row_data_get_writable (row, col);
+ VteCell *pcell = _vte_row_data_get_writable (row, col);
pcell->c = c;
pcell->attr = attr;
col++;
@@ -3099,7 +3099,7 @@ _vte_terminal_insert_char(VteTerminal *terminal, gunichar c,
/* insert wide-char fragments */
for (i = 1; i < columns; i++) {
- vtecell *pcell = _vte_row_data_get_writable (row, col);
+ VteCell *pcell = _vte_row_data_get_writable (row, col);
pcell->c = FRAGMENT;
pcell->attr = attr;
col++;
@@ -5129,7 +5129,7 @@ static gboolean
vte_same_class(VteTerminal *terminal, glong acol, glong arow,
glong bcol, glong brow)
{
- const vtecell *pcell = NULL;
+ const VteCell *pcell = NULL;
gboolean word_char;
if ((pcell = vte_terminal_find_charcell(terminal, acol, arow)) != NULL && pcell->c != 0) {
word_char = vte_terminal_is_word_char(terminal, _vte_unistr_get_base (pcell->c));
@@ -5746,7 +5746,7 @@ vte_terminal_get_text_range_maybe_wrapped(VteTerminal *terminal,
{
long col, row, last_empty, last_emptycol, last_nonempty, last_nonemptycol;
VteScreen *screen;
- const vtecell *pcell = NULL;
+ const VteCell *pcell = NULL;
GString *string;
struct _VteCharAttributes attr;
struct vte_palette_entry fore, back, *palette;
@@ -6142,7 +6142,7 @@ vte_terminal_extend_selection_expand (VteTerminal *terminal)
long i, j;
VteScreen *screen;
VteRowData *rowdata;
- const vtecell *cell;
+ const VteCell *cell;
struct selection_cell_coords *sc, *ec;
if (terminal->pvt->selection_block_mode)
@@ -8548,7 +8548,7 @@ vte_terminal_realize(GtkWidget *widget)
static void
vte_terminal_determine_colors(VteTerminal *terminal,
- const vtecell *cell,
+ const VteCell *cell,
gboolean reverse,
gboolean highlight,
gboolean cursor,
@@ -9656,7 +9656,7 @@ _vte_terminal_map_pango_color(VteTerminal *terminal, PangoColor *color)
* the right thing. */
static void
_vte_terminal_fudge_pango_colors(VteTerminal *terminal, GSList *attributes,
- vtecell *cells, gssize n)
+ VteCell *cells, gssize n)
{
int i, sumlen = 0;
struct _fudge_cell_props{
@@ -9727,7 +9727,7 @@ _vte_terminal_fudge_pango_colors(VteTerminal *terminal, GSList *attributes,
/* Apply the attribute given in the PangoAttribute to the list of cells. */
static void
_vte_terminal_apply_pango_attr(VteTerminal *terminal, PangoAttribute *attr,
- vtecell *cells, guint n_cells)
+ VteCell *cells, guint n_cells)
{
guint i, ival;
PangoAttrInt *attrint;
@@ -9794,7 +9794,7 @@ _vte_terminal_pango_attribute_destroy(gpointer attr, gpointer data)
}
static void
_vte_terminal_translate_pango_cells(VteTerminal *terminal, PangoAttrList *attrs,
- vtecell *cells, guint n_cells)
+ VteCell *cells, guint n_cells)
{
PangoAttribute *attr;
PangoAttrIterator *attriter;
@@ -9848,7 +9848,7 @@ vte_terminal_draw_cells_with_attributes(VteTerminal *terminal,
gint column_width, gint height)
{
int i, j, cell_count;
- vtecell *cells;
+ VteCell *cells;
char scratch_buf[VTE_UTF8_BPC];
int fore, back;
@@ -9858,7 +9858,7 @@ vte_terminal_draw_cells_with_attributes(VteTerminal *terminal,
for (i = 0, cell_count = 0; i < n; i++) {
cell_count += g_unichar_to_utf8(items[i].c, scratch_buf);
}
- cells = g_new(vtecell, cell_count);
+ cells = g_new(VteCell, cell_count);
_vte_terminal_translate_pango_cells(terminal, attrs, cells, cell_count);
for (i = 0, j = 0; i < n; i++) {
vte_terminal_determine_colors(terminal, &cells[j],
@@ -9898,7 +9898,7 @@ vte_terminal_draw_rows(VteTerminal *terminal,
gboolean underline, nunderline, bold, nbold, hilite, nhilite, reverse,
selected, nselected, strikethrough, nstrikethrough;
guint item_count;
- const vtecell *cell;
+ const VteCell *cell;
VteRowData *row_data;
reverse = terminal->pvt->screen->reverse_mode;
@@ -10376,7 +10376,7 @@ vte_terminal_paint_cursor(VteTerminal *terminal)
{
VteScreen *screen;
GdkColor color;
- const vtecell *cell;
+ const VteCell *cell;
struct _vte_draw_text_request item;
int row, drow, col;
long width, height, delta, cursor_width;
diff --git a/src/vteseq.c b/src/vteseq.c
index 026572e..c21d42a 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -76,11 +76,11 @@ display_control_sequence(const char *name, GValueArray *params)
/* A couple are duplicated from vte.c, to keep them static... */
/* Find the character an the given position in the backscroll buffer. */
-static vtecell *
+static VteCell *
vte_terminal_find_charcell(VteTerminal *terminal, glong col, glong row)
{
VteRowData *rowdata;
- vtecell *ret = NULL;
+ VteCell *ret = NULL;
VteScreen *screen;
g_assert(VTE_IS_TERMINAL(terminal));
screen = terminal->pvt->screen;
@@ -998,7 +998,7 @@ vte_sequence_handler_cb (VteTerminal *terminal, GValueArray *params)
VteRowData *rowdata;
long i;
VteScreen *screen;
- vtecell *pcell;
+ VteCell *pcell;
screen = terminal->pvt->screen;
/* Get the data for the row which the cursor points to. */
@@ -1472,7 +1472,7 @@ vte_sequence_handler_ec (VteTerminal *terminal, GValueArray *params)
VteScreen *screen;
VteRowData *rowdata;
GValue *value;
- vtecell *cell;
+ VteCell *cell;
long col, i, count;
screen = terminal->pvt->screen;
@@ -2059,7 +2059,7 @@ vte_sequence_handler_ta (VteTerminal *terminal, GValueArray *params)
/* Get rid of trailing empty cells: bug 545924 */
if ((glong) _vte_row_data_length (rowdata) > col)
{
- const vtecell *cell;
+ const VteCell *cell;
guint i;
for (i = _vte_row_data_length (rowdata); (glong) i > col; i--) {
cell = _vte_row_data_get (rowdata, i - 1);
@@ -2071,7 +2071,7 @@ vte_sequence_handler_ta (VteTerminal *terminal, GValueArray *params)
if ((glong) _vte_row_data_length (rowdata) <= col)
{
- vtecell cell;
+ VteCell cell;
_vte_row_data_fill (rowdata, &screen->fill_defaults, col);
@@ -2144,7 +2144,7 @@ vte_sequence_handler_ts (VteTerminal *terminal, GValueArray *params)
static void
vte_sequence_handler_uc (VteTerminal *terminal, GValueArray *params)
{
- vtecell *cell;
+ VteCell *cell;
int column;
VteScreen *screen;
@@ -2964,7 +2964,7 @@ vte_sequence_handler_screen_alignment_test (VteTerminal *terminal, GValueArray *
long row;
VteRowData *rowdata;
VteScreen *screen;
- vtecell cell;
+ VteCell cell;
screen = terminal->pvt->screen;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]