diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-10-12 10:37:12 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-10-17 10:34:22 -0400 |
commit | b178ded274cefa13fff8fc6fb8115ee14a844dc8 (patch) | |
tree | 1b0bbd83824435229f7e6ecc4157d85590ceb9a4 /bundles/org.eclipse.swt/Eclipse SWT Theme | |
parent | df55805e4a74ab0fc8f545a1792d755c95a4e419 (diff) | |
download | eclipse.platform.swt-b178ded274cefa13fff8fc6fb8115ee14a844dc8.tar.gz eclipse.platform.swt-b178ded274cefa13fff8fc6fb8115ee14a844dc8.tar.xz eclipse.platform.swt-b178ded274cefa13fff8fc6fb8115ee14a844dc8.zip |
Replace GdkRegion with Cairo methods for GTK + 3.0 and higher
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Theme')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/Theme.java | 17 |
1 files changed, 14 insertions, 3 deletions
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 0d384038be..a36ca00849 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 { @@ -187,9 +188,15 @@ void transferClipping(GC gc, long /*int*/ style) { long /*int*/ clipping = clipRgn; if (damageRgn != 0) { if (clipping != 0) { + if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) { + clipping = Cairo.cairo_region_create (); + Cairo.cairo_region_union (clipping, clipRgn); + Cairo.cairo_region_intersect (clipping, damageRgn); + } else { clipping = OS.gdk_region_new(); - OS.gdk_region_union(clipping, clipRgn); - OS.gdk_region_intersect(clipping, damageRgn); + OS.gdk_region_union (clipping, clipRgn); + OS.gdk_region_intersect (clipping, damageRgn); + } } else { clipping = damageRgn; } @@ -216,7 +223,11 @@ void transferClipping(GC gc, long /*int*/ 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); + } } } } |