summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-09-07 11:03:08 -0400
committerAnatoly Spektor <aspektor@redhat.com>2012-09-07 11:03:08 -0400
commit05db8a336c06be8b2a77519c4eaef0f7a648cc42 (patch)
treec44689a6266e80ba4fc35862e80618deffeda844
parenteda05e5e1bfd7a8e6860cccbab7bfcd105765ca8 (diff)
downloadeclipse.platform.swt-gtk3_region_destroy.tar.gz
eclipse.platform.swt-gtk3_region_destroy.tar.xz
eclipse.platform.swt-gtk3_region_destroy.zip
Use cairo_region_destroy() instead of gdk_region_destroy() for GTK+3gtk3_region_destroy
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo.c10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_stats.c5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java19
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java9
15 files changed, 104 insertions, 34 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo.c
index 72220cf07f..7292708eea 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo.c
@@ -1179,6 +1179,16 @@ JNIEXPORT jintLong JNICALL Cairo_NATIVE(_1cairo_1reference)
}
#endif
+#ifndef NO__1cairo_1region_1destroy
+JNIEXPORT void JNICALL Cairo_NATIVE(_1cairo_1region_1destroy)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ Cairo_NATIVE_ENTER(env, that, _1cairo_1region_1destroy_FUNC);
+ cairo_region_destroy((cairo_region_t *)arg0);
+ Cairo_NATIVE_EXIT(env, that, _1cairo_1region_1destroy_FUNC);
+}
+#endif
+
#ifndef NO__1cairo_1rel_1curve_1to
JNIEXPORT void JNICALL Cairo_NATIVE(_1cairo_1rel_1curve_1to)
(JNIEnv *env, jclass that, jintLong arg0, jdouble arg1, jdouble arg2, jdouble arg3, jdouble arg4, jdouble arg5, jdouble arg6)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_stats.c
index 67b21fe5c2..6d10677bc2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_stats.c
@@ -24,8 +24,8 @@
#ifdef NATIVE_STATS
-int Cairo_nativeFunctionCount = 157;
-int Cairo_nativeFunctionCallCount[157];
+int Cairo_nativeFunctionCount = 158;
+int Cairo_nativeFunctionCallCount[158];
char * Cairo_nativeFunctionNames[] = {
"CAIRO_1VERSION_1ENCODE",
"_1cairo_1append_1path",
@@ -117,6 +117,7 @@ char * Cairo_nativeFunctionNames[] = {
"_1cairo_1push_1group",
"_1cairo_1rectangle",
"_1cairo_1reference",
+ "_1cairo_1region_1destroy",
"_1cairo_1rel_1curve_1to",
"_1cairo_1rel_1line_1to",
"_1cairo_1rel_1move_1to",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_stats.h
index 62206dc2a8..5c622e2b29 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library/cairo_stats.h
@@ -125,6 +125,7 @@ typedef enum {
_1cairo_1push_1group_FUNC,
_1cairo_1rectangle_FUNC,
_1cairo_1reference_FUNC,
+ _1cairo_1region_1destroy_FUNC,
_1cairo_1rel_1curve_1to_FUNC,
_1cairo_1rel_1line_1to_FUNC,
_1cairo_1rel_1move_1to_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java
index 8f342be036..ca251730cf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cairo/org/eclipse/swt/internal/cairo/Cairo.java
@@ -1029,6 +1029,16 @@ public static final void cairo_rectangle(int /*long*/ cr, double x, double y, do
lock.unlock();
}
}
+/** @param region cast=(cairo_region_t *) */
+public static final native void _cairo_region_destroy(int /*long*/ region);
+public static final void cairo_region_destroy(int /*long*/ region) {
+ lock.lock();
+ try {
+ _cairo_region_destroy(region);
+ } finally {
+ lock.unlock();
+ }
+}
/** @param cr cast=(cairo_t *) */
public static final native int /*long*/ _cairo_reference(int /*long*/ cr);
public static final int /*long*/ cairo_reference(int /*long*/ cr) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index 90c1ebac16..e453eea891 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -6155,7 +6155,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1region_1destroy)
(JNIEnv *env, jclass that, jintLong arg0)
{
OS_NATIVE_ENTER(env, that, _1gdk_1region_1destroy_FUNC);
- gdk_region_destroy((GdkRegion *)arg0);
+/*
+ gdk_region_destroy(arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gdk_region_destroy)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong))fp)(arg0);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gdk_1region_1destroy_FUNC);
}
#endif
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
index 09073e9c3e..52bea1cc66 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
@@ -202,6 +202,7 @@
#define gdk_window_get_height_LIB LIB_GDK
#define gdk_window_get_width_LIB LIB_GDK
#define gdk_pixmap_get_size_LIB LIB_GDK
+#define gdk_region_destroy_LIB LIB_GDK
#define gdk_window_set_keep_above_LIB LIB_GDK
#define gdk_window_set_accept_focus_LIB LIB_GDK
#define gtk_window_set_opacity_LIB LIB_GTK
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index c2310b7878..3ce0737a72 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -4637,7 +4637,7 @@ public static final boolean gdk_property_get(int /*long*/ window, int /*long*/ p
lock.unlock();
}
}
-/** @param region cast=(GdkRegion *) */
+/** @method flags=dynamic */
public static final native void _gdk_region_destroy(int /*long*/ region);
public static final void gdk_region_destroy(int /*long*/ region) {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java
index 1357fb9c9e..28a76574fb 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java
@@ -13,6 +13,7 @@ package org.eclipse.swt.internal.theme;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.cairo.Cairo;
import org.eclipse.swt.internal.gtk.*;
public class Theme {
@@ -212,7 +213,11 @@ void transferClipping(GC gc, int /*long*/ style) {
OS.gtk_style_get_white_gc (style, curGC);
if (curGC[0] != 0) OS.gdk_gc_set_clip_region (curGC[0], clipping);
if (clipping != clipRgn && clipping != damageRgn) {
- OS.gdk_region_destroy(clipping);
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ Cairo.cairo_region_destroy (clipping);
+ } else {
+ OS.gdk_region_destroy (clipping);
+ }
}
}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
index 61021eb94a..7063940529 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
@@ -422,7 +422,7 @@ int /*long*/ convertRgn(int /*long*/ rgn, double[] matrix) {
pointArray[7] = (int)Math.round(y[0]);
int /*long*/ polyRgn = OS.gdk_region_polygon(pointArray, pointArray.length / 2, OS.GDK_EVEN_ODD_RULE);
OS.gdk_region_union(newRgn, polyRgn);
- OS.gdk_region_destroy(polyRgn);
+ cairo_region_destroy(polyRgn);
}
if (rects[0] != 0) OS.g_free(rects[0]);
return newRgn;
@@ -558,9 +558,9 @@ public void copyArea(int srcX, int srcY, int width, int height, int destX, int d
OS.gdk_region_subtract (invalidateRegion, visibleRegion);
OS.gdk_region_offset (invalidateRegion, deltaX, deltaY);
OS.gdk_window_invalidate_region(drawable, invalidateRegion, false);
- OS.gdk_region_destroy (visibleRegion);
- OS.gdk_region_destroy (copyRegion);
- OS.gdk_region_destroy (invalidateRegion);
+ cairo_region_destroy (visibleRegion);
+ cairo_region_destroy (copyRegion);
+ cairo_region_destroy (invalidateRegion);
}
}
} else {
@@ -639,7 +639,7 @@ void destroy() {
/* Free resources */
int /*long*/ clipRgn = data.clipRgn;
- if (clipRgn != 0) OS.gdk_region_destroy(clipRgn);
+ if (clipRgn != 0) cairo_region_destroy (clipRgn);
Image image = data.image;
if (image != null) {
image.memGC = null;
@@ -1176,7 +1176,7 @@ void drawImageXRender(Image srcImage, int srcX, int srcY, int srcWidth, int srcH
}
OS.XRenderSetPictureClipRectangles(xDisplay, destPict, 0, 0, xRects, nRects[0]);
if (clipping != data.clipRgn && clipping != data.damageRgn) {
- OS.gdk_region_destroy(clipping);
+ cairo_region_destroy (clipping);
}
if (rects[0] != 0) OS.g_free(rects[0]);
}
@@ -2387,7 +2387,7 @@ public Rectangle getClipping() {
if (data.clippingTransform != null) {
clipRgn = convertRgn(clipRgn, data.clippingTransform);
OS.gdk_region_intersect(rgn, clipRgn);
- OS.gdk_region_destroy(clipRgn);
+ cairo_region_destroy (clipRgn);
} else {
OS.gdk_region_intersect(rgn, clipRgn);
}
@@ -2398,11 +2398,11 @@ public Rectangle getClipping() {
Cairo.cairo_get_matrix(cairo, matrix);
Cairo.cairo_matrix_invert(matrix);
clipRgn = convertRgn(rgn, matrix);
- OS.gdk_region_destroy(rgn);
+ cairo_region_destroy (rgn);
rgn = clipRgn;
}
OS.gdk_region_get_clipbox(rgn, rect);
- OS.gdk_region_destroy(rgn);
+ cairo_region_destroy (rgn);
x = rect.x;
y = rect.y;
width = rect.width;
@@ -2445,7 +2445,7 @@ public void getClipping(Region region) {
if (data.clippingTransform != null) {
int /*long*/ rgn = convertRgn(clipRgn, data.clippingTransform);
OS.gdk_region_union(clipping, rgn);
- OS.gdk_region_destroy(rgn);
+ cairo_region_destroy (rgn);
} else {
OS.gdk_region_union(clipping, clipRgn);
}
@@ -2461,7 +2461,7 @@ public void getClipping(Region region) {
int /*long*/ rgn = convertRgn(clipping, matrix);
OS.gdk_region_subtract(clipping, clipping);
OS.gdk_region_union(clipping, rgn);
- OS.gdk_region_destroy(rgn);
+ cairo_region_destroy (rgn);
}
}
@@ -3303,7 +3303,7 @@ void setClipping(int /*long*/ clipRgn) {
int /*long*/ cairo = data.cairo;
if (clipRgn == 0) {
if (data.clipRgn != 0) {
- OS.gdk_region_destroy(data.clipRgn);
+ cairo_region_destroy (data.clipRgn);
data.clipRgn = 0;
}
if (cairo != 0) {
@@ -3329,7 +3329,7 @@ void setClipping(int /*long*/ clipRgn) {
OS.gdk_region_intersect(clipping, data.damageRgn);
}
OS.gdk_gc_set_clip_region(handle, clipping);
- if (clipping != clipRgn) OS.gdk_region_destroy(clipping);
+ if (clipping != clipRgn) cairo_region_destroy (clipping);
}
}
}
@@ -3366,7 +3366,7 @@ public void setClipping(int x, int y, int width, int height) {
int /*long*/ clipRgn = OS.gdk_region_new();
OS.gdk_region_union_with_rect(clipRgn, rect);
setClipping(clipRgn);
- OS.gdk_region_destroy(clipRgn);
+ cairo_region_destroy (clipRgn);
}
/**
@@ -4170,4 +4170,12 @@ public String toString () {
return "GC {" + handle + "}";
}
+void cairo_region_destroy (int /*long*/ region) {
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ Cairo.cairo_region_destroy( region);
+ } else {
+ OS.gdk_region_destroy (region);
+ }
+}
+
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java
index a2b8995ec7..1ca65efac8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java
@@ -11,6 +11,7 @@
package org.eclipse.swt.graphics;
+import org.eclipse.swt.internal.cairo.Cairo;
import org.eclipse.swt.internal.gtk.*;
import org.eclipse.swt.*;
@@ -111,7 +112,7 @@ public void add (int[] pointArray) {
if (pointArray.length < 6) return;
int /*long*/ polyRgn = OS.gdk_region_polygon(pointArray, pointArray.length / 2, OS.GDK_EVEN_ODD_RULE);
OS.gdk_region_union(handle, polyRgn);
- OS.gdk_region_destroy(polyRgn);
+ cairo_region_destroy (polyRgn);
}
/**
@@ -224,7 +225,7 @@ public boolean contains(Point pt) {
}
void destroy() {
- OS.gdk_region_destroy(handle);
+ cairo_region_destroy (handle);
handle = 0;
}
@@ -333,7 +334,7 @@ public void intersect(int x, int y, int width, int height) {
gdkRect.height = height;
int /*long*/ rectRgn = OS.gdk_region_rectangle(gdkRect);
OS.gdk_region_intersect(handle, rectRgn);
- OS.gdk_region_destroy(rectRgn);
+ cairo_region_destroy (rectRgn);
}
/**
@@ -464,7 +465,7 @@ public void subtract (int[] pointArray) {
if (pointArray.length < 6) return;
int /*long*/ polyRgn = OS.gdk_region_polygon(pointArray, pointArray.length / 2, OS.GDK_EVEN_ODD_RULE);
OS.gdk_region_subtract(handle, polyRgn);
- OS.gdk_region_destroy(polyRgn);
+ cairo_region_destroy (polyRgn);
}
/**
@@ -517,7 +518,7 @@ public void subtract(int x, int y, int width, int height) {
gdkRect.height = height;
int /*long*/ rectRgn = OS.gdk_region_rectangle(gdkRect);
OS.gdk_region_subtract(handle, rectRgn);
- OS.gdk_region_destroy(rectRgn);
+ cairo_region_destroy (rectRgn);
}
/**
@@ -593,4 +594,12 @@ public String toString () {
if (isDisposed()) return "Region {*DISPOSED*}";
return "Region {" + handle + "}";
}
+
+void cairo_region_destroy (int /*long*/ region) {
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ Cairo.cairo_region_destroy (region);
+ } else {
+ OS.gdk_region_destroy (region);
+ }
+}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
index 67695a3d5d..ff5af857c8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
@@ -571,7 +571,7 @@ public void draw(GC gc, int x, int y, int selectionStart, int selectionEnd, Colo
int /*long*/ rgn = OS.gdk_pango_layout_get_clip_region(layout, x, y, ranges, ranges.length / 2);
if (rgn != 0) {
OS.gdk_gc_set_clip_region(gc.handle, rgn);
- OS.gdk_region_destroy(rgn);
+ cairo_region_destroy (rgn);
}
OS.gdk_draw_layout_with_colors(data.drawable, gc.handle, x, y, layout, selectionForeground.handle, selectionBackground.handle);
drawBorder(gc, x, y, selectionForeground.handle);
@@ -601,7 +601,7 @@ void drawWithCairo(GC gc, int x, int y, int start, int end, boolean fullSelectio
Cairo.cairo_clip(cairo);
Cairo.cairo_set_source_rgba(cairo, (bg.red & 0xFFFF) / (float)0xFFFF, (bg.green & 0xFFFF) / (float)0xFFFF, (bg.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
Cairo.cairo_paint(cairo);
- OS.gdk_region_destroy(rgn);
+ cairo_region_destroy (rgn);
}
Cairo.cairo_set_source_rgba(cairo, (fg.red & 0xFFFF) / (float)0xFFFF, (fg.green & 0xFFFF) / (float)0xFFFF, (fg.blue & 0xFFFF) / (float)0xFFFF, data.alpha / (float)0xFF);
Cairo.cairo_move_to(cairo, x, y);
@@ -697,7 +697,7 @@ void drawBorder(GC gc, int x, int y, GdkColor selectionColor) {
}
}
if (rects[0] != 0) OS.g_free(rects[0]);
- OS.gdk_region_destroy(rgn);
+ cairo_region_destroy (rgn);
}
}
}
@@ -855,11 +855,11 @@ public Rectangle getBounds(int start, int end) {
OS.gdk_region_union_with_rect(linesRegion, rect);
} while (lineEnd + 1 <= byteEnd);
OS.gdk_region_intersect(clipRegion, linesRegion);
- OS.gdk_region_destroy(linesRegion);
+ cairo_region_destroy (linesRegion);
OS.pango_layout_iter_free(iter);
OS.gdk_region_get_clipbox(clipRegion, rect);
- OS.gdk_region_destroy(clipRegion);
+ cairo_region_destroy (clipRegion);
if (OS.pango_context_get_base_dir(context) == OS.PANGO_DIRECTION_RTL) {
rect.x = width() - rect.x - rect.width;
}
@@ -2223,4 +2223,12 @@ int width () {
return OS.PANGO_PIXELS(w[0]);
}
+void cairo_region_destroy (int /*long*/ region) {
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ Cairo.cairo_region_destroy (region);
+ } else {
+ OS.gdk_region_destroy (region);
+ }
+}
+
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
index 9ebbe8e7e9..cf63d02818 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java
@@ -310,9 +310,9 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b
}
}
OS.gdk_window_invalidate_region(window, invalidateRegion, all);
- OS.gdk_region_destroy (visibleRegion);
- OS.gdk_region_destroy (copyRegion);
- OS.gdk_region_destroy (invalidateRegion);
+ cairo_region_destroy (visibleRegion);
+ cairo_region_destroy (copyRegion);
+ cairo_region_destroy (invalidateRegion);
}
if (all) {
Control [] children = _getChildren ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
index 9f6c6ba29f..e2ead9e28d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
@@ -738,7 +738,7 @@ int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ eventPtr) {
GC gc = event.gc = GC.gtk_new (this, data);
sendEvent (SWT.Paint, event);
gc.dispose ();
- OS.gdk_region_destroy (damageRgn);
+ cairo_region_destroy (damageRgn);
event.gc = null;
}
OS.g_free (rectangles [0]);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
index 2dd7b19b88..61ad8f24c5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java
@@ -253,7 +253,7 @@ void configure () {
OS.gtk_widget_realize (handle);
int /*long*/ window = gtk_widget_get_window (handle);
OS.gdk_window_shape_combine_region (window, rgn, 0, 0);
- OS.gdk_region_destroy (rgn);
+ cairo_region_destroy (rgn);
}
void createHandle (int index) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
index 465a0f733e..7a036ea96e 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
@@ -13,6 +13,7 @@ package org.eclipse.swt.widgets;
import org.eclipse.swt.*;
import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.cairo.Cairo;
import org.eclipse.swt.internal.gtk.*;
import org.eclipse.swt.events.*;
@@ -1963,4 +1964,12 @@ int /*long*/ windowProc (int /*long*/ handle, int /*long*/ arg0, int /*long*/ ar
}
}
+void cairo_region_destroy(int /*long*/ region) {
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ Cairo.cairo_region_destroy(region);
+ } else {
+ OS.gdk_region_destroy(region);
+ }
+}
+
}