diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-10-05 12:04:46 -0400 |
---|---|---|
committer | Alexander Kurtakov <akurtako@redhat.com> | 2012-10-05 20:00:38 +0300 |
commit | fced94f9eb057f73fb291e17160f948c0221a298 (patch) | |
tree | dbe4d464a9de3541e8e6c0e5946509d483b9e9a0 /bundles/org.eclipse.swt/Eclipse SWT Theme | |
parent | ccfbe1d755ec8867af82b207cc663c1af09c8cf5 (diff) | |
download | eclipse.platform.swt-fced94f9eb057f73fb291e17160f948c0221a298.tar.gz eclipse.platform.swt-fced94f9eb057f73fb291e17160f948c0221a298.tar.xz eclipse.platform.swt-fced94f9eb057f73fb291e17160f948c0221a298.zip |
Use gtk_render_layout instead of gtk_paint_layout for GTK+3 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/DrawData.java | 14 |
1 files changed, 13 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 f6079f84c7..7156184b0f 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 @@ -135,7 +135,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); } @@ -212,4 +212,16 @@ void gtk_render_box (long /*int*/ style, long /*int*/ window, int state_type, in } } + +void gtk_render_layout (long /*int*/ style, long /*int*/ window, int state_type, boolean use_text, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, long /*int*/ layout) { + 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_layout (context, cairo, x, y, layout); + Cairo.cairo_destroy (cairo); + } else { + OS.gtk_paint_layout (style, window, state_type, use_text, area, widget, detail, x , y, layout); + } +} + } |