summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java
index 9785073ac0..2220cbdba0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java
@@ -134,7 +134,7 @@ void drawText(Theme theme, String text, int flags, GC gc, Rectangle bounds) {
}
int state_type = getStateType(DrawData.WIDGET_WHOLE);
byte[] detail = Converter.wcsToMbcs(null, "label", true);
- OS.gtk_paint_layout(gtkStyle, drawable, state_type, false, null, widget, detail, x, y, layout);
+ gtk_render_layout(gtkStyle, drawable, state_type, false, null, widget, detail, x, y, layout);
OS.g_object_unref(layout);
}
@@ -188,4 +188,14 @@ Rectangle measureText(Theme theme, String text, int flags, GC gc, Rectangle boun
return new Rectangle(0, 0, OS.PANGO_PIXELS(width[0]), OS.PANGO_PIXELS(height[0]));
}
+void gtk_render_layout (int /*long*/ style, int /*long*/ window, int state_type, boolean use_text, GdkRectangle area, int /*long*/ widget, byte[] detail, int x , int y, int /*long*/ layout) {
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ int /*long*/ cairo = OS.gdk_cairo_create (window);
+ int /*long*/ context = OS.gtk_widget_get_style_context (style);
+ OS.gtk_render_layout (context, cairo, x, y, layout);
+ } else {
+ OS.gtk_paint_layout(style, window, state_type, use_text, area, widget, detail, x , y, layout);
+ }
+}
+
}