summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Theme
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-10-15 10:41:50 -0400
committerArun Thondapu <arunkumar.thondapu@in.ibm.com>2012-10-15 23:31:59 +0530
commitd090fa149a4cb297f7af43a248a69e342be801ae (patch)
tree64f55f3626f249ceeddf921050f32515e26be0c0 /bundles/org.eclipse.swt/Eclipse SWT Theme
parentb76a3210e5e0d07a0578d9ae225b51140c25db20 (diff)
downloadeclipse.platform.swt-d090fa149a4cb297f7af43a248a69e342be801ae.tar.gz
eclipse.platform.swt-d090fa149a4cb297f7af43a248a69e342be801ae.tar.xz
eclipse.platform.swt-d090fa149a4cb297f7af43a248a69e342be801ae.zip
Use gtk_render_extension instead of gtk_paint_extension for GTK+ 3
This patch uses gtk_render_extension instead of deprecated gtk_paint_extension method for GTK+ 3.
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/TabItemDrawData.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabItemDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabItemDrawData.java
index b0d74544d9..119a239e3d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabItemDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabItemDrawData.java
@@ -13,6 +13,7 @@ package org.eclipse.swt.internal.theme;
import org.eclipse.swt.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 TabItemDrawData extends DrawData {
@@ -67,7 +68,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) {
}
int state_type = getStateType(DrawData.WIDGET_WHOLE);
byte[] detail = Converter.wcsToMbcs(null, "tab", true);
- OS.gtk_paint_extension(gtkStyle, drawable, state_type, OS.GTK_SHADOW_OUT, null, notebookHandle, detail, x, y, width, height, gap_side);
+ gtk_render_extension (gtkStyle, drawable, state_type, OS.GTK_SHADOW_OUT, null, notebookHandle, detail, x, y, width, height, gap_side);
if (clientArea != null) {
int hborder, vborder;
if (OS.GTK_VERSION >= OS.VERSION(2, 4, 0)) {
@@ -100,4 +101,14 @@ int hit(Theme theme, Point position, Rectangle bounds) {
return bounds.contains(position) ? DrawData.WIDGET_WHOLE : DrawData.WIDGET_NOWHERE;
}
+void gtk_render_extension(long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height, int gap_side) {
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ long /*int*/ cairo = OS.gdk_cairo_create (window);
+ long /*int*/ context = OS.gtk_widget_get_style_context (style);
+ OS.gtk_render_extension(context, cairo, x, y, width, height, gap_side);
+ Cairo.cairo_destroy (cairo);
+ } else {
+ OS.gtk_paint_extension (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side);
+ }
+}
}