[vte] widget: Rename 'inner_border' to 'padding'
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] widget: Rename 'inner_border' to 'padding'
- Date: Thu, 27 Mar 2014 18:48:21 +0000 (UTC)
commit 9b13d57f59764ebcd2cc0fe78cdefdf1e8ce2baa
Author: Christian Persch <chpe gnome org>
Date: Sat May 7 20:01:26 2011 +0200
widget: Rename 'inner_border' to 'padding'
Preparation for the next commit.
src/vte-private.h | 2 +-
src/vte.c | 150 ++++++++++++++++++++++++++--------------------------
src/vteaccess.c | 10 ++--
src/vteapp.c | 42 +++++++-------
src/vteseq.c | 48 +++++++++---------
5 files changed, 126 insertions(+), 126 deletions(-)
---
diff --git a/src/vte-private.h b/src/vte-private.h
index 2cf8128..5e2e470 100644
--- a/src/vte-private.h
+++ b/src/vte-private.h
@@ -415,7 +415,7 @@ struct _VteTerminalPrivate {
glong strikethrough_position;
/* Style stuff */
- GtkBorder inner_border;
+ GtkBorder padding;
/* GtkScrollable impl */
GtkAdjustment *hadjustment; /* unused */
diff --git a/src/vte.c b/src/vte.c
index 34c9555..5b8aa6b 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -179,7 +179,7 @@ static gboolean in_update_timeout;
static GList *active_terminals;
static GTimer *process_timer;
-static const GtkBorder default_inner_border = { 1, 1, 1, 1 };
+static const GtkBorder default_padding = { 1, 1, 1, 1 };
/* process incoming data without copying */
static struct _vte_incoming_chunk *free_chunks;
@@ -402,21 +402,21 @@ _vte_invalidate_cells(VteTerminal *terminal,
*/
rect.x = column_start * terminal->pvt->char_width - 1;
if (column_start != 0) {
- rect.x += terminal->pvt->inner_border.left;
+ rect.x += terminal->pvt->padding.left;
}
- rect.width = (column_start + column_count) * terminal->pvt->char_width + 3 +
terminal->pvt->inner_border.left;
+ rect.width = (column_start + column_count) * terminal->pvt->char_width + 3 +
terminal->pvt->padding.left;
if (column_start + column_count == terminal->pvt->column_count) {
- rect.width += terminal->pvt->inner_border.right;
+ rect.width += terminal->pvt->padding.right;
}
rect.width -= rect.x;
rect.y = row_start * terminal->pvt->char_height - 1;
if (row_start != 0) {
- rect.y += terminal->pvt->inner_border.top;
+ rect.y += terminal->pvt->padding.top;
}
- rect.height = (row_start + row_count) * terminal->pvt->char_height + 2 +
terminal->pvt->inner_border.top;
+ rect.height = (row_start + row_count) * terminal->pvt->char_height + 2 + terminal->pvt->padding.top;
if (row_start + row_count == terminal->pvt->row_count) {
- rect.height += terminal->pvt->inner_border.bottom;
+ rect.height += terminal->pvt->padding.bottom;
}
rect.height -= rect.y;
@@ -3981,10 +3981,10 @@ next_match:
if (gtk_widget_get_realized (&terminal->widget)) {
GdkRectangle rect;
rect.x = terminal->pvt->screen->cursor_current.col *
- terminal->pvt->char_width + terminal->pvt->inner_border.left;
+ terminal->pvt->char_width + terminal->pvt->padding.left;
rect.width = terminal->pvt->char_width;
rect.y = (terminal->pvt->screen->cursor_current.row - delta) *
- terminal->pvt->char_height + terminal->pvt->inner_border.top;
+ terminal->pvt->char_height + terminal->pvt->padding.top;
rect.height = terminal->pvt->char_height;
gtk_im_context_set_cursor_location(terminal->pvt->im_context,
&rect);
@@ -4490,31 +4490,31 @@ vte_terminal_im_preedit_changed(GtkIMContext *im_context, VteTerminal *terminal)
}
static void
-vte_terminal_set_inner_border(VteTerminal *terminal)
+vte_terminal_set_padding(VteTerminal *terminal)
{
VteTerminalPrivate *pvt = terminal->pvt;
GtkWidget *widget = GTK_WIDGET(terminal);
GtkBorder *border = NULL;
- GtkBorder inner_border;
+ GtkBorder padding;
gtk_widget_style_get(widget, "inner-border", &border, NULL);
if (border != NULL) {
- inner_border = *border;
+ padding = *border;
gtk_border_free(border);
} else {
- inner_border = default_inner_border;
+ padding = default_padding;
}
_vte_debug_print(VTE_DEBUG_MISC,
"Setting inner-border to { %d, %d, %d, %d }\n",
- inner_border.left, inner_border.right,
- inner_border.top, inner_border.bottom);
+ padding.left, padding.right,
+ padding.top, padding.bottom);
- if (memcmp(&inner_border, &pvt->inner_border, sizeof(GtkBorder)) == 0)
+ if (memcmp(&padding, &pvt->padding, sizeof(GtkBorder)) == 0)
return;
- pvt->inner_border = inner_border;
+ pvt->padding = padding;
gtk_widget_queue_resize(widget);
}
@@ -4528,7 +4528,7 @@ vte_terminal_style_updated (GtkWidget *widget)
GTK_WIDGET_CLASS (vte_terminal_parent_class)->style_updated (widget);
vte_terminal_set_font(terminal, terminal->pvt->fontdesc);
- vte_terminal_set_inner_border(terminal);
+ vte_terminal_set_padding(terminal);
gtk_widget_style_get(widget, "cursor-aspect-ratio", &aspect, NULL);
if (aspect != terminal->pvt->cursor_aspect_ratio) {
@@ -5325,8 +5325,8 @@ _vte_terminal_xy_to_grid(VteTerminal *terminal,
long c, r;
/* FIXMEchpe: is this correct for RTL? */
- c = (x - pvt->inner_border.left) / pvt->char_width;
- r = (y - pvt->inner_border.top) / pvt->char_height;
+ c = (x - pvt->padding.left) / pvt->char_width;
+ r = (y - pvt->padding.top) / pvt->char_height;
if ((c < 0 || c >= pvt->column_count) ||
(r < 0 || r >= pvt->row_count))
@@ -5359,8 +5359,8 @@ _vte_terminal_size_to_grid_size(VteTerminal *terminal,
VteTerminalPrivate *pvt = terminal->pvt;
long n_cols, n_rows;
- n_cols = (w - pvt->inner_border.left - pvt->inner_border.right) / pvt->char_width;
- n_rows = (h - pvt->inner_border.top -pvt->inner_border.bottom) / pvt->char_height;
+ n_cols = (w - pvt->padding.left - pvt->padding.right) / pvt->char_width;
+ n_rows = (h - pvt->padding.top -pvt->padding.bottom) / pvt->char_height;
if (n_cols <= 0 || n_rows <= 0)
return FALSE;
@@ -5455,8 +5455,8 @@ vte_terminal_send_mouse_button_internal(VteTerminal *terminal,
{
int width = terminal->pvt->char_width;
int height = terminal->pvt->char_height;
- long col = (x - terminal->pvt->inner_border.left) / width;
- long row = (y - terminal->pvt->inner_border.top) / height;
+ long col = (x - terminal->pvt->padding.left) / width;
+ long row = (y - terminal->pvt->padding.top) / height;
vte_terminal_feed_mouse_event(terminal, button, FALSE /* not drag */, is_release, col, row);
}
@@ -5516,8 +5516,8 @@ vte_terminal_maybe_send_mouse_drag(VteTerminal *terminal, GdkEventMotion *event)
{
int width = terminal->pvt->char_width;
int height = terminal->pvt->char_height;
- long col = ((long) event->x - terminal->pvt->inner_border.left) / width;
- long row = ((long) event->y - terminal->pvt->inner_border.top) / height;
+ long col = ((long) event->x - terminal->pvt->padding.left) / width;
+ long row = ((long) event->y - terminal->pvt->padding.top) / height;
/* First determine if we even want to send notification. */
switch (event->type) {
@@ -6876,8 +6876,8 @@ vte_terminal_motion_notify(GtkWidget *widget, GdkEventMotion *event)
}
terminal = VTE_TERMINAL(widget);
- x = event->x - terminal->pvt->inner_border.left;
- y = event->y - terminal->pvt->inner_border.top;
+ x = event->x - terminal->pvt->padding.left;
+ y = event->y - terminal->pvt->padding.top;
width = terminal->pvt->char_width;
height = terminal->pvt->char_height;
@@ -6921,9 +6921,9 @@ vte_terminal_motion_notify(GtkWidget *widget, GdkEventMotion *event)
x, y, FALSE, FALSE);
/* Start scrolling if we need to. */
- if (event->y < terminal->pvt->inner_border.top ||
+ if (event->y < terminal->pvt->padding.top ||
event->y >= terminal->pvt->row_count * height +
- terminal->pvt->inner_border.top)
+ terminal->pvt->padding.top)
{
/* Give mouse wigglers something. */
vte_terminal_autoscroll(terminal);
@@ -6962,8 +6962,8 @@ vte_terminal_button_press(GtkWidget *widget, GdkEventButton *event)
terminal = VTE_TERMINAL(widget);
- x = event->x - terminal->pvt->inner_border.left;
- y = event->y - terminal->pvt->inner_border.top;
+ x = event->x - terminal->pvt->padding.left;
+ y = event->y - terminal->pvt->padding.top;
height = terminal->pvt->char_height;
width = terminal->pvt->char_width;
@@ -7130,8 +7130,8 @@ vte_terminal_button_release(GtkWidget *widget, GdkEventButton *event)
terminal = VTE_TERMINAL(widget);
- x = event->x - terminal->pvt->inner_border.left;
- y = event->y - terminal->pvt->inner_border.top;
+ x = event->x - terminal->pvt->padding.left;
+ y = event->y - terminal->pvt->padding.top;
vte_terminal_match_hilite(terminal, x, y);
@@ -7246,8 +7246,8 @@ vte_terminal_enter(GtkWidget *widget, GdkEventCrossing *event)
VteTerminal *terminal = VTE_TERMINAL (widget);
/* Hilite any matches. */
vte_terminal_match_hilite_show(terminal,
- event->x - terminal->pvt->inner_border.left,
- event->y - terminal->pvt->inner_border.top);
+ event->x - terminal->pvt->padding.left,
+ event->y - terminal->pvt->padding.top);
}
return ret;
}
@@ -8119,7 +8119,7 @@ vte_terminal_init(VteTerminal *terminal)
* window as unobscured initially. */
pvt->visibility_state = GDK_VISIBILITY_UNOBSCURED;
- pvt->inner_border = default_inner_border;
+ pvt->padding = default_padding;
#ifdef VTE_DEBUG
/* In debuggable mode, we always do this. */
@@ -8150,10 +8150,10 @@ vte_terminal_get_preferred_width(GtkWidget *widget,
*minimum_width = terminal->pvt->char_width * 1;
*natural_width = terminal->pvt->char_width * terminal->pvt->column_count;
- *minimum_width += terminal->pvt->inner_border.left +
- terminal->pvt->inner_border.right;
- *natural_width += terminal->pvt->inner_border.left +
- terminal->pvt->inner_border.right;
+ *minimum_width += terminal->pvt->padding.left +
+ terminal->pvt->padding.right;
+ *natural_width += terminal->pvt->padding.left +
+ terminal->pvt->padding.right;
_vte_debug_print(VTE_DEBUG_WIDGET_SIZE,
"[Terminal %p] minimum_width=%d, natural_width=%d for %ldx%ld cells.\n",
@@ -8180,10 +8180,10 @@ vte_terminal_get_preferred_height(GtkWidget *widget,
*minimum_height = terminal->pvt->char_height * 1;
*natural_height = terminal->pvt->char_height * terminal->pvt->row_count;
- *minimum_height += terminal->pvt->inner_border.left +
- terminal->pvt->inner_border.right;
- *natural_height += terminal->pvt->inner_border.left +
- terminal->pvt->inner_border.right;
+ *minimum_height += terminal->pvt->padding.left +
+ terminal->pvt->padding.right;
+ *natural_height += terminal->pvt->padding.left +
+ terminal->pvt->padding.right;
_vte_debug_print(VTE_DEBUG_WIDGET_SIZE,
"[Terminal %p] minimum_height=%d, natural_height=%d for %ldx%ld cells.\n",
@@ -8207,9 +8207,9 @@ vte_terminal_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
terminal = VTE_TERMINAL(widget);
- width = (allocation->width - (terminal->pvt->inner_border.left + terminal->pvt->inner_border.right)) /
+ width = (allocation->width - (terminal->pvt->padding.left + terminal->pvt->padding.right)) /
terminal->pvt->char_width;
- height = (allocation->height - (terminal->pvt->inner_border.top +
terminal->pvt->inner_border.bottom)) /
+ height = (allocation->height - (terminal->pvt->padding.top + terminal->pvt->padding.bottom)) /
terminal->pvt->char_height;
width = MAX(width, 1);
height = MAX(height, 1);
@@ -8826,8 +8826,8 @@ vte_terminal_fill_rectangle(VteTerminal *terminal,
gint height)
{
_vte_draw_fill_rectangle(terminal->pvt->draw,
- x + terminal->pvt->inner_border.left,
- y + terminal->pvt->inner_border.top,
+ x + terminal->pvt->padding.left,
+ y + terminal->pvt->padding.top,
width, height,
color, VTE_DRAW_OPAQUE);
}
@@ -8854,8 +8854,8 @@ vte_terminal_draw_rectangle(VteTerminal *terminal,
gint height)
{
_vte_draw_draw_rectangle(terminal->pvt->draw,
- x + terminal->pvt->inner_border.left,
- y + terminal->pvt->inner_border.top,
+ x + terminal->pvt->padding.left,
+ y + terminal->pvt->padding.top,
width, height,
color, VTE_DRAW_OPAQUE);
}
@@ -8894,8 +8894,8 @@ vte_terminal_draw_graphic(VteTerminal *terminal, vteunistr c,
_vte_draw_set_source_color_alpha (terminal->pvt->draw, &fg, VTE_DRAW_OPAQUE);
// FIXME wtf!?
- x += terminal->pvt->inner_border.left;
- y += terminal->pvt->inner_border.top;
+ x += terminal->pvt->padding.left;
+ y += terminal->pvt->padding.top;
upper_half = row_height / 2;
lower_half = row_height - upper_half;
@@ -9383,16 +9383,16 @@ vte_terminal_draw_cells(VteTerminal *terminal,
y = items[i].y;
for (; i < n && items[i].y == y; i++) {
/* Adjust for the border. */
- items[i].x += terminal->pvt->inner_border.left;
- items[i].y += terminal->pvt->inner_border.top;
+ items[i].x += terminal->pvt->padding.left;
+ items[i].y += terminal->pvt->padding.top;
columns += items[i].columns;
}
if (clear && (draw_default_bg || back != VTE_DEFAULT_BG)) {
gint bold_offset = _vte_draw_has_bold(terminal->pvt->draw,
VTE_DRAW_BOLD) ? 0 : bold;
_vte_draw_fill_rectangle(terminal->pvt->draw,
- x + terminal->pvt->inner_border.left,
- y + terminal->pvt->inner_border.top,
+ x + terminal->pvt->padding.left,
+ y + terminal->pvt->padding.top,
columns * column_width + bold_offset, row_height,
&bg, VTE_DRAW_OPAQUE);
}
@@ -9405,8 +9405,8 @@ vte_terminal_draw_cells(VteTerminal *terminal,
for (i = 0; i < n; i++) {
/* Deadjust for the border. */
- items[i].x -= terminal->pvt->inner_border.left;
- items[i].y -= terminal->pvt->inner_border.top;
+ items[i].x -= terminal->pvt->padding.left;
+ items[i].y -= terminal->pvt->padding.top;
}
/* Draw whatever SFX are required. */
@@ -9708,8 +9708,8 @@ vte_terminal_draw_rows(VteTerminal *terminal,
end_column = start_column + column_count;
/* clear the background */
- x = start_x + terminal->pvt->inner_border.left;
- y = start_y + terminal->pvt->inner_border.top;
+ x = start_x + terminal->pvt->padding.left;
+ y = start_y + terminal->pvt->padding.top;
row = start_row;
rows = row_count;
do {
@@ -10026,23 +10026,23 @@ vte_terminal_expand_region (VteTerminal *terminal, cairo_region_t *region, const
/* increase the paint by one pixel on all sides to force the
* inclusion of neighbouring cells */
- row = MAX(0, (area->y - terminal->pvt->inner_border.top - 1) / height);
- row_stop = MIN(howmany(area->height + area->y - terminal->pvt->inner_border.top + 1, height),
+ row = MAX(0, (area->y - terminal->pvt->padding.top - 1) / height);
+ row_stop = MIN(howmany(area->height + area->y - terminal->pvt->padding.top + 1, height),
terminal->pvt->row_count);
if (row_stop <= row) {
return;
}
- col = MAX(0, (area->x - terminal->pvt->inner_border.left - 1) / width);
- col_stop = MIN(howmany(area->width + area->x - terminal->pvt->inner_border.left + 1, width),
+ col = MAX(0, (area->x - terminal->pvt->padding.left - 1) / width);
+ col_stop = MIN(howmany(area->width + area->x - terminal->pvt->padding.left + 1, width),
terminal->pvt->column_count);
if (col_stop <= col) {
return;
}
- rect.x = col*width + terminal->pvt->inner_border.left;
+ rect.x = col*width + terminal->pvt->padding.left;
rect.width = (col_stop - col) * width;
- rect.y = row*height + terminal->pvt->inner_border.top;
+ rect.y = row*height + terminal->pvt->padding.top;
rect.height = (row_stop - row)*height;
/* the rect must be cell aligned to avoid overlapping XY bands */
@@ -10070,14 +10070,14 @@ vte_terminal_paint_area (VteTerminal *terminal, const GdkRectangle *area)
width = terminal->pvt->char_width;
height = terminal->pvt->char_height;
- row = MAX(0, (area->y - terminal->pvt->inner_border.top) / height);
- row_stop = MIN((area->height + area->y - terminal->pvt->inner_border.top) / height,
+ row = MAX(0, (area->y - terminal->pvt->padding.top) / height);
+ row_stop = MIN((area->height + area->y - terminal->pvt->padding.top) / height,
terminal->pvt->row_count);
if (row_stop <= row) {
return;
}
- col = MAX(0, (area->x - terminal->pvt->inner_border.left) / width);
- col_stop = MIN((area->width + area->x - terminal->pvt->inner_border.left) / width,
+ col = MAX(0, (area->x - terminal->pvt->padding.left) / width);
+ col_stop = MIN((area->width + area->x - terminal->pvt->padding.left) / width,
terminal->pvt->column_count);
if (col_stop <= col) {
return;
@@ -10089,8 +10089,8 @@ vte_terminal_paint_area (VteTerminal *terminal, const GdkRectangle *area)
" [(%d,%d)x(%d,%d) pixels]\n",
area->x, area->y, area->width, area->height,
col, row, col_stop - col, row_stop - row,
- col * width + terminal->pvt->inner_border.left,
- row * height + terminal->pvt->inner_border.top,
+ col * width + terminal->pvt->padding.left,
+ row * height + terminal->pvt->padding.top,
(col_stop - col) * width,
(row_stop - row) * height);
@@ -10306,8 +10306,8 @@ vte_terminal_paint_im_preedit_string(VteTerminal *terminal)
preedit = g_utf8_next_char(preedit);
}
_vte_draw_clear(terminal->pvt->draw,
- col * width + terminal->pvt->inner_border.left,
- row * height + terminal->pvt->inner_border.top,
+ col * width + terminal->pvt->padding.left,
+ row * height + terminal->pvt->padding.top,
width * columns,
height);
fore = screen->color_defaults.attr.fore;
diff --git a/src/vteaccess.c b/src/vteaccess.c
index 868771a..a905585 100644
--- a/src/vteaccess.c
+++ b/src/vteaccess.c
@@ -1866,7 +1866,7 @@ vte_terminal_accessible_set_size(AtkComponent *component,
VteTerminal *terminal;
gint columns, rows, char_width, char_height;
GtkWidget *widget;
- GtkBorder *inner_border;
+ GtkBorder *padding;
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE(component));
if (widget == NULL) {
@@ -1876,12 +1876,12 @@ vte_terminal_accessible_set_size(AtkComponent *component,
char_width = vte_terminal_get_char_width (terminal);
char_height = vte_terminal_get_char_height (terminal);
- gtk_widget_style_get (widget, "inner-border", &inner_border, NULL);
+ gtk_widget_style_get (widget, "inner-border", &padding, NULL);
/* If the size is an exact multiple of the cell size, use that,
* otherwise round down. */
- columns = (width - (inner_border ? (inner_border->left + inner_border->right) : 0)) / char_width;
- rows = (height - (inner_border ? (inner_border->top + inner_border->bottom) : 0)) / char_height;
- gtk_border_free (inner_border);
+ columns = (width - (padding ? (padding->left + padding->right) : 0)) / char_width;
+ rows = (height - (padding ? (padding->top + padding->bottom) : 0)) / char_height;
+ gtk_border_free (padding);
vte_terminal_set_size(terminal, columns, rows);
return (vte_terminal_get_row_count (terminal) == rows) &&
(vte_terminal_get_column_count (terminal) == columns);
diff --git a/src/vteapp.c b/src/vteapp.c
index eb55409..462fc52 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -65,7 +65,7 @@ char_size_changed(GtkWidget *widget, guint width, guint height, gpointer data)
{
GtkWindow *window;
GdkGeometry geometry;
- GtkBorder *inner_border;
+ GtkBorder *padding;
g_assert(GTK_IS_WINDOW(data));
g_assert(VTE_IS_TERMINAL(widget));
@@ -74,14 +74,14 @@ char_size_changed(GtkWidget *widget, guint width, guint height, gpointer data)
if (!gtk_widget_get_realized (GTK_WIDGET (window)))
return;
- gtk_widget_style_get (widget, "inner-border", &inner_border, NULL);
+ gtk_widget_style_get (widget, "inner-border", &padding, NULL);
geometry.width_inc = width;
geometry.height_inc = height;
- geometry.base_width = inner_border ? (inner_border->left + inner_border->right) : 0;
- geometry.base_height = inner_border ? (inner_border->top + inner_border->bottom) : 0;
+ geometry.base_width = padding ? (padding->left + padding->right) : 0;
+ geometry.base_height = padding ? (padding->top + padding->bottom) : 0;
geometry.min_width = geometry.base_width + width * 2;
geometry.min_height = geometry.base_height + height * 2;
- gtk_border_free (inner_border);
+ gtk_border_free (padding);
gtk_window_set_geometry_hints(window, widget, &geometry,
GDK_HINT_RESIZE_INC |
@@ -96,7 +96,7 @@ char_size_realized(GtkWidget *widget, gpointer data)
GtkWindow *window;
GdkGeometry geometry;
guint width, height;
- GtkBorder *inner_border;
+ GtkBorder *padding;
g_assert(GTK_IS_WINDOW(data));
g_assert(VTE_IS_TERMINAL(widget));
@@ -106,16 +106,16 @@ char_size_realized(GtkWidget *widget, gpointer data)
if (!gtk_widget_get_realized (GTK_WIDGET(window)))
return;
- gtk_widget_style_get (widget, "inner-border", &inner_border, NULL);
+ gtk_widget_style_get (widget, "inner-border", &padding, NULL);
width = vte_terminal_get_char_width (terminal);
height = vte_terminal_get_char_height (terminal);
geometry.width_inc = width;
geometry.height_inc = height;
- geometry.base_width = inner_border ? (inner_border->left + inner_border->right) : 0;
- geometry.base_height = inner_border ? (inner_border->top + inner_border->bottom) : 0;
+ geometry.base_width = padding ? (padding->left + padding->right) : 0;
+ geometry.base_height = padding ? (padding->top + padding->bottom) : 0;
geometry.min_width = geometry.base_width + width * 2;
geometry.min_height = geometry.base_height + height * 2;
- gtk_border_free (inner_border);
+ gtk_border_free (padding);
gtk_window_set_geometry_hints(window, widget, &geometry,
GDK_HINT_RESIZE_INC |
@@ -181,21 +181,21 @@ button_pressed(GtkWidget *widget, GdkEventButton *event, gpointer data)
VteTerminal *terminal;
char *match;
int tag;
- GtkBorder *inner_border;
+ GtkBorder *padding;
int char_width, char_height;
switch (event->button) {
case 3:
terminal = VTE_TERMINAL(widget);
- gtk_widget_style_get (widget, "inner-border", &inner_border, NULL);
+ gtk_widget_style_get (widget, "inner-border", &padding, NULL);
char_width = vte_terminal_get_char_width (terminal);
char_height = vte_terminal_get_char_height (terminal);
match = vte_terminal_match_check(terminal,
- (event->x - (inner_border ? inner_border->left : 0)) /
char_width,
- (event->y - (inner_border ? inner_border->top : 0)) /
char_height,
+ (event->x - (padding ? padding->left : 0)) / char_width,
+ (event->y - (padding ? padding->top : 0)) / char_height,
&tag);
- gtk_border_free (inner_border);
+ gtk_border_free (padding);
if (match != NULL) {
g_print("Matched `%s' (%d).\n", match, tag);
g_free(match);
@@ -302,7 +302,7 @@ resize_window(GtkWidget *widget, guint width, guint height, gpointer data)
if ((GTK_IS_WINDOW(data)) && (width >= 2) && (height >= 2)) {
gint owidth, oheight, char_width, char_height, column_count, row_count;
- GtkBorder *inner_border;
+ GtkBorder *padding;
terminal = VTE_TERMINAL(widget);
@@ -313,17 +313,17 @@ resize_window(GtkWidget *widget, guint width, guint height, gpointer data)
char_height = vte_terminal_get_char_height (terminal);
column_count = vte_terminal_get_column_count (terminal);
row_count = vte_terminal_get_row_count (terminal);
- gtk_widget_style_get (widget, "inner-border", &inner_border, NULL);
+ gtk_widget_style_get (widget, "inner-border", &padding, NULL);
owidth -= char_width * column_count;
oheight -= char_height * row_count;
- if (inner_border != NULL) {
- owidth -= inner_border->left + inner_border->right;
- oheight -= inner_border->top + inner_border->bottom;
+ if (padding != NULL) {
+ owidth -= padding->left + padding->right;
+ oheight -= padding->top + padding->bottom;
}
gtk_window_resize(GTK_WINDOW(data),
width + owidth, height + oheight);
- gtk_border_free (inner_border);
+ gtk_border_free (padding);
}
}
diff --git a/src/vteseq.c b/src/vteseq.c
index e259b9f..1754a62 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -896,12 +896,12 @@ vte_sequence_handler_decset_internal(VteTerminal *terminal,
vte_terminal_emit_resize_window(terminal,
(set ? 132 : 80) *
terminal->pvt->char_width +
- terminal->pvt->inner_border.left +
- terminal->pvt->inner_border.right,
+ terminal->pvt->padding.left +
+ terminal->pvt->padding.right,
terminal->pvt->row_count *
terminal->pvt->char_height +
- terminal->pvt->inner_border.top +
- terminal->pvt->inner_border.bottom);
+ terminal->pvt->padding.top +
+ terminal->pvt->padding.bottom);
/* Request a resize and redraw. */
_vte_invalidate_all(terminal);
}
@@ -3382,11 +3382,11 @@ vte_sequence_handler_window_manipulation (VteTerminal *terminal, GValueArray *pa
arg2, arg1);
vte_terminal_emit_resize_window(terminal,
arg2 +
- terminal->pvt->inner_border.left +
- terminal->pvt->inner_border.right,
+ terminal->pvt->padding.left +
+ terminal->pvt->padding.right,
arg1 +
- terminal->pvt->inner_border.top +
- terminal->pvt->inner_border.bottom);
+ terminal->pvt->padding.top +
+ terminal->pvt->padding.bottom);
i += 2;
}
break;
@@ -3412,11 +3412,11 @@ vte_sequence_handler_window_manipulation (VteTerminal *terminal, GValueArray *pa
arg2, arg1);
vte_terminal_emit_resize_window(terminal,
arg2 * terminal->pvt->char_width +
- terminal->pvt->inner_border.left +
- terminal->pvt->inner_border.right,
+ terminal->pvt->padding.left +
+ terminal->pvt->padding.right,
arg1 * terminal->pvt->char_height +
- terminal->pvt->inner_border.top +
- terminal->pvt->inner_border.bottom);
+ terminal->pvt->padding.top +
+ terminal->pvt->padding.bottom);
i += 2;
}
break;
@@ -3454,8 +3454,8 @@ vte_sequence_handler_window_manipulation (VteTerminal *terminal, GValueArray *pa
&width, &height);
g_snprintf(buf, sizeof(buf),
_VTE_CAP_CSI "3;%d;%dt",
- width + terminal->pvt->inner_border.left,
- height + terminal->pvt->inner_border.top);
+ width + terminal->pvt->padding.left,
+ height + terminal->pvt->padding.top);
_vte_debug_print(VTE_DEBUG_PARSE,
"Reporting window location"
"(%d++,%d++).\n",
@@ -3468,16 +3468,16 @@ vte_sequence_handler_window_manipulation (VteTerminal *terminal, GValueArray *pa
g_snprintf(buf, sizeof(buf),
_VTE_CAP_CSI "4;%d;%dt",
allocation.height -
- (terminal->pvt->inner_border.top +
- terminal->pvt->inner_border.bottom),
+ (terminal->pvt->padding.top +
+ terminal->pvt->padding.bottom),
allocation.width -
- (terminal->pvt->inner_border.left +
- terminal->pvt->inner_border.right));
+ (terminal->pvt->padding.left +
+ terminal->pvt->padding.right));
_vte_debug_print(VTE_DEBUG_PARSE,
"Reporting window size "
"(%dx%dn",
- width - (terminal->pvt->inner_border.left +
terminal->pvt->inner_border.right),
- height - (terminal->pvt->inner_border.top +
terminal->pvt->inner_border.bottom));
+ width - (terminal->pvt->padding.left + terminal->pvt->padding.right),
+ height - (terminal->pvt->padding.top +
terminal->pvt->padding.bottom));
vte_terminal_feed_child(terminal, buf, -1);
break;
case 18:
@@ -3537,11 +3537,11 @@ vte_sequence_handler_window_manipulation (VteTerminal *terminal, GValueArray *pa
* rows. */
vte_terminal_emit_resize_window(terminal,
terminal->pvt->column_count *
terminal->pvt->char_width +
- terminal->pvt->inner_border.left +
- terminal->pvt->inner_border.right,
+ terminal->pvt->padding.left +
+ terminal->pvt->padding.right,
param * terminal->pvt->char_height +
- terminal->pvt->inner_border.top +
- terminal->pvt->inner_border.bottom);
+ terminal->pvt->padding.top +
+ terminal->pvt->padding.bottom);
}
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]