Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-09-17 13:10:40 +0000
committerAlexander Kurtakov2018-09-17 13:10:40 +0000
commitb6f813c957bfc8f6cc97a68377e6dbcbe88fef5d (patch)
treed1f29c175fdef0f09a6118da02529c06bf93bc0e
parent6069e1bf951aeb04e16c784e094990289ab7782f (diff)
downloadeclipse.platform.swt-b6f813c957bfc8f6cc97a68377e6dbcbe88fef5d.tar.gz
eclipse.platform.swt-b6f813c957bfc8f6cc97a68377e6dbcbe88fef5d.tar.xz
eclipse.platform.swt-b6f813c957bfc8f6cc97a68377e6dbcbe88fef5d.zip
Bug 530841: [GTK2] Remove GTK 2.x support
Remove code for Glib versions older than the min requirement of GTK 3.4. Change-Id: I49def92f6f3a3dfe9583b9dd6b28bf5027d712e0 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c30
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java31
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java6
7 files changed, 1 insertions, 80 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 1ece3d3d22..c651d0e588 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
@@ -16165,36 +16165,6 @@ fail:
}
#endif
-#ifndef NO__1g_1thread_1init
-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(arg0);
-*/
- {
- OS_LOAD_FUNCTION(fp, g_thread_init)
- if (fp) {
- ((void (CALLING_CONVENTION*)(jintLong))fp)(arg0);
- }
- }
- OS_NATIVE_EXIT(env, that, _1g_1thread_1init_FUNC);
-}
-#endif
-
-#ifndef NO__1g_1thread_1supported
-JNIEXPORT jboolean JNICALL OS_NATIVE(_1g_1thread_1supported)
- (JNIEnv *env, jclass that)
-{
- jboolean rc = 0;
- OS_NATIVE_ENTER(env, that, _1g_1thread_1supported_FUNC);
- rc = (jboolean)g_thread_supported();
- OS_NATIVE_EXIT(env, that, _1g_1thread_1supported_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1g_1timeout_1add
JNIEXPORT jint JNICALL OS_NATIVE(_1g_1timeout_1add)
(JNIEnv *env, jclass that, jint arg0, jintLong arg1, jintLong arg2)
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 9ccc85811c..ee39d7fc13 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
@@ -64,7 +64,6 @@
/* Libraries for dynamic loaded functions */
-#define g_thread_init_LIB LIB_GTHREAD
#define ubuntu_menu_proxy_get_LIB LIB_GTK
#define FcConfigAppFontAddFile_LIB LIB_FONTCONFIG
#define g_dbus_proxy_call_LIB LIB_GLIB
@@ -73,10 +72,6 @@
#define g_bytes_new_LIB LIB_GLIB
#define g_bytes_unref_LIB LIB_GLIB
-#ifndef g_thread_supported
-#define g_thread_supported() 0
-#endif
-
/* Field accessors */
#define G_OBJECT_CLASS_CONSTRUCTOR(arg0) (arg0)->constructor
#define G_OBJECT_CLASS_SET_CONSTRUCTOR(arg0, arg1) (arg0)->constructor = (GObject* (*) (GType, guint, GObjectConstructParam *))arg1
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 aacacf8b25..b3ff601a6a 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
@@ -1391,8 +1391,6 @@ char * OS_nativeFunctionNames[] = {
"_1g_1string_1free",
"_1g_1string_1new_1len",
"_1g_1strtod",
- "_1g_1thread_1init",
- "_1g_1thread_1supported",
"_1g_1timeout_1add",
"_1g_1type_1add_1interface_1static",
"_1g_1type_1class_1peek",
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 1bcbd840d6..bd8635db2d 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
@@ -1377,8 +1377,6 @@ typedef enum {
_1g_1string_1free_FUNC,
_1g_1string_1new_1len_FUNC,
_1g_1strtod_FUNC,
- _1g_1thread_1init_FUNC,
- _1g_1thread_1supported_FUNC,
_1g_1timeout_1add_FUNC,
_1g_1type_1add_1interface_1static_FUNC,
_1g_1type_1class_1peek_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 dc0feac4ae..aa253310c4 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
@@ -659,12 +659,9 @@ public class OS extends C {
/**
* Gtk has a minimum glib version. (But it's not a 1:1 link, one can have a newer version of glib and older gtk).
*
- * Minimum Glib version requirement of gtk (for gtk2/gtk3) can be found in gtk's 'configure.ac' file, see line 'm4_define([glib_required_version],[2.*.*]).
+ * Minimum Glib version requirement of gtk can be found in gtk's 'configure.ac' file, see line 'm4_define([glib_required_version],[2.*.*]).
*
* For reference:
- * Gtk2.24 has min version of glib 2.28
- * Gtk3.0 has min version of glib 2.28
- * Gtk3.2 has min version of glib 2.29.14
* Gtk3.4 has min version of glib 2.32
* Gtk3.6 has min version of glib 2.33.1
* Gtk3.8 has min version of glib 2.35.3
@@ -677,7 +674,6 @@ public class OS extends C {
* Gtk3.22 has min version of glib 2.49.4
*/
public static final int GLIB_VERSION = VERSION(glib_major_version(), glib_minor_version(), glib_micro_version());
- private static final boolean MIN_GLIB_2_32 = OS.GLIB_VERSION >= VERSION(2, 32, 0);
/*
* New API in GTK3.22 introduced the "popped-up" signal, which provides
@@ -2162,7 +2158,6 @@ public static final void g_object_unref(long /*int*/ object) {
*/
public static final native long /*int*/ _g_bytes_new (byte [] data, long /*int*/ size);
public static final long /*int*/ g_bytes_new (byte [] data, long /*int*/ size) {
- assert MIN_GLIB_2_32; // Note Gtk3.4 == glib 2.32
lock.lock();
try {
return _g_bytes_new (data, size);
@@ -2177,7 +2172,6 @@ public static final long /*int*/ g_bytes_new (byte [] data, long /*int*/ size) {
*/
public static final native void _g_bytes_unref (long /*int*/ gBytes);
public static final void g_bytes_unref (long /*int*/ gBytes) {
- assert MIN_GLIB_2_32; // Note Gtk3.4 == glib 2.32
lock.lock();
try {
_g_bytes_unref (gBytes);
@@ -2664,29 +2658,6 @@ public static final long /*int*/ g_type_register_static (long /*int*/ parent_typ
}
}
/**
- * @method flags=dynamic
- */
-public static final native void _g_thread_init(long /*int*/ vtable);
-/** Treat with special care, platform specific behaviour. See os_custom.h */
-public static final void g_thread_init(long /*int*/ vtable) {
- lock.lock();
- try {
- _g_thread_init(vtable);
- } finally {
- lock.unlock();
- }
-}
-public static final native boolean _g_thread_supported();
-/** Treat with special care, see os_custom.h */
-public static final boolean g_thread_supported() {
- lock.lock();
- try {
- return _g_thread_supported();
- } finally {
- lock.unlock();
- }
-}
-/**
* @param str cast=(const gunichar2 *),flags=no_out critical
* @param len cast=(glong)
* @param items_read cast=(glong *),flags=critical
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 4bce5d7c04..fb2ca6a97a 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,11 +69,6 @@ public final class Printer extends Device {
static boolean disablePrinting = OS.IsWin32 || System.getProperty("org.eclipse.swt.internal.gtk.disablePrinting") != null; //$NON-NLS-1$
static void gtk_init() {
- if (OS.GLIB_VERSION < OS.VERSION(2, 32, 0)) {
- if (!OS.g_thread_supported()) {
- OS.g_thread_init(0);
- }
- }
if (!GTK.gtk_init_check (new long /*int*/ [] {0}, null)) {
SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]");
}
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 b7d9a81cad..8b1a0fe11c 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
@@ -1026,12 +1026,6 @@ void checkXimModule () {
}
void createDisplay (DeviceData data) {
- 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 (!GTK.gtk_init_check (new long /*int*/ [] {0}, null)) {
SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]"); //$NON-NLS-1$
}

Back to the top