diff -Naur -x '*.Po' -x '*.Plo' vte-0.12.2/src/vte-private.h vte-0.12.2.my/src/vte-private.h --- vte-0.12.2/src/vte-private.h 2008-08-20 13:48:44.000000000 +0200 +++ vte-0.12.2.my/src/vte-private.h 2008-08-09 20:57:00.000000000 +0200 @@ -53,7 +53,9 @@ #ident "$Id: vte-private.h 1253 2006-03-08 20:31:13Z behdad $" -#define VTE_PAD_WIDTH 1 +#define VTE_PAD_X 1 +#define VTE_PAD_Y 0 + #define VTE_TAB_WIDTH 8 #define VTE_LINE_WIDTH 1 #define VTE_LEGACY_COLOR_SET_SIZE 8 diff -Naur -x '*.Po' -x '*.Plo' vte-0.12.2/src/vte.c vte-0.12.2.my/src/vte.c --- vte-0.12.2/src/vte.c 2008-08-20 13:48:44.000000000 +0200 +++ vte-0.12.2.my/src/vte.c 2008-08-07 15:01:35.000000000 +0200 @@ -308,28 +308,28 @@ /* Convert the column and row start and end to pixel values * by multiplying by the size of a character cell. */ - rect.x = column_start * terminal->char_width + VTE_PAD_WIDTH; + rect.x = column_start * terminal->char_width + VTE_PAD_X; rect.width = column_count * terminal->char_width; if (column_start == 0) { /* Include the left border. */ - rect.x -= VTE_PAD_WIDTH; - rect.width += VTE_PAD_WIDTH; + rect.x -= VTE_PAD_X; + rect.width += VTE_PAD_X; } if (column_start + column_count == terminal->column_count) { /* Include the right border. */ - rect.width += VTE_PAD_WIDTH; + rect.width += VTE_PAD_X; } - rect.y = row_start * terminal->char_height + VTE_PAD_WIDTH; + rect.y = row_start * terminal->char_height + VTE_PAD_Y; rect.height = row_count * terminal->char_height; if (row_start == 0) { /* Include the top border. */ - rect.y -= VTE_PAD_WIDTH; - rect.height += VTE_PAD_WIDTH; + rect.y -= VTE_PAD_Y; + rect.height += VTE_PAD_Y; } if (row_start + row_count == terminal->row_count) { /* Include the bottom border. */ - rect.height += VTE_PAD_WIDTH; + rect.height += VTE_PAD_Y; } if (terminal->pvt->update_timer) { @@ -3246,11 +3246,11 @@ /* Tell the input method where the cursor is. */ if (GTK_WIDGET_REALIZED(GTK_WIDGET(terminal))) { rect.x = terminal->pvt->screen->cursor_current.col * - terminal->char_width + VTE_PAD_WIDTH; + terminal->char_width + VTE_PAD_X; rect.width = terminal->char_width; rect.y = (terminal->pvt->screen->cursor_current.row - terminal->pvt->screen->scroll_delta) * - terminal->char_height + VTE_PAD_WIDTH; + terminal->char_height + VTE_PAD_Y; rect.height = terminal->char_height; gtk_im_context_set_cursor_location(terminal->pvt->im_context, &rect); @@ -4663,8 +4663,8 @@ vte_terminal_send_mouse_button_internal(terminal, (event->type == GDK_BUTTON_PRESS) ? event->button : 0, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH); + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y); } /* Send a mouse motion notification. */ @@ -4687,11 +4687,11 @@ if (terminal->pvt->mouse_last_button == 0) { return; } - if ((floor((event->x - VTE_PAD_WIDTH) / + if ((floor((event->x - VTE_PAD_X) / terminal->char_width) == floor(terminal->pvt->mouse_last_x / terminal->char_width)) && - (floor((event->y - VTE_PAD_WIDTH) / + (floor((event->y - VTE_PAD_Y) / terminal->char_height) == floor(terminal->pvt->mouse_last_y / terminal->char_height))) { @@ -4739,9 +4739,9 @@ } /* Encode the cursor coordinates. */ - cx = 32 + CLAMP(1 + ((event->x - VTE_PAD_WIDTH) / terminal->char_width), + cx = 32 + CLAMP(1 + ((event->x - VTE_PAD_X) / terminal->char_width), 1, terminal->column_count); - cy = 32 + CLAMP(1 + ((event->y - VTE_PAD_WIDTH) / terminal->char_height), + cy = 32 + CLAMP(1 + ((event->y - VTE_PAD_Y) / terminal->char_height), 1, terminal->row_count);; /* Send event direct to the child, this is binary not text data */ @@ -5336,13 +5336,13 @@ /* Convert the event coordinates to cell coordinates. */ delta = terminal->pvt->screen->scroll_delta; - cellx = (event->x - VTE_PAD_WIDTH) / terminal->char_width; - celly = (event->y - VTE_PAD_WIDTH) / terminal->char_height + delta; + cellx = (event->x - VTE_PAD_X) / terminal->char_width; + celly = (event->y - VTE_PAD_Y) / terminal->char_height + delta; /* Record that we have the selection, and where it started. */ terminal->pvt->has_selection = TRUE; - terminal->pvt->selection_last.x = event->x - VTE_PAD_WIDTH; - terminal->pvt->selection_last.y = event->y - VTE_PAD_WIDTH + + terminal->pvt->selection_last.x = event->x - VTE_PAD_X; + terminal->pvt->selection_last.y = event->y - VTE_PAD_Y + (terminal->char_height * delta); /* Decide whether or not to restart on the next drag. */ @@ -5902,8 +5902,8 @@ if ((terminal->pvt->modifiers & GDK_SHIFT_MASK) || !event_mode) { vte_terminal_extend_selection(terminal, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH, + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y, FALSE); } else { vte_terminal_maybe_send_mouse_drag(terminal, @@ -5920,8 +5920,8 @@ } /* Start scrolling if we need to. */ - if ((event->y < VTE_PAD_WIDTH) || - (event->y > (widget->allocation.height - VTE_PAD_WIDTH))) { + if ((event->y < VTE_PAD_Y) || + (event->y > (widget->allocation.height - VTE_PAD_Y))) { switch (terminal->pvt->mouse_last_button) { case 1: if (!event_mode) { @@ -5941,12 +5941,12 @@ /* Hilite any matches. */ vte_terminal_match_hilite(terminal, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH); + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y); /* Save the pointer coordinates for later use. */ - terminal->pvt->mouse_last_x = event->x - VTE_PAD_WIDTH; - terminal->pvt->mouse_last_y = event->y - VTE_PAD_WIDTH; + terminal->pvt->mouse_last_x = event->x - VTE_PAD_X; + terminal->pvt->mouse_last_y = event->y - VTE_PAD_Y; return TRUE; } @@ -5993,8 +5993,8 @@ } /* Convert the event coordinates to cell coordinates. */ - cellx = (event->x - VTE_PAD_WIDTH) / width; - celly = (event->y - VTE_PAD_WIDTH) / height + delta; + cellx = (event->x - VTE_PAD_X) / width; + celly = (event->y - VTE_PAD_Y) / height + delta; switch (event->type) { case GDK_BUTTON_PRESS: @@ -6002,8 +6002,8 @@ if (_vte_debug_on(VTE_DEBUG_EVENTS)) { fprintf(stderr, "Button %d single-click at (%lf,%lf)\n", event->button, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH + + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y + (terminal->char_height * delta)); } #endif @@ -6050,8 +6050,8 @@ } if (extend_selecting) { vte_terminal_extend_selection(terminal, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH, + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y, !terminal->pvt->selecting_restart); handled = TRUE; } @@ -6081,8 +6081,8 @@ if (_vte_debug_on(VTE_DEBUG_EVENTS)) { fprintf(stderr, "Button %d double-click at (%lf,%lf)\n", event->button, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH + + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y + (terminal->char_height * delta)); } #endif @@ -6094,8 +6094,8 @@ event, selection_type_word); vte_terminal_extend_selection(terminal, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH, + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y, FALSE); } break; @@ -6110,8 +6110,8 @@ if (_vte_debug_on(VTE_DEBUG_EVENTS)) { fprintf(stderr, "Button %d triple-click at (%lf,%lf).\n", event->button, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH + + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y + (terminal->char_height * delta)); } #endif @@ -6123,8 +6123,8 @@ event, selection_type_line); vte_terminal_extend_selection(terminal, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH, + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y, FALSE); } break; @@ -6139,13 +6139,13 @@ /* Hilite any matches. */ vte_terminal_match_hilite(terminal, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH); + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y); /* Save the pointer state for later use. */ terminal->pvt->mouse_last_button = event->button; - terminal->pvt->mouse_last_x = event->x - VTE_PAD_WIDTH; - terminal->pvt->mouse_last_y = event->y - VTE_PAD_WIDTH; + terminal->pvt->mouse_last_x = event->x - VTE_PAD_X; + terminal->pvt->mouse_last_y = event->y - VTE_PAD_Y; return TRUE; } @@ -6195,8 +6195,8 @@ if (_vte_debug_on(VTE_DEBUG_EVENTS)) { fprintf(stderr, "Button %d released at (%lf,%lf).\n", event->button, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH); + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y); } #endif switch (event->button) { @@ -6237,13 +6237,13 @@ /* Hilite any matches. */ vte_terminal_match_hilite(terminal, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH); + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y); /* Save the pointer state for later use. */ terminal->pvt->mouse_last_button = 0; - terminal->pvt->mouse_last_x = event->x - VTE_PAD_WIDTH; - terminal->pvt->mouse_last_y = event->y - VTE_PAD_WIDTH; + terminal->pvt->mouse_last_x = event->x - VTE_PAD_X; + terminal->pvt->mouse_last_y = event->y - VTE_PAD_Y; return TRUE; } @@ -7128,8 +7128,8 @@ terminal->pvt->default_row_count; } - requisition->width += VTE_PAD_WIDTH * 2; - requisition->height += VTE_PAD_WIDTH * 2; + requisition->width += VTE_PAD_X * 2; + requisition->height += VTE_PAD_Y * 2; #ifdef VTE_DEBUG if (_vte_debug_on(VTE_DEBUG_MISC)) { @@ -7162,9 +7162,9 @@ snapped_to_bottom = (terminal->pvt->screen->insert_delta == terminal->pvt->screen->scroll_delta); - width = (allocation->width - (2 * VTE_PAD_WIDTH)) / + width = (allocation->width - (2 * VTE_PAD_X)) / terminal->char_width; - height = (allocation->height - (2 * VTE_PAD_WIDTH)) / + height = (allocation->height - (2 * VTE_PAD_Y)) / terminal->char_height; #ifdef VTE_DEBUG @@ -7921,7 +7921,7 @@ color.green = entry->green; color.blue = entry->blue; _vte_draw_fill_rectangle(terminal->pvt->draw, - x + VTE_PAD_WIDTH, y + VTE_PAD_WIDTH, + x + VTE_PAD_X, y + VTE_PAD_Y, width, height, &color, VTE_DRAW_OPAQUE); if (!wasdrawing) { @@ -7994,8 +7994,8 @@ GdkColor color; request.c = c; - request.x = x + VTE_PAD_WIDTH; - request.y = y + VTE_PAD_WIDTH; + request.x = x + VTE_PAD_X; + request.y = y + VTE_PAD_Y; request.columns = columns; color.red = terminal->pvt->palette[fore].red; @@ -8853,8 +8853,8 @@ columns = 0; for (i = 0; i < n; i++) { /* Adjust for the border. */ - items[i].x += VTE_PAD_WIDTH; - items[i].y += VTE_PAD_WIDTH; + items[i].x += VTE_PAD_X; + items[i].y += VTE_PAD_Y; columns += items[i].columns; } if (bg != defbg) { @@ -8862,7 +8862,7 @@ color.blue = bg->blue; color.green = bg->green; _vte_draw_fill_rectangle(terminal->pvt->draw, - x + VTE_PAD_WIDTH, y + VTE_PAD_WIDTH, + x + VTE_PAD_X, y + VTE_PAD_Y, columns * column_width, row_height, &color, VTE_DRAW_OPAQUE); @@ -8888,8 +8888,8 @@ } for (i = 0; i < n; i++) { /* Deadjust for the border. */ - items[i].x -= VTE_PAD_WIDTH; - items[i].y -= VTE_PAD_WIDTH; + items[i].x -= VTE_PAD_X; + items[i].y -= VTE_PAD_Y; } /* Draw whatever SFX are required. */ @@ -9424,17 +9424,17 @@ all_area.x = 0; all_area.y = 0; all_area.width = terminal->char_width * terminal->column_count; - all_area.width += 2 * VTE_PAD_WIDTH; + all_area.width += 2 * VTE_PAD_X; all_area.height = terminal->char_height * terminal->row_count; - all_area.height += 2 * VTE_PAD_WIDTH; + all_area.height += 2 * VTE_PAD_Y; area = &all_area; } - row = MAX(0, (area->y - VTE_PAD_WIDTH) / height); - row_stop = MIN(howmany((area->y - VTE_PAD_WIDTH) + area->height, + row = MAX(0, (area->y - VTE_PAD_Y) / height); + row_stop = MIN(howmany((area->y - VTE_PAD_Y) + area->height, height), terminal->row_count - 1); - col = MAX(0, (area->x - VTE_PAD_WIDTH) / width); - col_stop = MIN(howmany((area->x - VTE_PAD_WIDTH) + area->width, + col = MAX(0, (area->x - VTE_PAD_X) / width); + col_stop = MIN(howmany((area->x - VTE_PAD_X) + area->width, width), terminal->column_count - 1); @@ -9512,8 +9512,8 @@ blink, &fore, &back); _vte_draw_clear(terminal->pvt->draw, - col * width + VTE_PAD_WIDTH, - row * height + VTE_PAD_WIDTH, + col * width + VTE_PAD_X, + row * height + VTE_PAD_Y, cursor_width, height); if (blink) { @@ -9522,8 +9522,8 @@ color.green = terminal->pvt->palette[back].green; color.blue = terminal->pvt->palette[back].blue; _vte_draw_fill_rectangle(terminal->pvt->draw, - item.x + VTE_PAD_WIDTH, - item.y + VTE_PAD_WIDTH, + item.x + VTE_PAD_X, + item.y + VTE_PAD_Y, cursor_width, height, &color, VTE_DRAW_OPAQUE); @@ -9559,8 +9559,8 @@ FALSE, &fore, &back); _vte_draw_clear(terminal->pvt->draw, - col * width + VTE_PAD_WIDTH, - row * height + VTE_PAD_WIDTH, + col * width + VTE_PAD_X, + row * height + VTE_PAD_Y, cursor_width, height); vte_terminal_draw_cells(terminal, &item, 1, @@ -9576,8 +9576,8 @@ color.green = terminal->pvt->palette[fore].green; color.blue = terminal->pvt->palette[fore].blue; _vte_draw_draw_rectangle(terminal->pvt->draw, - item.x + VTE_PAD_WIDTH, - item.y + VTE_PAD_WIDTH, + item.x + VTE_PAD_X, + item.y + VTE_PAD_Y, cursor_width, height, &color, VTE_DRAW_OPAQUE); @@ -9628,8 +9628,8 @@ items[len].x = (col + columns) * width; items[len].y = row * height; _vte_draw_clear(terminal->pvt->draw, - col * width + VTE_PAD_WIDTH, - row * height + VTE_PAD_WIDTH, + col * width + VTE_PAD_X, + row * height + VTE_PAD_Y, width * columns, height); fore = screen->defaults.fore; @@ -9743,8 +9743,8 @@ /* Encode the parameters and send them to the app. */ vte_terminal_send_mouse_button_internal(terminal, button, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH); + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y); } if (terminal->pvt->mouse_send_xy_on_button || terminal->pvt->mouse_hilite_tracking || @@ -9753,8 +9753,8 @@ /* If the app cares, send a release event as well. */ vte_terminal_send_mouse_button_internal(terminal, 0, - event->x - VTE_PAD_WIDTH, - event->y - VTE_PAD_WIDTH); + event->x - VTE_PAD_X, + event->y - VTE_PAD_Y); } return TRUE; } @@ -11305,8 +11305,8 @@ g_return_if_fail(VTE_IS_TERMINAL(terminal)); g_return_if_fail(xpad != NULL); g_return_if_fail(ypad != NULL); - *xpad = 2 * VTE_PAD_WIDTH; - *ypad = 2 * VTE_PAD_WIDTH; + *xpad = 2 * VTE_PAD_X; + *ypad = 2 * VTE_PAD_Y; } /** diff -Naur -x '*.Po' -x '*.Plo' vte-0.12.2/src/vteseq.c vte-0.12.2.my/src/vteseq.c --- vte-0.12.2/src/vteseq.c 2008-08-20 13:48:44.000000000 +0200 +++ vte-0.12.2.my/src/vteseq.c 2008-08-07 15:01:35.000000000 +0200 @@ -731,10 +731,10 @@ vte_terminal_emit_resize_window(terminal, (set ? 132 : 80) * terminal->char_width + - VTE_PAD_WIDTH * 2, + VTE_PAD_X * 2, terminal->row_count * terminal->char_height + - VTE_PAD_WIDTH * 2); + VTE_PAD_Y * 2); /* Request a resize and redraw. */ _vte_invalidate_all(terminal); again = TRUE; @@ -3827,9 +3827,9 @@ #endif vte_terminal_emit_resize_window(terminal, arg2 + - VTE_PAD_WIDTH * 2, + VTE_PAD_X * 2, arg1 + - VTE_PAD_WIDTH * 2); + VTE_PAD_Y * 2); i += 2; } break; @@ -3869,9 +3869,9 @@ #endif vte_terminal_emit_resize_window(terminal, arg2 * terminal->char_width + - VTE_PAD_WIDTH * 2, + VTE_PAD_X * 2, arg1 * terminal->char_height + - VTE_PAD_WIDTH * 2); + VTE_PAD_Y * 2); i += 2; } break; @@ -3918,7 +3918,7 @@ &width, &height); snprintf(buf, sizeof(buf), "%s%d;%dt", _VTE_CAP_CSI, - width + VTE_PAD_WIDTH, height + VTE_PAD_WIDTH); + width + VTE_PAD_X, height + VTE_PAD_Y); #ifdef VTE_DEBUG if (_vte_debug_on(VTE_DEBUG_PARSE)) { fprintf(stderr, "Reporting window location" @@ -3934,14 +3934,14 @@ &width, &height); snprintf(buf, sizeof(buf), "%s%d;%dt", _VTE_CAP_CSI, - height - 2 * VTE_PAD_WIDTH, - width - 2 * VTE_PAD_WIDTH); + height - 2 * VTE_PAD_Y, + width - 2 * VTE_PAD_X); #ifdef VTE_DEBUG if (_vte_debug_on(VTE_DEBUG_PARSE)) { fprintf(stderr, "Reporting window size " "(%dx%dn", - width - 2 * VTE_PAD_WIDTH, - height - 2 * VTE_PAD_WIDTH); + width - 2 * VTE_PAD_X, + height - 2 * VTE_PAD_Y); } #endif vte_terminal_feed_child(terminal, buf, strlen(buf)); @@ -4023,9 +4023,9 @@ * rows. */ vte_terminal_emit_resize_window(terminal, terminal->column_count * terminal->char_width + - VTE_PAD_WIDTH * 2, + VTE_PAD_X * 2, param * terminal->char_height + - VTE_PAD_WIDTH * 2); + VTE_PAD_Y * 2); } break; }