summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Region.java19
1 files changed, 14 insertions, 5 deletions
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);
+ }
+}
}