diff options
author | Egmont Koblinger <egmont@gmail.com> | 2014-03-16 15:53:03 +0100 |
---|---|---|
committer | Egmont Koblinger <egmont@gmail.com> | 2014-03-16 15:53:03 +0100 |
commit | 0941913e97e436f262e9f711ad7516122c94b364 (patch) | |
tree | 717bc0ad55373dd72a1441e54a75569272d53cdd | |
parent | 1d1e56ccc3c8fc2b844e7c93e0471660a94928b1 (diff) | |
download | vte-0941913e97e436f262e9f711ad7516122c94b364.tar.gz |
build: Remove vte-gtk-compat
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/vte-gtk-compat.h | 48 | ||||
-rw-r--r-- | src/vte.c | 53 | ||||
-rw-r--r-- | src/vteaccess.c | 1 | ||||
-rw-r--r-- | src/vtebg.c | 1 | ||||
-rw-r--r-- | src/vtedraw.c | 2 | ||||
-rw-r--r-- | src/vtedraw.h | 3 |
7 files changed, 33 insertions, 76 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index dab4dabc..7abb872f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,7 +54,6 @@ libvte@VTE_LIBRARY_SUFFIX_U@_la_SOURCES = \ trie.h \ vte.c \ vte.h \ - vte-gtk-compat.h \ vte-private.h \ vteaccess.c \ vteaccess.h \ diff --git a/src/vte-gtk-compat.h b/src/vte-gtk-compat.h deleted file mode 100644 index 70114745..00000000 --- a/src/vte-gtk-compat.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2010 Saleem Abdulrasool <compnerd@compnerd.org> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef vte_gtk_compat_h_included -#define vte_gtk_compat_h_included - -#include <gtk/gtk.h> - -G_BEGIN_DECLS - -#define GdkRegion cairo_region_t -#define VteRegionRectangle cairo_rectangle_int_t -#define gdk_region_new() cairo_region_create() -#define gdk_region_rectangle(r) cairo_region_create_rectangle(r) -#define gdk_region_copy(r) cairo_region_copy(r) -#define gdk_region_destroy cairo_region_destroy -#define gdk_region_union_with_rect(r, rect) cairo_region_union_rectangle(r, rect) -#define gdk_region_union(r, s) cairo_region_union(r, s) -#define gdk_region_get_clipbox(r, rect) cairo_region_get_extents(r, rect) -#define gdk_region_get_rectangles(r, rects, n_rects) \ - do { \ - int i; \ - \ - *(n_rects) = cairo_region_num_rectangles(r); \ - *(rects) = g_new(cairo_rectangle_int_t, *(n_rects)); \ - for (i = 0; i < *(n_rects); i++) \ - cairo_region_get_rectangle ((r), i, &(*(rects))[i]); \ - } while (0) - -G_END_DECLS - -#endif - @@ -31,7 +31,6 @@ #include "vte.h" #include "vte-private.h" -#include "vte-gtk-compat.h" #ifdef HAVE_WCHAR_H #include <wchar.h> @@ -363,7 +362,7 @@ _vte_invalidate_cells(VteTerminal *terminal, glong column_start, gint column_count, glong row_start, gint row_count) { - VteRegionRectangle rect; + cairo_rectangle_int_t rect; glong i; if (!column_count || !row_count) { @@ -442,7 +441,7 @@ _vte_invalidate_cells(VteTerminal *terminal, if (terminal->pvt->active != NULL) { terminal->pvt->update_regions = g_slist_prepend ( terminal->pvt->update_regions, - gdk_region_rectangle (&rect)); + cairo_region_create_rectangle (&rect)); /* Wait a bit before doing any invalidation, just in * case updates are coming in really soon. */ add_update_timeout (terminal); @@ -482,7 +481,7 @@ _vte_invalidate_region (VteTerminal *terminal, void _vte_invalidate_all(VteTerminal *terminal) { - VteRegionRectangle rect; + cairo_rectangle_int_t rect; GtkAllocation allocation; g_assert(VTE_IS_TERMINAL(terminal)); @@ -508,7 +507,7 @@ _vte_invalidate_all(VteTerminal *terminal) if (terminal->pvt->active != NULL) { terminal->pvt->update_regions = g_slist_prepend (NULL, - gdk_region_rectangle (&rect)); + cairo_region_create_rectangle (&rect)); /* Wait a bit before doing any invalidation, just in * case updates are coming in really soon. */ add_update_timeout (terminal); @@ -10940,11 +10939,11 @@ fg_out: } static void -vte_terminal_expand_region (VteTerminal *terminal, GdkRegion *region, const GdkRectangle *area) +vte_terminal_expand_region (VteTerminal *terminal, cairo_region_t *region, const GdkRectangle *area) { int width, height; int row, col, row_stop, col_stop; - VteRegionRectangle rect; + cairo_rectangle_int_t rect; width = terminal->char_width; height = terminal->char_height; @@ -10971,7 +10970,7 @@ vte_terminal_expand_region (VteTerminal *terminal, GdkRegion *region, const GdkR rect.height = (row_stop - row)*height; /* the rect must be cell aligned to avoid overlapping XY bands */ - gdk_region_union_with_rect(region, &rect); + cairo_region_union_rectangle(region, &rect); _vte_debug_print (VTE_DEBUG_UPDATES, "vte_terminal_expand_region" @@ -11262,7 +11261,7 @@ vte_terminal_paint_im_preedit_string(VteTerminal *terminal) /* Draw the widget. */ static void -vte_terminal_paint(GtkWidget *widget, GdkRegion *region) +vte_terminal_paint(GtkWidget *widget, cairo_region_t *region) { VteTerminal *terminal; GtkAllocation allocation; @@ -11291,8 +11290,8 @@ vte_terminal_paint(GtkWidget *widget, GdkRegion *region) } _VTE_DEBUG_IF (VTE_DEBUG_UPDATES) { - VteRegionRectangle clip; - gdk_region_get_clipbox (region, &clip); + cairo_rectangle_int_t clip; + cairo_region_get_extents (region, &clip); g_printerr ("vte_terminal_paint" " (%d,%d)x(%d,%d) pixels\n", clip.x, clip.y, clip.width, clip.height); @@ -11305,21 +11304,31 @@ vte_terminal_paint(GtkWidget *widget, GdkRegion *region) /* Calculate the bounding rectangle. */ { - VteRegionRectangle *rectangles; + cairo_rectangle_int_t *rectangles; gint n, n_rectangles; - gdk_region_get_rectangles (region, &rectangles, &n_rectangles); + n_rectangles = cairo_region_num_rectangles (region); + rectangles = g_new (cairo_rectangle_int_t, n_rectangles); + for (n = 0; n < n_rectangles; n++) { + cairo_region_get_rectangle (region, n, &rectangles[n]); + } + /* don't bother to enlarge an invalidate all */ if (!(n_rectangles == 1 && rectangles[0].width == allocation.width && rectangles[0].height == allocation.height)) { - GdkRegion *rr = gdk_region_new (); + cairo_region_t *rr = cairo_region_create (); /* convert pixels into whole cells */ for (n = 0; n < n_rectangles; n++) { vte_terminal_expand_region (terminal, rr, rectangles + n); } g_free (rectangles); - gdk_region_get_rectangles (rr, &rectangles, &n_rectangles); - gdk_region_destroy (rr); + + n_rectangles = cairo_region_num_rectangles (rr); + rectangles = g_new (cairo_rectangle_int_t, n_rectangles); + for (n = 0; n < n_rectangles; n++) { + cairo_region_get_rectangle (rr, n, &rectangles[n]); + } + cairo_region_destroy (rr); } /* and now paint them */ @@ -14813,7 +14822,7 @@ reset_update_regions (VteTerminal *terminal) { if (terminal->pvt->update_regions != NULL) { g_slist_foreach (terminal->pvt->update_regions, - (GFunc)gdk_region_destroy, NULL); + (GFunc)cairo_region_destroy, NULL); g_slist_free (terminal->pvt->update_regions); terminal->pvt->update_regions = NULL; } @@ -15104,7 +15113,7 @@ static gboolean update_regions (VteTerminal *terminal) { GSList *l; - GdkRegion *region; + cairo_region_t *region; GdkWindow *window; if (G_UNLIKELY (! gtk_widget_is_drawable (&terminal->widget) @@ -15120,10 +15129,10 @@ update_regions (VteTerminal *terminal) l = terminal->pvt->update_regions; if (g_slist_next (l) != NULL) { /* amalgamate into one super-region */ - region = gdk_region_new (); + region = cairo_region_create (); do { - gdk_region_union (region, l->data); - gdk_region_destroy (l->data); + cairo_region_union (region, l->data); + cairo_region_destroy (l->data); } while ((l = g_slist_next (l)) != NULL); } else { region = l->data; @@ -15136,7 +15145,7 @@ update_regions (VteTerminal *terminal) window = gtk_widget_get_window (&terminal->widget); gdk_window_invalidate_region (window, region, FALSE); gdk_window_process_updates (window, FALSE); - gdk_region_destroy (region); + cairo_region_destroy (region); _vte_debug_print (VTE_DEBUG_WORK, "-"); diff --git a/src/vteaccess.c b/src/vteaccess.c index 16a3508f..3ffbebf9 100644 --- a/src/vteaccess.c +++ b/src/vteaccess.c @@ -36,7 +36,6 @@ #include "vte.h" #include "vteaccess.h" #include "vteint.h" -#include "vte-gtk-compat.h" #ifdef HAVE_LOCALE_H #include <locale.h> diff --git a/src/vtebg.c b/src/vtebg.c index 7c41204b..ec5f77e7 100644 --- a/src/vtebg.c +++ b/src/vtebg.c @@ -24,7 +24,6 @@ #include "debug.h" #include "marshal.h" #include "vtebg.h" -#include "vte-gtk-compat.h" #ifdef GDK_WINDOWING_X11 #include <gdk/gdkx.h> diff --git a/src/vtedraw.c b/src/vtedraw.c index dbcb2279..ae8fbab7 100644 --- a/src/vtedraw.c +++ b/src/vtedraw.c @@ -911,7 +911,7 @@ _vte_draw_set_background_scroll (struct _vte_draw *draw, } void -_vte_draw_clip (struct _vte_draw *draw, GdkRegion *region) +_vte_draw_clip (struct _vte_draw *draw, cairo_region_t *region) { _vte_debug_print (VTE_DEBUG_DRAW, "draw_clip\n"); gdk_cairo_region(draw->cr, region); diff --git a/src/vtedraw.h b/src/vtedraw.h index e32dae0d..03160939 100644 --- a/src/vtedraw.h +++ b/src/vtedraw.h @@ -28,7 +28,6 @@ #include "vtebg.h" #include "vte.h" #include "vteunistr.h" -#include "vte-gtk-compat.h" G_BEGIN_DECLS @@ -92,7 +91,7 @@ void _vte_draw_set_background_image(struct _vte_draw *draw, void _vte_draw_set_background_scroll(struct _vte_draw *draw, gint x, gint y); -void _vte_draw_clip(struct _vte_draw *draw, GdkRegion *region); +void _vte_draw_clip(struct _vte_draw *draw, cairo_region_t *region); void _vte_draw_clear(struct _vte_draw *draw, gint x, gint y, gint width, gint height); |