diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-09-06 16:11:09 -0400 |
---|---|---|
committer | Anatoly Spektor <aspektor@redhat.com> | 2012-09-06 16:11:09 -0400 |
commit | e7924f6ab80cc226ec0e19999509a4fdb4a7c719 (patch) | |
tree | 157df563660b6c881af3879d15ea3242aebc552c | |
parent | eda05e5e1bfd7a8e6860cccbab7bfcd105765ca8 (diff) | |
download | eclipse.platform.swt-gtk3_render_box.tar.gz eclipse.platform.swt-gtk3_render_box.tar.xz eclipse.platform.swt-gtk3_render_box.zip |
Use gtk_render_frame and gtk_render_background instead of gtk_paint_boxgtk3_render_box
This patch omits use of deprecated gtk_paint_box () method and uses
GTK+3 API methods instead.
12 files changed, 154 insertions, 12 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 90c1ebac16..1604dd33fc 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 @@ -10905,7 +10905,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1paint_1box) OS_NATIVE_ENTER(env, that, _1gtk_1paint_1box_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_box((GtkStyle *)arg0, (GdkWindow *)arg1, arg2, arg3, lparg4, (GtkWidget *)arg5, (const gchar *)lparg6, arg7, arg8, arg9, arg10); +/* + gtk_paint_box(arg0, (GdkWindow *)arg1, arg2, arg3, lparg4, (GtkWidget *)arg5, (const gchar *)lparg6, arg7, arg8, arg9, arg10); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_paint_box) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong, GdkWindow *, jint, jint, GdkRectangle *, GtkWidget *, const gchar *, jint, jint, jint, jint))fp)(arg0, (GdkWindow *)arg1, arg2, arg3, lparg4, (GtkWidget *)arg5, (const gchar *)lparg6, arg7, arg8, arg9, arg10); + } + } fail: if (arg6 && lparg6) (*env)->ReleaseByteArrayElements(env, arg6, lparg6, 0); if (arg4 && lparg4) setGdkRectangleFields(env, arg4, lparg4); @@ -12317,6 +12325,42 @@ fail: } #endif +#ifndef NO__1gtk_1render_1background +JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1render_1background) + (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdouble arg2, jdouble arg3, jdouble arg4, jdouble arg5) +{ + OS_NATIVE_ENTER(env, that, _1gtk_1render_1background_FUNC); +/* + gtk_render_background(arg0, (cairo_t *)arg1, (gdouble)arg2, (gdouble)arg3, (gdouble)arg4, (gdouble)arg5); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_render_background) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong, cairo_t *, gdouble, gdouble, gdouble, gdouble))fp)(arg0, (cairo_t *)arg1, (gdouble)arg2, (gdouble)arg3, (gdouble)arg4, (gdouble)arg5); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1render_1background_FUNC); +} +#endif + +#ifndef NO__1gtk_1render_1frame +JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1render_1frame) + (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdouble arg2, jdouble arg3, jdouble arg4, jdouble arg5) +{ + OS_NATIVE_ENTER(env, that, _1gtk_1render_1frame_FUNC); +/* + gtk_render_frame(arg0, (cairo_t *)arg1, (gdouble)arg2, (gdouble)arg3, (gdouble)arg4, (gdouble)arg5); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_render_frame) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong, cairo_t *, gdouble, gdouble, gdouble, gdouble))fp)(arg0, (cairo_t *)arg1, (gdouble)arg2, (gdouble)arg3, (gdouble)arg4, (gdouble)arg5); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1render_1frame_FUNC); +} +#endif + #ifndef NO__1gtk_1scale_1set_1digits JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1scale_1set_1digits) (JNIEnv *env, jclass that, jintLong arg0, jint arg1) @@ -15780,6 +15824,26 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1style) } #endif +#ifndef NO__1gtk_1widget_1get_1style_1context +JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1style_1context) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, _1gtk_1widget_1get_1style_1context_FUNC); +/* + rc = (jintLong)gtk_widget_get_style_context((GtkWidget *)arg0); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_widget_get_style_context) + if (fp) { + rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GtkWidget *))fp)((GtkWidget *)arg0); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1widget_1get_1style_1context_FUNC); + return rc; +} +#endif + #ifndef NO__1gtk_1widget_1get_1tooltip_1text JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1tooltip_1text) (JNIEnv *env, jclass that, jintLong arg0) 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 09073e9c3e..b5b40b92bc 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 @@ -226,10 +226,12 @@ #define gtk_widget_set_can_focus_LIB LIB_GTK #define gtk_widget_set_mapped_LIB LIB_GTK #define gtk_widget_set_sensitive_LIB LIB_GTK +#define gtk_widget_get_style_context_LIB LIB_GTK #define gtk_widget_set_receives_default_LIB LIB_GTK #define gtk_widget_set_visible_LIB LIB_GTK #define gtk_range_get_slider_range_LIB LIB_GTK #define gdk_pango_context_set_colormap_LIB LIB_GDK +#define gtk_paint_box_LIB LIB_GTK #define gdk_x11_screen_get_window_manager_name_LIB LIB_GDK #define gdk_x11_screen_lookup_visual_LIB LIB_GDK #define gdk_x11_window_lookup_for_display_LIB LIB_GDK @@ -333,6 +335,8 @@ #define gtk_printer_get_backend_LIB LIB_GTK #define gtk_printer_get_name_LIB LIB_GTK #define gtk_printer_is_default_LIB LIB_GTK +#define gtk_render_background_LIB LIB_GTK +#define gtk_render_frame_LIB LIB_GTK #define ubuntu_menu_proxy_get_LIB LIB_GTK #define FcConfigAppFontAddFile_LIB LIB_FONTCONFIG 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 119f1c66aa..19bc972b68 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 @@ -18,8 +18,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 1335; -int OS_nativeFunctionCallCount[1335]; +int OS_nativeFunctionCount = 1338; +int OS_nativeFunctionCallCount[1338]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -938,6 +938,8 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1rc_1style_1set_1color_1flags", "_1gtk_1rc_1style_1set_1fg", "_1gtk_1rc_1style_1set_1text", + "_1gtk_1render_1background", + "_1gtk_1render_1frame", "_1gtk_1scale_1set_1digits", "_1gtk_1scale_1set_1draw_1value", "_1gtk_1scrolled_1window_1add_1with_1viewport", @@ -1239,6 +1241,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1widget_1get_1sensitive", "_1gtk_1widget_1get_1size_1request", "_1gtk_1widget_1get_1style", + "_1gtk_1widget_1get_1style_1context", "_1gtk_1widget_1get_1tooltip_1text", "_1gtk_1widget_1get_1toplevel", "_1gtk_1widget_1get_1visible", 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 20250dbe2b..0b5d6cc395 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 @@ -946,6 +946,8 @@ typedef enum { _1gtk_1rc_1style_1set_1color_1flags_FUNC, _1gtk_1rc_1style_1set_1fg_FUNC, _1gtk_1rc_1style_1set_1text_FUNC, + _1gtk_1render_1background_FUNC, + _1gtk_1render_1frame_FUNC, _1gtk_1scale_1set_1digits_FUNC, _1gtk_1scale_1set_1draw_1value_FUNC, _1gtk_1scrolled_1window_1add_1with_1viewport_FUNC, @@ -1247,6 +1249,7 @@ typedef enum { _1gtk_1widget_1get_1sensitive_FUNC, _1gtk_1widget_1get_1size_1request_FUNC, _1gtk_1widget_1get_1style_FUNC, + _1gtk_1widget_1get_1style_1context_FUNC, _1gtk_1widget_1get_1tooltip_1text_FUNC, _1gtk_1widget_1get_1toplevel_FUNC, _1gtk_1widget_1get_1visible_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 c2310b7878..d5e9cf7ac3 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 @@ -8362,7 +8362,7 @@ public static final void gtk_paint_arrow(int /*long*/ style, int /*long*/ window } /** - * @param style cast=(GtkStyle *) + * @method flags=dynamic * @param window cast=(GdkWindow *) * @param widget cast=(GtkWidget *) * @param detail cast=(const gchar *) @@ -8377,6 +8377,53 @@ public static final void gtk_paint_box(int /*long*/ style, int /*long*/ window, } } /** + * @method flags=dynamic + * @param widget cast=(GtkWidget *) + */ +public static final native int /*long*/ _gtk_widget_get_style_context(int /*long*/ widget); +public static final int /*long*/ gtk_widget_get_style_context(int /*long*/ widget) { + lock.lock(); + try { + return _gtk_widget_get_style_context(widget); + } finally { + lock.unlock(); + } +} +/** + * @method flags=dynamic + * @param cr cast=(cairo_t *) + * @param x cast=(gdouble) + * @param y cast=(gdouble) + * @param width cast=(gdouble) + * @param height cast=(gdouble) + */ +public static final native void _gtk_render_frame(int /*long*/ context, int /*long*/ cr, double x , double y, double width, double height); +public static final void gtk_render_frame(int /*long*/ context, int /*long*/ cr, double x , double y, double width, double height) { + lock.lock(); + try { + _gtk_render_frame(context, cr, x, y, width, height); + } finally { + lock.unlock(); + } +} +/** + * @method flags=dynamic + * @param cr cast=(cairo_t *) + * @param x cast=(gdouble) + * @param y cast=(gdouble) + * @param width cast=(gdouble) + * @param height cast=(gdouble) + */ +public static final native void _gtk_render_background(int /*long*/ context, int /*long*/ cr, double x , double y, double width, double height); +public static final void gtk_render_background(int /*long*/ context, int /*long*/ cr, double x , double y, double width, double height) { + lock.lock(); + try { + _gtk_render_background(context, cr, x, y, width, height); + } finally { + lock.unlock(); + } +} +/** * @param style cast=(GtkStyle *) * @param window cast=(GdkWindow *) * @param widget cast=(GtkWidget *) diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java index eff7bef8ac..5da235ee6e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java @@ -155,7 +155,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { int relief = OS.gtk_button_get_relief(buttonHandle); byte[] detail = Converter.wcsToMbcs(null, (state & DrawData.DEFAULTED) != 0 ? "buttondefault" : "button", true); if ((state & DrawData.DEFAULTED) != 0 && relief == OS.GTK_RELIEF_NORMAL) { - OS.gtk_paint_box(gtkStyle, drawable, OS.GTK_STATE_NORMAL, OS.GTK_SHADOW_IN, null, buttonHandle, detail, x, y, width, height); + gtk_render_box(gtkStyle, drawable, OS.GTK_STATE_NORMAL, OS.GTK_SHADOW_IN, null, buttonHandle, detail, x, y, width, height); x += default_border.left; y += default_border.top; width -= default_border.left + default_border.right; @@ -172,7 +172,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { int state_type = getStateType(DrawData.WIDGET_WHOLE); if (relief != OS.GTK_RELIEF_NONE || ((state & (DrawData.PRESSED | DrawData.HOT)) != 0)) { - OS.gtk_paint_box(gtkStyle, drawable, state_type, shadow_type, null, buttonHandle, detail, x, y, width, height); + gtk_render_box(gtkStyle, drawable, state_type, shadow_type, null, buttonHandle, detail, x, y, width, height); } if ((state & DrawData.FOCUSED) != 0) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java index dbf3b0d0be..c2299c2db6 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java @@ -58,7 +58,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { int arrow_y = y + (height - arrow_height) / 2 + 1; if (relief != OS.GTK_RELIEF_NONE || ((state[DrawData.COMBO_ARROW] & (DrawData.PRESSED | DrawData.HOT)) != 0)) { byte[] detail = Converter.wcsToMbcs(null, "button", true); - OS.gtk_paint_box(gtkStyle, drawable, state_type, shadow_type, null, buttonHandle, detail, arrow_button_x, y, arrow_button_width, height); + gtk_render_box(gtkStyle, drawable, state_type, shadow_type, null, buttonHandle, detail, arrow_button_x, y, arrow_button_width, height); } byte[] arrow_detail = Converter.wcsToMbcs(null, "arrow", true); int /*long*/ arrowHandle = theme.arrowHandle; 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..0c941a526e 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 @@ -188,4 +188,15 @@ 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_box (int /*long*/ style, int /*long*/ window, int state_type, int shadow_type, GdkRectangle area, int /*long*/ widget, byte[] detail, int x , int y, int width, int height) { + 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_frame(context, cairo, x, y, width, height); + OS.gtk_render_background(context, cairo, x, y, width, height); + } else { + OS.gtk_paint_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); + } +} + } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java index 04d3ea9825..7d5eb4eb33 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ProgressBarDrawData.java @@ -28,7 +28,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { theme.transferClipping(gc, gtkStyle); byte[] detail = Converter.wcsToMbcs(null, "trough", true); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; - OS.gtk_paint_box(gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_IN, null, progressHandle, detail, x, y, width, height); + gtk_render_box(gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_IN, null, progressHandle, detail, x, y, width, height); int xthichness = OS.gtk_style_get_xthickness(gtkStyle); int ythichness = OS.gtk_style_get_ythickness(gtkStyle); if ((style & SWT.VERTICAL) != 0) { @@ -47,7 +47,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { width *= selection / (float)Math.max(1, maximum - minimum); } detail = Converter.wcsToMbcs(null, "bar", true); - OS.gtk_paint_box(gtkStyle, drawable, OS.GTK_STATE_PRELIGHT, OS.GTK_SHADOW_OUT, null, progressHandle, detail, x, y, width, height); + gtk_render_box(gtkStyle, drawable, OS.GTK_STATE_PRELIGHT, OS.GTK_SHADOW_OUT, null, progressHandle, detail, x, y, width, height); } int getStateType(int part) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolBarDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolBarDrawData.java index 4c99b12d7d..e6f42f547f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolBarDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolBarDrawData.java @@ -27,7 +27,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { theme.transferClipping(gc, gtkStyle); int x = bounds.x, y = bounds.y, width = bounds.width, height = bounds.height; byte[] detail = Converter.wcsToMbcs(null, "toolbar", true); - OS.gtk_paint_box(gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_NONE, null, toolbarHandle, detail, x, y, width, height); + gtk_render_box(gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_NONE, null, toolbarHandle, detail, x, y, width, height); if (clientArea != null) { clientArea.x = bounds.x; clientArea.y = bounds.y; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java index 67cc405d4f..9fc883fa14 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java @@ -91,7 +91,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { int state_type = getStateType(DrawData.WIDGET_WHOLE); if (relief[0] != OS.GTK_RELIEF_NONE || ((state & (DrawData.PRESSED | DrawData.HOT | DrawData.SELECTED)) != 0)) { - OS.gtk_paint_box(gtkStyle, drawable, state_type, shadow_type, null, buttonHandle, detail, x, y, width, height); + gtk_render_box(gtkStyle, drawable, state_type, shadow_type, null, buttonHandle, detail, x, y, width, height); } if (clientArea != null) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java index 91bc955651..5195e2c9ec 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java @@ -1233,7 +1233,7 @@ int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ event) { OS.gtk_paint_flat_box (style, window, state, OS.GTK_SHADOW_NONE, area, widget, detail, 0, height [0] - border, width [0], border); OS.gtk_paint_flat_box (style, window, state, OS.GTK_SHADOW_NONE, area, widget, detail, 0, border, border, height [0] - border - border); OS.gtk_paint_flat_box (style, window, state, OS.GTK_SHADOW_NONE, area, widget, detail, width [0] - border, border, border, height [0] - border - border); - OS.gtk_paint_box (style, window, state, OS.GTK_SHADOW_OUT, area, widget, detail, 0, 0, width [0], height [0]); + gtk_render_box(style, window, state, OS.GTK_SHADOW_OUT, area, widget, detail, 0, 0, width [0], height [0]); return 1; } return 0; @@ -2540,4 +2540,14 @@ void setToolTipText (int /*long*/ rootWidget, int /*long*/ tipWidget, String str } } +void gtk_render_box (int /*long*/ style, int /*long*/ window, int state_type, int shadow_type, GdkRectangle area, int /*long*/ widget, byte[] detail, int x , int y, int width, int height) { + 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_frame(context, cairo, X, y, width, height); + OS.gtk_render_background(context, cairo, X, y, width, height); + } else { + OS.gtk_paint_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); + } +} } |