Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c18
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java8
4 files changed, 33 insertions, 7 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 78e127d28f..de01c3ec7c 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2000, 2013 IBM Corporation and others. All rights reserved.
* The contents of this file are made available under the terms
* of the GNU Lesser General Public License (LGPL) Version 2.1 that
* accompanies this distribution (lgpl-v21.txt). The LGPL is also
@@ -4145,7 +4145,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1g_1thread_1init)
(JNIEnv *env, jclass that, jintLong arg0)
{
OS_NATIVE_ENTER(env, that, _1g_1thread_1init_FUNC);
+/*
g_thread_init((GThreadFunctions *)arg0);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, g_thread_init)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(GThreadFunctions *))fp)((GThreadFunctions *)arg0);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1g_1thread_1init_FUNC);
}
#endif
@@ -4156,7 +4164,15 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(_1g_1thread_1supported)
{
jboolean rc = 0;
OS_NATIVE_ENTER(env, that, _1g_1thread_1supported_FUNC);
+/*
rc = (jboolean)g_thread_supported();
+*/
+ {
+ OS_LOAD_FUNCTION(fp, g_thread_supported)
+ if (fp) {
+ rc = (jboolean)((jboolean (CALLING_CONVENTION*)())fp)();
+ }
+ }
OS_NATIVE_EXIT(env, that, _1g_1thread_1supported_FUNC);
return rc;
}
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 e20523f383..f655ac4e50 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
@@ -3301,7 +3301,10 @@ public static final long /*int*/ g_type_register_static (long /*int*/ parent_typ
lock.unlock();
}
}
-/** @param vtable cast=(GThreadFunctions *) */
+/**
+ * @method flags=dynamic
+ * @param vtable cast=(GThreadFunctions *)
+ */
public static final native void _g_thread_init(long /*int*/ vtable);
public static final void g_thread_init(long /*int*/ vtable) {
lock.lock();
@@ -3311,6 +3314,9 @@ public static final void g_thread_init(long /*int*/ vtable) {
lock.unlock();
}
}
+/**
+ * @method flags=dynamic
+ */
public static final native boolean _g_thread_supported();
public static final boolean g_thread_supported() {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
index f775588828..651d15090a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java
@@ -69,8 +69,10 @@ public final class Printer extends Device {
static boolean disablePrinting = System.getProperty("org.eclipse.swt.internal.gtk.disablePrinting") != null; //$NON-NLS-1$
static void gtk_init() {
- if (!OS.g_thread_supported ()) {
- OS.g_thread_init (0);
+ if (OS.GLIB_VERSION < OS.VERSION(2, 32, 0)) {
+ if (!OS.g_thread_supported()) {
+ OS.g_thread_init(0);
+ }
}
if (OS.GTK_VERSION < OS.VERSION(2, 24, 0)) {
OS.gtk_set_locale();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index c44405748d..67f10158ce 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -912,9 +912,11 @@ protected void create (DeviceData data) {
}
void createDisplay (DeviceData data) {
- /* Required for g_main_context_wakeup */
- if (!OS.g_thread_supported ()) {
- OS.g_thread_init (0);
+ if (OS.GLIB_VERSION < OS.VERSION(2, 32, 0)) {
+ /* Required for g_main_context_wakeup */
+ if (!OS.g_thread_supported()) {
+ OS.g_thread_init(0);
+ }
}
if (OS.GTK_VERSION < OS.VERSION(2, 24, 0)) {
OS.gtk_set_locale();

Back to the top