diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-10-15 10:41:50 -0400 |
---|---|---|
committer | Anatoly Spektor <aspektor@redhat.com> | 2012-10-15 10:41:50 -0400 |
commit | f3d0fe0b4f940ca373d614dbf9a2ffe2a2347cc4 (patch) | |
tree | d0873aadef9b2a8b92cb1e8a1cd041a96582a364 | |
parent | 90beec4af69432d76fc877e39fc80aef43f9b1ce (diff) | |
download | eclipse.platform.swt-gtk3_render_extension_64.tar.gz eclipse.platform.swt-gtk3_render_extension_64.tar.xz eclipse.platform.swt-gtk3_render_extension_64.zip |
Use gtk_render_extension instead of gtk_paint_extension for GTK+ 3gtk3_render_extension_64
This patch uses gtk_render_extension instead of deprecated
gtk_paint_extension method for GTK+ 3.
6 files changed, 61 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c index 8d344d8fda..56ae283f5e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c @@ -11492,7 +11492,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1paint_1extension) OS_NATIVE_ENTER(env, that, _1gtk_1paint_1extension_FUNC); if (arg4) if ((lparg4 = getGdkRectangleFields(env, arg4, &_arg4)) == NULL) goto fail; if (arg6) if ((lparg6 = (*env)->GetByteArrayElements(env, arg6, NULL)) == NULL) goto fail; - gtk_paint_extension((GtkStyle *)arg0, (GdkWindow *)arg1, arg2, arg3, lparg4, (GtkWidget *)arg5, (gchar *)lparg6, arg7, arg8, arg9, arg10, arg11); +/* + gtk_paint_extension(arg0, (GdkWindow *)arg1, arg2, arg3, lparg4, (GtkWidget *)arg5, (gchar *)lparg6, arg7, arg8, arg9, arg10, arg11); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_paint_extension) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong, GdkWindow *, jint, jint, GdkRectangle *, GtkWidget *, gchar *, jint, jint, jint, jint, jint))fp)(arg0, (GdkWindow *)arg1, arg2, arg3, lparg4, (GtkWidget *)arg5, (gchar *)lparg6, arg7, arg8, arg9, arg10, arg11); + } + } fail: if (arg6 && lparg6) (*env)->ReleaseByteArrayElements(env, arg6, lparg6, 0); if (arg4 && lparg4) setGdkRectangleFields(env, arg4, lparg4); @@ -12972,6 +12980,24 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1render_1expander) } #endif +#ifndef NO__1gtk_1render_1extension +JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1render_1extension) + (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdouble arg2, jdouble arg3, jdouble arg4, jdouble arg5, jint arg6) +{ + OS_NATIVE_ENTER(env, that, _1gtk_1render_1extension_FUNC); +/* + gtk_render_extension(arg0, arg1, (gdouble)arg2, (gdouble)arg3, (gdouble)arg4, (gdouble)arg5, (GtkPositionType)arg6); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_render_extension) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong, jintLong, gdouble, gdouble, gdouble, gdouble, GtkPositionType))fp)(arg0, arg1, (gdouble)arg2, (gdouble)arg3, (gdouble)arg4, (gdouble)arg5, (GtkPositionType)arg6); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1render_1extension_FUNC); +} +#endif + #ifndef NO__1gtk_1render_1focus JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1render_1focus) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdouble arg2, jdouble arg3, jdouble arg4, jdouble arg5) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h index 33e91aa518..042203f488 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h @@ -322,6 +322,7 @@ #define gtk_paint_handle_LIB LIB_GTK #define gtk_paint_focus_LIB LIB_GTK #define gtk_paint_expander_LIB LIB_GTK +#define gtk_paint_extension_LIB LIB_GTK #define gtk_paint_hline_LIB LIB_GTK #define gtk_paint_vline_LIB LIB_GTK #define gtk_paint_flat_box_LIB LIB_GTK @@ -398,6 +399,7 @@ #define gtk_printer_get_name_LIB LIB_GTK #define gtk_printer_is_default_LIB LIB_GTK #define gtk_render_check_LIB LIB_GTK +#define gtk_render_extension_LIB LIB_GTK #define gtk_render_expander_LIB LIB_GTK #define gtk_render_handle_LIB LIB_GTK #define gtk_render_line_LIB LIB_GTK diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c index 4e78f040c3..36c3a5c8a3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c @@ -956,6 +956,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1render_1background", "_1gtk_1render_1check", "_1gtk_1render_1expander", + "_1gtk_1render_1extension", "_1gtk_1render_1focus", "_1gtk_1render_1frame", "_1gtk_1render_1frame_1gap", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h index c3ede72adc..a5714950a8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h @@ -966,6 +966,7 @@ typedef enum { _1gtk_1render_1background_FUNC, _1gtk_1render_1check_FUNC, _1gtk_1render_1expander_FUNC, + _1gtk_1render_1extension_FUNC, _1gtk_1render_1focus_FUNC, _1gtk_1render_1frame_FUNC, _1gtk_1render_1frame_1gap_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index 1551cfcca3..5747533dbb 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -8666,6 +8666,23 @@ public static final void gtk_render_frame_gap(long /*int*/ context, long /*int*/ * @method flags=dynamic * @param x cast=(gdouble) * @param y cast=(gdouble) + * @param width cast=(gdouble) + * @param height cast=(gdouble) + * @param gap_side cast=(GtkPositionType) + */ +public static final native void _gtk_render_extension(long /*int*/ context, long /*int*/ cr, double x , double y, double width, double height, int gap_side); +public static final void gtk_render_extension(long /*int*/ context, long /*int*/ cr, double x , double y, double width, double height, int gap_side) { + lock.lock(); + try { + _gtk_render_extension(context, cr, x, y, width, height, gap_side); + } finally { + lock.unlock(); + } +} +/** + * @method flags=dynamic + * @param x cast=(gdouble) + * @param y cast=(gdouble) * @param layout cast=(PangoLayout *) */ public static final native void _gtk_render_layout(long /*int*/ context, long /*int*/ cr, double x , double y, long /*int*/ layout); @@ -8864,7 +8881,7 @@ public static final void gtk_paint_expander(long /*int*/ style, long /*int*/ win } } /** - * @param style cast=(GtkStyle *) + * @method flags=dynamic * @param window cast=(GdkWindow *) * @param widget cast=(GtkWidget *) * @param detail cast=(gchar *) 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); + } +} } |