diff options
author | Alexander Kurtakov | 2018-03-15 09:08:00 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-03-15 09:08:00 +0000 |
commit | 85b8546ba92458a2cc0aaa2c274887f8bb0c6322 (patch) | |
tree | 6ae3ebcbfecbaa824b2ed76755f542276b79497c /bundles/org.eclipse.swt/Eclipse SWT PI/gtk | |
parent | a40565f29ee1fd415728731416240d68d0f6ecf5 (diff) | |
download | eclipse.platform.swt-85b8546ba92458a2cc0aaa2c274887f8bb0c6322.tar.gz eclipse.platform.swt-85b8546ba92458a2cc0aaa2c274887f8bb0c6322.tar.xz eclipse.platform.swt-85b8546ba92458a2cc0aaa2c274887f8bb0c6322.zip |
Bug 532475 - Move away of deprecated gdk_error_trap_push/pop
Deprecated in GTK 3.x as it's X11 only and there is even more efficient
pop function which doesn't block.
Change-Id: I856a18e340a02f8faf84a8a580030a903dc1c92f
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk')
4 files changed, 88 insertions, 0 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 fb2b491d3a..91418ba426 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 @@ -1246,7 +1246,15 @@ JNIEXPORT jint JNICALL GDK_NATIVE(_1gdk_1error_1trap_1pop) { jint rc = 0; GDK_NATIVE_ENTER(env, that, _1gdk_1error_1trap_1pop_FUNC); +/* rc = (jint)gdk_error_trap_pop(); +*/ + { + GDK_LOAD_FUNCTION(fp, gdk_error_trap_pop) + if (fp) { + rc = (jint)((jint (CALLING_CONVENTION*)())fp)(); + } + } GDK_NATIVE_EXIT(env, that, _1gdk_1error_1trap_1pop_FUNC); return rc; } @@ -1257,7 +1265,15 @@ JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1error_1trap_1push) (JNIEnv *env, jclass that) { GDK_NATIVE_ENTER(env, that, _1gdk_1error_1trap_1push_FUNC); +/* gdk_error_trap_push(); +*/ + { + GDK_LOAD_FUNCTION(fp, gdk_error_trap_push) + if (fp) { + ((void (CALLING_CONVENTION*)())fp)(); + } + } GDK_NATIVE_EXIT(env, that, _1gdk_1error_1trap_1push_FUNC); } #endif @@ -3464,6 +3480,42 @@ JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1window_1show_1unraised) } #endif +#ifndef NO__1gdk_1x11_1display_1error_1trap_1pop_1ignored +JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1x11_1display_1error_1trap_1pop_1ignored) + (JNIEnv *env, jclass that, jintLong arg0) +{ + GDK_NATIVE_ENTER(env, that, _1gdk_1x11_1display_1error_1trap_1pop_1ignored_FUNC); +/* + gdk_x11_display_error_trap_pop_ignored((GdkDisplay *)arg0); +*/ + { + GDK_LOAD_FUNCTION(fp, gdk_x11_display_error_trap_pop_ignored) + if (fp) { + ((void (CALLING_CONVENTION*)(GdkDisplay *))fp)((GdkDisplay *)arg0); + } + } + GDK_NATIVE_EXIT(env, that, _1gdk_1x11_1display_1error_1trap_1pop_1ignored_FUNC); +} +#endif + +#ifndef NO__1gdk_1x11_1display_1error_1trap_1push +JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1x11_1display_1error_1trap_1push) + (JNIEnv *env, jclass that, jintLong arg0) +{ + GDK_NATIVE_ENTER(env, that, _1gdk_1x11_1display_1error_1trap_1push_FUNC); +/* + gdk_x11_display_error_trap_push((GdkDisplay *)arg0); +*/ + { + GDK_LOAD_FUNCTION(fp, gdk_x11_display_error_trap_push) + if (fp) { + ((void (CALLING_CONVENTION*)(GdkDisplay *))fp)((GdkDisplay *)arg0); + } + } + GDK_NATIVE_EXIT(env, that, _1gdk_1x11_1display_1error_1trap_1push_FUNC); +} +#endif + #ifndef NO__1gdk_1x11_1display_1get_1xdisplay JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1x11_1display_1get_1xdisplay) (JNIEnv *env, jclass that, jintLong arg0) 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 7dba1abf59..af6c5895eb 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 @@ -236,6 +236,8 @@ char * GDK_nativeFunctionNames[] = { "_1gdk_1window_1shape_1combine_1region", "_1gdk_1window_1show", "_1gdk_1window_1show_1unraised", + "_1gdk_1x11_1display_1error_1trap_1pop_1ignored", + "_1gdk_1x11_1display_1error_1trap_1push", "_1gdk_1x11_1display_1get_1xdisplay", "_1gdk_1x11_1display_1utf8_1to_1compound_1text", "_1gdk_1x11_1drawable_1get_1xid", 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 702b2b099c..6307240031 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 @@ -246,6 +246,8 @@ typedef enum { _1gdk_1window_1shape_1combine_1region_FUNC, _1gdk_1window_1show_FUNC, _1gdk_1window_1show_1unraised_FUNC, + _1gdk_1x11_1display_1error_1trap_1pop_1ignored_FUNC, + _1gdk_1x11_1display_1error_1trap_1push_FUNC, _1gdk_1x11_1display_1get_1xdisplay_FUNC, _1gdk_1x11_1display_1utf8_1to_1compound_1text_FUNC, _1gdk_1x11_1drawable_1get_1xid_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java index 1944897425..3ca963de47 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java @@ -1188,6 +1188,22 @@ public class GDK extends OS { lock.unlock(); } } + /** + * @method flags=dynamic + * @param display cast=(GdkDisplay *) + */ + public static final native void _gdk_x11_display_error_trap_push(long /*int*/ display); + public static final void gdk_x11_display_error_trap_push(long /*int*/ display) { + lock.lock(); + try { + _gdk_x11_display_error_trap_push(display); + } finally { + lock.unlock(); + } + } + /** + * @method flags=dynamic + */ public static final native void _gdk_error_trap_push(); public static final void gdk_error_trap_push() { lock.lock(); @@ -1197,6 +1213,22 @@ public class GDK extends OS { lock.unlock(); } } + /** + * @method flags=dynamic + * @param display cast=(GdkDisplay *) + */ + public static final native void _gdk_x11_display_error_trap_pop_ignored(long /*int*/ display); + public static final void gdk_x11_display_error_trap_pop_ignored(long /*int*/ display) { + lock.lock(); + try { + _gdk_x11_display_error_trap_pop_ignored(display); + } finally { + lock.unlock(); + } + } + /** + * @method flags=dynamic + */ public static final native int _gdk_error_trap_pop(); public static final int gdk_error_trap_pop() { lock.lock(); |