Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-09-17 12:30:59 +0000
committerAlexander Kurtakov2018-09-17 12:30:59 +0000
commit6b767d5ea4b8299ceb4fe67f3b0ea1ae89f411ef (patch)
treee7a3fbaa869e0077b9829243e15e6701f3b074e4
parenta313c8ddf51c1ec98cba03ae96404b91038e0ee7 (diff)
downloadeclipse.platform.swt-6b767d5ea4b8299ceb4fe67f3b0ea1ae89f411ef.tar.gz
eclipse.platform.swt-6b767d5ea4b8299ceb4fe67f3b0ea1ae89f411ef.tar.xz
eclipse.platform.swt-6b767d5ea4b8299ceb4fe67f3b0ea1ae89f411ef.zip
Bug 530841: [GTK2] Remove GTK 2.x support
Adjust to GtkOrientable usage in newer GTKs. Change-Id: Icdedb0dbb92bb8dc96c69ee12e1506a33997aa52 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c120
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java77
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java20
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java18
7 files changed, 8 insertions, 259 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 92c911debe..f244f16af6 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
@@ -6601,66 +6601,6 @@ JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1grab_1remove)
}
#endif
-#ifndef NO__1gtk_1hscale_1new
-JNIEXPORT jintLong JNICALL GTK_NATIVE(_1gtk_1hscale_1new)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jintLong rc = 0;
- GTK_NATIVE_ENTER(env, that, _1gtk_1hscale_1new_FUNC);
-/*
- rc = (jintLong)gtk_hscale_new((GtkAdjustment *)arg0);
-*/
- {
- GTK_LOAD_FUNCTION(fp, gtk_hscale_new)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GtkAdjustment *))fp)((GtkAdjustment *)arg0);
- }
- }
- GTK_NATIVE_EXIT(env, that, _1gtk_1hscale_1new_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gtk_1hscrollbar_1new
-JNIEXPORT jintLong JNICALL GTK_NATIVE(_1gtk_1hscrollbar_1new)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jintLong rc = 0;
- GTK_NATIVE_ENTER(env, that, _1gtk_1hscrollbar_1new_FUNC);
-/*
- rc = (jintLong)gtk_hscrollbar_new((GtkAdjustment *)arg0);
-*/
- {
- GTK_LOAD_FUNCTION(fp, gtk_hscrollbar_new)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GtkAdjustment *))fp)((GtkAdjustment *)arg0);
- }
- }
- GTK_NATIVE_EXIT(env, that, _1gtk_1hscrollbar_1new_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gtk_1hseparator_1new
-JNIEXPORT jintLong JNICALL GTK_NATIVE(_1gtk_1hseparator_1new)
- (JNIEnv *env, jclass that)
-{
- jintLong rc = 0;
- GTK_NATIVE_ENTER(env, that, _1gtk_1hseparator_1new_FUNC);
-/*
- rc = (jintLong)gtk_hseparator_new();
-*/
- {
- GTK_LOAD_FUNCTION(fp, gtk_hseparator_new)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)())fp)();
- }
- }
- GTK_NATIVE_EXIT(env, that, _1gtk_1hseparator_1new_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1gtk_1hsv_1to_1rgb
JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1hsv_1to_1rgb)
(JNIEnv *env, jclass that, jdouble arg0, jdouble arg1, jdouble arg2, jdoubleArray arg3, jdoubleArray arg4, jdoubleArray arg5)
@@ -11937,66 +11877,6 @@ JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1viewport_1set_1shadow_1type)
}
#endif
-#ifndef NO__1gtk_1vscale_1new
-JNIEXPORT jintLong JNICALL GTK_NATIVE(_1gtk_1vscale_1new)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jintLong rc = 0;
- GTK_NATIVE_ENTER(env, that, _1gtk_1vscale_1new_FUNC);
-/*
- rc = (jintLong)gtk_vscale_new((GtkAdjustment *)arg0);
-*/
- {
- GTK_LOAD_FUNCTION(fp, gtk_vscale_new)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GtkAdjustment *))fp)((GtkAdjustment *)arg0);
- }
- }
- GTK_NATIVE_EXIT(env, that, _1gtk_1vscale_1new_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gtk_1vscrollbar_1new
-JNIEXPORT jintLong JNICALL GTK_NATIVE(_1gtk_1vscrollbar_1new)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jintLong rc = 0;
- GTK_NATIVE_ENTER(env, that, _1gtk_1vscrollbar_1new_FUNC);
-/*
- rc = (jintLong)gtk_vscrollbar_new((GtkAdjustment *)arg0);
-*/
- {
- GTK_LOAD_FUNCTION(fp, gtk_vscrollbar_new)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GtkAdjustment *))fp)((GtkAdjustment *)arg0);
- }
- }
- GTK_NATIVE_EXIT(env, that, _1gtk_1vscrollbar_1new_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1gtk_1vseparator_1new
-JNIEXPORT jintLong JNICALL GTK_NATIVE(_1gtk_1vseparator_1new)
- (JNIEnv *env, jclass that)
-{
- jintLong rc = 0;
- GTK_NATIVE_ENTER(env, that, _1gtk_1vseparator_1new_FUNC);
-/*
- rc = (jintLong)gtk_vseparator_new();
-*/
- {
- GTK_LOAD_FUNCTION(fp, gtk_vseparator_new)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)())fp)();
- }
- }
- GTK_NATIVE_EXIT(env, that, _1gtk_1vseparator_1new_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1gtk_1widget_1add_1accelerator
JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1widget_1add_1accelerator)
(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1, jintLong arg2, jint arg3, jint arg4, jint arg5)
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 98a8d28278..524e6cc41d 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
@@ -506,9 +506,6 @@ char * GTK_nativeFunctionNames[] = {
"_1gtk_1grab_1add",
"_1gtk_1grab_1get_1current",
"_1gtk_1grab_1remove",
- "_1gtk_1hscale_1new",
- "_1gtk_1hscrollbar_1new",
- "_1gtk_1hseparator_1new",
"_1gtk_1hsv_1to_1rgb",
"_1gtk_1icon_1info_1free",
"_1gtk_1icon_1info_1load_1icon",
@@ -973,9 +970,6 @@ char * GTK_nativeFunctionNames[] = {
"_1gtk_1tree_1view_1set_1search_1column",
"_1gtk_1tree_1view_1unset_1rows_1drag_1dest",
"_1gtk_1viewport_1set_1shadow_1type",
- "_1gtk_1vscale_1new",
- "_1gtk_1vscrollbar_1new",
- "_1gtk_1vseparator_1new",
"_1gtk_1widget_1add_1accelerator",
"_1gtk_1widget_1add_1events",
"_1gtk_1widget_1child_1focus",
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 11ca8176fa..1ea7f28db9 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
@@ -504,9 +504,6 @@ typedef enum {
_1gtk_1grab_1add_FUNC,
_1gtk_1grab_1get_1current_FUNC,
_1gtk_1grab_1remove_FUNC,
- _1gtk_1hscale_1new_FUNC,
- _1gtk_1hscrollbar_1new_FUNC,
- _1gtk_1hseparator_1new_FUNC,
_1gtk_1hsv_1to_1rgb_FUNC,
_1gtk_1icon_1info_1free_FUNC,
_1gtk_1icon_1info_1load_1icon_FUNC,
@@ -971,9 +968,6 @@ typedef enum {
_1gtk_1tree_1view_1set_1search_1column_FUNC,
_1gtk_1tree_1view_1unset_1rows_1drag_1dest_FUNC,
_1gtk_1viewport_1set_1shadow_1type_FUNC,
- _1gtk_1vscale_1new_FUNC,
- _1gtk_1vscrollbar_1new_FUNC,
- _1gtk_1vseparator_1new_FUNC,
_1gtk_1widget_1add_1accelerator_FUNC,
_1gtk_1widget_1add_1events_FUNC,
_1gtk_1widget_1child_1focus_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
index 073c1f46e6..a7110fc246 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java
@@ -3083,20 +3083,6 @@ public class GTK extends OS {
}
/**
* @method flags=dynamic
- * @param adjustment cast=(GtkAdjustment *)
- */
- public static final native long /*int*/ _gtk_hscale_new(long /*int*/ adjustment);
- /** [GTK2/GTK3; 3.2 deprecated] */
- public static final long /*int*/ gtk_hscale_new(long /*int*/ adjustment) {
- lock.lock();
- try {
- return _gtk_hscale_new(adjustment);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @method flags=dynamic
* @param orientation cast=(GtkOrientation)
* @param adjustment cast=(GtkAdjustment *)
*/
@@ -3110,20 +3096,6 @@ public class GTK extends OS {
}
}
/**
- * @method flags=dynamic
- * @param adjustment cast=(GtkAdjustment *)
- */
- public static final native long /*int*/ _gtk_hscrollbar_new(long /*int*/ adjustment);
- /** [GTK2/GTK3; 3.2 deprecated] */
- public static final long /*int*/ gtk_hscrollbar_new(long /*int*/ adjustment) {
- lock.lock();
- try {
- return _gtk_hscrollbar_new(adjustment);
- } finally {
- lock.unlock();
- }
- }
- /**
* @method flags=dynamic
* @param orientation cast=(GtkOrientation)
* @param adjustment cast=(GtkAdjustment *)
@@ -3137,16 +3109,6 @@ public class GTK extends OS {
lock.unlock();
}
}
- /** @method flags=dynamic */
- public static final native long /*int*/ _gtk_hseparator_new();
- public static final long /*int*/ gtk_hseparator_new() {
- lock.lock();
- try {
- return _gtk_hseparator_new();
- } finally {
- lock.unlock();
- }
- }
/**
* @method flags=dynamic
* @param orientation cast=(GtkOrientation)
@@ -7989,45 +7951,6 @@ public class GTK extends OS {
}
}
/**
- * @method flags=dynamic
- * @param adjustment cast=(GtkAdjustment *)
- */
- public static final native long /*int*/ _gtk_vscale_new(long /*int*/ adjustment);
- /** [GTK2/GTK3; 3.2 deprecated] */
- public static final long /*int*/ gtk_vscale_new(long /*int*/ adjustment) {
- lock.lock();
- try {
- return _gtk_vscale_new(adjustment);
- } finally {
- lock.unlock();
- }
- }
- /**
- * @method flags=dynamic
- * @param adjustment cast=(GtkAdjustment *)
- */
- public static final native long /*int*/ _gtk_vscrollbar_new(long /*int*/ adjustment);
- /** [GTK2/GTK3; 3.2 deprecated] */
- public static final long /*int*/ gtk_vscrollbar_new(long /*int*/ adjustment) {
- lock.lock();
- try {
- return _gtk_vscrollbar_new(adjustment);
- } finally {
- lock.unlock();
- }
- }
- /** @method flags=dynamic */
- public static final native long /*int*/ _gtk_vseparator_new();
- /** [GTK2/GTK3; 3.2 deprecated] */
- public static final long /*int*/ gtk_vseparator_new() {
- lock.lock();
- try {
- return _gtk_vseparator_new();
- } finally {
- lock.unlock();
- }
- }
- /**
* @param widget cast=(GtkWidget *)
* @param accel_signal cast=(const gchar *)
* @param accel_group cast=(GtkAccelGroup *)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
index 75bb8bfb19..7de6afb43d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -233,12 +233,12 @@ void createHandle (int index) {
GTK.gtk_widget_set_has_window (fixedHandle, true);
if ((style & SWT.SEPARATOR) != 0) {
if ((style & SWT.HORIZONTAL)!= 0) {
- handle = gtk_separator_new (GTK.GTK_ORIENTATION_HORIZONTAL);
+ handle = GTK.gtk_separator_new (GTK.GTK_ORIENTATION_HORIZONTAL);
if (handle != 0 && GTK.GTK_VERSION >= OS.VERSION(3, 20, 0)) {
GTK.gtk_widget_set_valign(handle, GTK.GTK_ALIGN_CENTER);
}
} else {
- handle = gtk_separator_new (GTK.GTK_ORIENTATION_VERTICAL);
+ handle = GTK.gtk_separator_new (GTK.GTK_ORIENTATION_VERTICAL);
if (handle != 0 && GTK.GTK_VERSION >= OS.VERSION(3, 20, 0)) {
GTK.gtk_widget_set_halign(handle, GTK.GTK_ALIGN_CENTER);
}
@@ -704,20 +704,6 @@ void showWidget () {
if (boxHandle != 0) GTK.gtk_widget_show (boxHandle);
}
-long /*int*/ gtk_separator_new (int orientation) {
- long /*int*/ separator = 0;
- if (GTK.GTK3) {
- separator = GTK.gtk_separator_new (orientation);
- } else {
- if (orientation == GTK.GTK_ORIENTATION_HORIZONTAL) {
- separator = GTK.gtk_hseparator_new ();
- } else {
- separator = GTK.gtk_vseparator_new ();
- }
- }
- return separator;
-}
-
@Override
long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ user_data) {
/*
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
index 809024181c..4dff30c213 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -134,9 +134,9 @@ void createHandle (int index) {
long /*int*/ hAdjustment = GTK.gtk_adjustment_new (0, 0, 100, 1, 10, 0);
if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.HORIZONTAL) != 0) {
- handle = gtk_scale_new (GTK.GTK_ORIENTATION_HORIZONTAL, hAdjustment);
+ handle = GTK.gtk_scale_new (GTK.GTK_ORIENTATION_HORIZONTAL, hAdjustment);
} else {
- handle = gtk_scale_new (GTK.GTK_ORIENTATION_VERTICAL, hAdjustment);
+ handle = GTK.gtk_scale_new (GTK.GTK_ORIENTATION_VERTICAL, hAdjustment);
}
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
GTK.gtk_container_add (fixedHandle, handle);
@@ -370,20 +370,6 @@ public void setSelection (int value) {
OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
}
-long /*int*/ gtk_scale_new (int orientation, long /*int*/ adjustment) {
- long /*int*/ scale = 0;
- if (GTK.GTK3) {
- scale = GTK.gtk_scale_new (orientation, adjustment);
- } else {
- if (orientation == GTK.GTK_ORIENTATION_HORIZONTAL) {
- scale = GTK.gtk_hscale_new (adjustment);
- } else {
- scale = GTK.gtk_vscale_new (adjustment);
- }
- }
- return scale;
-}
-
@Override
Point resizeCalculationsGTK3(long /*int*/ widget, int width, int height) {
Point size = super.resizeCalculationsGTK3(widget, width, height);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
index 81a66f4a51..9078b7414f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
@@ -160,9 +160,9 @@ void createHandle (int index) {
long /*int*/ hAdjustment = GTK.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.HORIZONTAL) != 0) {
- handle = gtk_scrollbar_new (GTK.GTK_ORIENTATION_HORIZONTAL, hAdjustment);
+ handle = GTK.gtk_scrollbar_new (GTK.GTK_ORIENTATION_HORIZONTAL, hAdjustment);
} else {
- handle = gtk_scrollbar_new (GTK.GTK_ORIENTATION_VERTICAL, hAdjustment);
+ handle = GTK.gtk_scrollbar_new (GTK.GTK_ORIENTATION_VERTICAL, hAdjustment);
}
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
/*
@@ -618,18 +618,4 @@ public void setValues (int selection, int minimum, int maximum, int thumb, int i
OS.g_signal_handlers_unblock_matched (handle, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
}
-long /*int*/ gtk_scrollbar_new (int orientation, long /*int*/ adjustment) {
- long /*int*/ scrollbar = 0;
- if (GTK.GTK3) {
- scrollbar = GTK.gtk_scrollbar_new (orientation, adjustment);
- } else {
- if (orientation == GTK.GTK_ORIENTATION_HORIZONTAL) {
- scrollbar = GTK.gtk_hscrollbar_new (adjustment);
- } else {
- scrollbar = GTK.gtk_vscrollbar_new (adjustment);
- }
- }
- return scrollbar;
-}
-
}

Back to the top