Commit 0941913e authored by Egmont Koblinger's avatar Egmont Koblinger

build: Remove vte-gtk-compat

parent 1d1e56cc
......@@ -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 \
......
/*
* 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, "-");
......
......@@ -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>
......
......@@ -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>
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment