Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2016-09-19 22:56:04 +0000
committerAlexander Kurtakov2016-09-20 07:40:34 +0000
commit8f48242219e26dfa9ce490642fa18ac79d8f7d0e (patch)
tree7e4a0743bb5487385b1afa686a6c526ebee4c11a /bundles/org.eclipse.swt
parent9460f86f13172520d8cbfaeb20aeecca8d829f38 (diff)
downloadeclipse.platform.swt-8f48242219e26dfa9ce490642fa18ac79d8f7d0e.tar.gz
eclipse.platform.swt-8f48242219e26dfa9ce490642fa18ac79d8f7d0e.tar.xz
eclipse.platform.swt-8f48242219e26dfa9ce490642fa18ac79d8f7d0e.zip
Bug 501782: [GTK2] Clean up pre-GTK2.24 code
Remove old GTK2.24- code paths. Cleaned up functions from OS.java which were only called on versions below 2.24. AllNonBrowser JUnit tests pass on GTK2.24 and GTK3.06 - 3.20. Eclipse seems to run without issue on GTK2 and GTK3. Change-Id: I7ec15f2360d1339a67948d5c09010d142e1b7230 Signed-off-by: Eric Williams <ericwill@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java12
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c169
-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.c9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java83
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java27
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java36
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java35
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java32
18 files changed, 31 insertions, 430 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
index c354b5ffb4..3e4b22eae1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
@@ -3509,13 +3509,7 @@ class AccessibleObject {
static void windowPoint (AccessibleObject object, int [] x, int [] y) {
long /*int*/ widget;
- if (OS.GTK_VERSION >= OS.VERSION(2, 22, 0)) {
- widget = OS.gtk_accessible_get_widget(object.handle);
- } else {
- GtkAccessible gtkAccessible = new GtkAccessible ();
- ATK.memmove (gtkAccessible, object.handle);
- widget = gtkAccessible.widget;
- }
+ widget = OS.gtk_accessible_get_widget(object.handle);
while (widget == 0 && object.parent != null) {
object = object.parent;
if (OS.GTK_VERSION >= OS.VERSION(2, 22, 0)) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
index 101f5d5845..fe487366f5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java
@@ -12,7 +12,7 @@ package org.eclipse.swt.dnd;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.internal.cairo.*;
import org.eclipse.swt.internal.gtk.*;
import org.eclipse.swt.widgets.*;
@@ -120,8 +120,6 @@ public class TableDragSourceEffect extends DragSourceEffect {
h[0] = Cairo.cairo_xlib_surface_get_height(icons[i]);
} else if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
OS.gdk_pixmap_get_size(icons[i], w, h);
- } else {
- OS.gdk_drawable_get_size(icons[i], w, h);
}
width = Math.max(width, w[0]);
height = rect.y + h[0] - yy[0];
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java
index d7ddf9e52a..a4947980f0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java
@@ -78,11 +78,7 @@ public void javaToNative (Object object, TransferData transferData) {
long /*int*/[] ctext = new long /*int*/[1];
int[] length = new int[1];
boolean result;
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- result = OS.gdk_x11_display_utf8_to_compound_text (OS.gdk_display_get_default(), utf8, encoding, format, ctext, length);
- } else {
- result = OS.gdk_utf8_to_compound_text(utf8, encoding, format, ctext, length);
- }
+ result = OS.gdk_x11_display_utf8_to_compound_text (OS.gdk_display_get_default(), utf8, encoding, format, ctext, length);
if (!result) return;
transferData.type = encoding[0];
transferData.format = format[0];
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
index a7baa6cbd2..597d49b2d9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java
@@ -12,7 +12,7 @@ package org.eclipse.swt.dnd;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.internal.cairo.*;
import org.eclipse.swt.internal.gtk.*;
import org.eclipse.swt.widgets.*;
@@ -119,8 +119,6 @@ public class TreeDragSourceEffect extends DragSourceEffect {
h[0] = Cairo.cairo_xlib_surface_get_height(icons[i]);
} else if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
OS.gdk_pixmap_get_size(icons[i], w, h);
- } else {
- OS.gdk_drawable_get_size(icons[i], w, h);
}
width = Math.max(width, w[0]);
height = rect.y + h[0] - yy[0];
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java
index f924b61b21..7f3fc16aae 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OpenGL/gtk/org/eclipse/swt/opengl/GLCanvas.java
@@ -108,11 +108,7 @@ public GLCanvas (Composite parent, int style, GLData data) {
long /*int*/ window = OS.gtk_widget_get_window (handle);
long /*int*/ xDisplay;
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- xDisplay = OS.gdk_x11_display_get_xdisplay(OS.gdk_window_get_display(window));
- } else {
- xDisplay = OS.gdk_x11_drawable_get_xdisplay (window);
- }
+ xDisplay = OS.gdk_x11_display_get_xdisplay(OS.gdk_window_get_display(window));
long /*int*/ infoPtr = GLX.glXChooseVisual (xDisplay, OS.XDefaultScreen (xDisplay), glxAttrib);
if (infoPtr == 0) {
dispose ();
@@ -282,11 +278,7 @@ public void swapBuffers () {
private long /*int*/ gdk_x11_display_get_xdisplay(long /*int*/ window) {
long /*int*/ xdisplay;
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- xdisplay = OS.gdk_x11_display_get_xdisplay(OS.gdk_window_get_display(window));
- } else {
- xdisplay = OS.gdk_x11_drawable_get_xdisplay (window);
- }
+ xdisplay = OS.gdk_x11_display_get_xdisplay(OS.gdk_window_get_display(window));
return xdisplay;
}
}
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 21b87fb41a..3a0fe85f9e 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
@@ -164,30 +164,6 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(GTK_1ENTRY_1IM_1CONTEXT)
}
#endif
-#ifndef NO_GTK_1RANGE_1SLIDER_1END
-JNIEXPORT jint JNICALL OS_NATIVE(GTK_1RANGE_1SLIDER_1END)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, GTK_1RANGE_1SLIDER_1END_FUNC);
- rc = (jint)GTK_RANGE_SLIDER_END((GtkRange *)arg0);
- OS_NATIVE_EXIT(env, that, GTK_1RANGE_1SLIDER_1END_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO_GTK_1RANGE_1SLIDER_1START
-JNIEXPORT jint JNICALL OS_NATIVE(GTK_1RANGE_1SLIDER_1START)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, GTK_1RANGE_1SLIDER_1START_FUNC);
- rc = (jint)GTK_RANGE_SLIDER_START((GtkRange *)arg0);
- OS_NATIVE_EXIT(env, that, GTK_1RANGE_1SLIDER_1START_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO_GTK_1TEXTVIEW_1IM_1CONTEXT
JNIEXPORT jintLong JNICALL OS_NATIVE(GTK_1TEXTVIEW_1IM_1CONTEXT)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -1302,30 +1278,6 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1GTK_1TYPE_1WIDGET)
}
#endif
-#ifndef NO__1GTK_1WIDGET_1FLAGS
-JNIEXPORT jint JNICALL OS_NATIVE(_1GTK_1WIDGET_1FLAGS)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jint rc = 0;
- OS_NATIVE_ENTER(env, that, _1GTK_1WIDGET_1FLAGS_FUNC);
- rc = (jint)GTK_WIDGET_FLAGS(arg0);
- OS_NATIVE_EXIT(env, that, _1GTK_1WIDGET_1FLAGS_FUNC);
- return rc;
-}
-#endif
-
-#ifndef NO__1GTK_1WIDGET_1MAPPED
-JNIEXPORT jboolean JNICALL OS_NATIVE(_1GTK_1WIDGET_1MAPPED)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jboolean rc = 0;
- OS_NATIVE_ENTER(env, that, _1GTK_1WIDGET_1MAPPED_FUNC);
- rc = (jboolean)GTK_WIDGET_MAPPED(arg0);
- OS_NATIVE_EXIT(env, that, _1GTK_1WIDGET_1MAPPED_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1GTK_1WIDGET_1SET_1FLAGS
JNIEXPORT void JNICALL OS_NATIVE(_1GTK_1WIDGET_1SET_1FLAGS)
(JNIEnv *env, jclass that, jintLong arg0, jint arg1)
@@ -5822,31 +5774,6 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1drawable_1get_1image)
}
#endif
-#ifndef NO__1gdk_1drawable_1get_1size
-JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1drawable_1get_1size)
- (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jintArray arg2)
-{
- jint *lparg1=NULL;
- jint *lparg2=NULL;
- OS_NATIVE_ENTER(env, that, _1gdk_1drawable_1get_1size_FUNC);
- if (arg1) if ((lparg1 = (*env)->GetPrimitiveArrayCritical(env, arg1, NULL)) == NULL) goto fail;
- if (arg2) if ((lparg2 = (*env)->GetPrimitiveArrayCritical(env, arg2, NULL)) == NULL) goto fail;
-/*
- gdk_drawable_get_size(arg0, (gint *)lparg1, (gint *)lparg2);
-*/
- {
- OS_LOAD_FUNCTION(fp, gdk_drawable_get_size)
- if (fp) {
- ((void (CALLING_CONVENTION*)(jintLong, gint *, gint *))fp)(arg0, (gint *)lparg1, (gint *)lparg2);
- }
- }
-fail:
- if (arg2 && lparg2) (*env)->ReleasePrimitiveArrayCritical(env, arg2, lparg2, 0);
- if (arg1 && lparg1) (*env)->ReleasePrimitiveArrayCritical(env, arg1, lparg1, 0);
- OS_NATIVE_EXIT(env, that, _1gdk_1drawable_1get_1size_FUNC);
-}
-#endif
-
#ifndef NO__1gdk_1drawable_1get_1visible_1region
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1drawable_1get_1visible_1region)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -7419,42 +7346,6 @@ JNIEXPORT jint JNICALL OS_NATIVE(_1gdk_1unicode_1to_1keyval)
}
#endif
-#ifndef NO__1gdk_1utf8_1to_1compound_1text
-JNIEXPORT jboolean JNICALL OS_NATIVE(_1gdk_1utf8_1to_1compound_1text)
- (JNIEnv *env, jclass that, jbyteArray arg0, jintLongArray arg1, jintArray arg2, jintLongArray arg3, jintArray arg4)
-{
- jbyte *lparg0=NULL;
- jintLong *lparg1=NULL;
- jint *lparg2=NULL;
- jintLong *lparg3=NULL;
- jint *lparg4=NULL;
- jboolean rc = 0;
- OS_NATIVE_ENTER(env, that, _1gdk_1utf8_1to_1compound_1text_FUNC);
- if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail;
- if (arg1) if ((lparg1 = (*env)->GetIntLongArrayElements(env, arg1, NULL)) == NULL) goto fail;
- if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail;
- if (arg3) if ((lparg3 = (*env)->GetIntLongArrayElements(env, arg3, NULL)) == NULL) goto fail;
- if (arg4) if ((lparg4 = (*env)->GetIntArrayElements(env, arg4, NULL)) == NULL) goto fail;
-/*
- rc = (jboolean)gdk_utf8_to_compound_text(lparg0, lparg1, lparg2, lparg3, lparg4);
-*/
- {
- OS_LOAD_FUNCTION(fp, gdk_utf8_to_compound_text)
- if (fp) {
- rc = (jboolean)((jboolean (CALLING_CONVENTION*)(jbyte *, jintLong *, jint *, jintLong *, jint *))fp)(lparg0, lparg1, lparg2, lparg3, lparg4);
- }
- }
-fail:
- if (arg4 && lparg4) (*env)->ReleaseIntArrayElements(env, arg4, lparg4, 0);
- if (arg3 && lparg3) (*env)->ReleaseIntLongArrayElements(env, arg3, lparg3, 0);
- if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0);
- if (arg1 && lparg1) (*env)->ReleaseIntLongArrayElements(env, arg1, lparg1, 0);
- if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0);
- OS_NATIVE_EXIT(env, that, _1gdk_1utf8_1to_1compound_1text_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1gdk_1utf8_1to_1string_1target
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1utf8_1to_1string_1target)
(JNIEnv *env, jclass that, jbyteArray arg0)
@@ -7924,26 +7815,6 @@ JNIEXPORT jboolean JNICALL OS_NATIVE(_1gdk_1window_1is_1visible)
}
#endif
-#ifndef NO__1gdk_1window_1lookup
-JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1window_1lookup)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jintLong rc = 0;
- OS_NATIVE_ENTER(env, that, _1gdk_1window_1lookup_FUNC);
-/*
- rc = (jintLong)gdk_window_lookup(arg0);
-*/
- {
- OS_LOAD_FUNCTION(fp, gdk_window_lookup)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong))fp)(arg0);
- }
- }
- OS_NATIVE_EXIT(env, that, _1gdk_1window_1lookup_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1gdk_1window_1lower
JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1window_1lower)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -8271,26 +8142,6 @@ fail:
}
#endif
-#ifndef NO__1gdk_1x11_1drawable_1get_1xdisplay
-JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1x11_1drawable_1get_1xdisplay)
- (JNIEnv *env, jclass that, jintLong arg0)
-{
- jintLong rc = 0;
- OS_NATIVE_ENTER(env, that, _1gdk_1x11_1drawable_1get_1xdisplay_FUNC);
-/*
- rc = (jintLong)gdk_x11_drawable_get_xdisplay(arg0);
-*/
- {
- OS_LOAD_FUNCTION(fp, gdk_x11_drawable_get_xdisplay)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)(jintLong))fp)(arg0);
- }
- }
- OS_NATIVE_EXIT(env, that, _1gdk_1x11_1drawable_1get_1xdisplay_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1gdk_1x11_1drawable_1get_1xid
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gdk_1x11_1drawable_1get_1xid)
(JNIEnv *env, jclass that, jintLong arg0)
@@ -14952,26 +14803,6 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1separator_1tool_1item_1set_1draw)
}
#endif
-#ifndef NO__1gtk_1set_1locale
-JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1set_1locale)
- (JNIEnv *env, jclass that)
-{
- jintLong rc = 0;
- OS_NATIVE_ENTER(env, that, _1gtk_1set_1locale_FUNC);
-/*
- rc = (jintLong)gtk_set_locale();
-*/
- {
- OS_LOAD_FUNCTION(fp, gtk_set_locale)
- if (fp) {
- rc = (jintLong)((jintLong (CALLING_CONVENTION*)())fp)();
- }
- }
- OS_NATIVE_EXIT(env, that, _1gtk_1set_1locale_FUNC);
- return rc;
-}
-#endif
-
#ifndef NO__1gtk_1settings_1get_1default
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1settings_1get_1default)
(JNIEnv *env, jclass that)
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 f5dbf1ba92..bcb3d48446 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
@@ -229,7 +229,6 @@
#define gtk_menu_tool_button_new_LIB LIB_GTK
#define gtk_image_menu_item_new_with_label_LIB LIB_GTK
#define gtk_window_set_keep_below_LIB LIB_GTK
-#define gtk_set_locale_LIB LIB_GTK
#define gtk_scrollbar_new_LIB LIB_GTK
#define gtk_hscrollbar_new_LIB LIB_GTK
#define gtk_vscrollbar_new_LIB LIB_GTK
@@ -274,7 +273,6 @@
#define gdk_draw_point_LIB LIB_GDK
#define gdk_draw_polygon_LIB LIB_GDK
#define gdk_draw_image_LIB LIB_GDK
-#define gdk_drawable_get_size_LIB LIB_GDK
#define gdk_drawable_get_image_LIB LIB_GDK
#define gdk_drawable_get_visible_region_LIB LIB_GDK
#define gdk_gc_new_LIB LIB_GDK
@@ -350,7 +348,6 @@
#define gtk_window_get_group_LIB LIB_GTK
#define gtk_window_get_opacity_LIB LIB_GTK
#define gdk_window_create_similar_surface_LIB LIB_GDK
-#define gdk_window_lookup_LIB LIB_GDK
#define gdk_window_restack_LIB LIB_GDK
#define gdk_window_get_device_position_LIB LIB_GDK
#define gdk_window_get_pointer_LIB LIB_GDK
@@ -411,11 +408,9 @@
#define gdk_x11_screen_lookup_visual_LIB LIB_GDK
#define gdk_x11_window_lookup_for_display_LIB LIB_GDK
#define gdk_x11_display_utf8_to_compound_text_LIB LIB_GDK
-#define gdk_x11_drawable_get_xdisplay_LIB LIB_GDK
#define gdk_x11_drawable_get_xid_LIB LIB_GDK
#define gdk_x11_get_default_xdisplay_LIB LIB_GDK
#define gdk_x11_window_get_xid_LIB LIB_GDK
-#define gdk_utf8_to_compound_text_LIB LIB_GDK
#define gdk_threads_set_lock_functions_LIB LIB_GDK
#define atk_object_add_relationship_LIB LIB_ATK
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 585bfab57a..a99e338125 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
@@ -42,8 +42,6 @@ char * OS_nativeFunctionNames[] = {
"GTK_1ACCEL_1LABEL_1GET_1ACCEL_1STRING",
"GTK_1ACCEL_1LABEL_1SET_1ACCEL_1STRING",
"GTK_1ENTRY_1IM_1CONTEXT",
- "GTK_1RANGE_1SLIDER_1END",
- "GTK_1RANGE_1SLIDER_1START",
"GTK_1TEXTVIEW_1IM_1CONTEXT",
"GTK_1TYPE_1ACCESSIBLE",
"GTK_1WIDGET_1GET_1CLASS",
@@ -136,8 +134,6 @@ char * OS_nativeFunctionNames[] = {
"_1GTK_1TYPE_1IM_1MULTICONTEXT",
"_1GTK_1TYPE_1MENU",
"_1GTK_1TYPE_1WIDGET",
- "_1GTK_1WIDGET_1FLAGS",
- "_1GTK_1WIDGET_1MAPPED",
"_1GTK_1WIDGET_1SET_1FLAGS",
"_1GTK_1WIDGET_1UNSET_1FLAGS",
"_1G_1OBJECT_1CLASS",
@@ -474,7 +470,6 @@ char * OS_nativeFunctionNames[] = {
"_1gdk_1draw_1rectangle",
"_1gdk_1drawable_1get_1depth",
"_1gdk_1drawable_1get_1image",
- "_1gdk_1drawable_1get_1size",
"_1gdk_1drawable_1get_1visible_1region",
"_1gdk_1error_1trap_1pop",
"_1gdk_1error_1trap_1push",
@@ -570,7 +565,6 @@ char * OS_nativeFunctionNames[] = {
"_1gdk_1set_1program_1class",
"_1gdk_1text_1property_1to_1utf8_1list_1for_1display",
"_1gdk_1unicode_1to_1keyval",
- "_1gdk_1utf8_1to_1compound_1text",
"_1gdk_1utf8_1to_1string_1target",
"_1gdk_1visual_1get_1depth",
"_1gdk_1visual_1get_1system",
@@ -599,7 +593,6 @@ char * OS_nativeFunctionNames[] = {
"_1gdk_1window_1invalidate_1rect",
"_1gdk_1window_1invalidate_1region",
"_1gdk_1window_1is_1visible",
- "_1gdk_1window_1lookup",
"_1gdk_1window_1lower",
"_1gdk_1window_1move",
"_1gdk_1window_1move_1resize",
@@ -626,7 +619,6 @@ char * OS_nativeFunctionNames[] = {
"_1gdk_1x11_1atom_1to_1xatom",
"_1gdk_1x11_1display_1get_1xdisplay",
"_1gdk_1x11_1display_1utf8_1to_1compound_1text",
- "_1gdk_1x11_1drawable_1get_1xdisplay",
"_1gdk_1x11_1drawable_1get_1xid",
"_1gdk_1x11_1get_1default_1xdisplay",
"_1gdk_1x11_1screen_1get_1window_1manager_1name",
@@ -1093,7 +1085,6 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1separator_1new",
"_1gtk_1separator_1tool_1item_1new",
"_1gtk_1separator_1tool_1item_1set_1draw",
- "_1gtk_1set_1locale",
"_1gtk_1settings_1get_1default",
"_1gtk_1settings_1set_1string_1property",
"_1gtk_1socket_1get_1id",
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 4cc6444275..8be6eeebaf 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
@@ -52,8 +52,6 @@ typedef enum {
GTK_1ACCEL_1LABEL_1GET_1ACCEL_1STRING_FUNC,
GTK_1ACCEL_1LABEL_1SET_1ACCEL_1STRING_FUNC,
GTK_1ENTRY_1IM_1CONTEXT_FUNC,
- GTK_1RANGE_1SLIDER_1END_FUNC,
- GTK_1RANGE_1SLIDER_1START_FUNC,
GTK_1TEXTVIEW_1IM_1CONTEXT_FUNC,
GTK_1TYPE_1ACCESSIBLE_FUNC,
GTK_1WIDGET_1GET_1CLASS_FUNC,
@@ -146,8 +144,6 @@ typedef enum {
_1GTK_1TYPE_1IM_1MULTICONTEXT_FUNC,
_1GTK_1TYPE_1MENU_FUNC,
_1GTK_1TYPE_1WIDGET_FUNC,
- _1GTK_1WIDGET_1FLAGS_FUNC,
- _1GTK_1WIDGET_1MAPPED_FUNC,
_1GTK_1WIDGET_1SET_1FLAGS_FUNC,
_1GTK_1WIDGET_1UNSET_1FLAGS_FUNC,
_1G_1OBJECT_1CLASS_FUNC,
@@ -484,7 +480,6 @@ typedef enum {
_1gdk_1draw_1rectangle_FUNC,
_1gdk_1drawable_1get_1depth_FUNC,
_1gdk_1drawable_1get_1image_FUNC,
- _1gdk_1drawable_1get_1size_FUNC,
_1gdk_1drawable_1get_1visible_1region_FUNC,
_1gdk_1error_1trap_1pop_FUNC,
_1gdk_1error_1trap_1push_FUNC,
@@ -580,7 +575,6 @@ typedef enum {
_1gdk_1set_1program_1class_FUNC,
_1gdk_1text_1property_1to_1utf8_1list_1for_1display_FUNC,
_1gdk_1unicode_1to_1keyval_FUNC,
- _1gdk_1utf8_1to_1compound_1text_FUNC,
_1gdk_1utf8_1to_1string_1target_FUNC,
_1gdk_1visual_1get_1depth_FUNC,
_1gdk_1visual_1get_1system_FUNC,
@@ -609,7 +603,6 @@ typedef enum {
_1gdk_1window_1invalidate_1rect_FUNC,
_1gdk_1window_1invalidate_1region_FUNC,
_1gdk_1window_1is_1visible_FUNC,
- _1gdk_1window_1lookup_FUNC,
_1gdk_1window_1lower_FUNC,
_1gdk_1window_1move_FUNC,
_1gdk_1window_1move_1resize_FUNC,
@@ -636,7 +629,6 @@ typedef enum {
_1gdk_1x11_1atom_1to_1xatom_FUNC,
_1gdk_1x11_1display_1get_1xdisplay_FUNC,
_1gdk_1x11_1display_1utf8_1to_1compound_1text_FUNC,
- _1gdk_1x11_1drawable_1get_1xdisplay_FUNC,
_1gdk_1x11_1drawable_1get_1xid_FUNC,
_1gdk_1x11_1get_1default_1xdisplay_FUNC,
_1gdk_1x11_1screen_1get_1window_1manager_1name_FUNC,
@@ -1103,7 +1095,6 @@ typedef enum {
_1gtk_1separator_1new_FUNC,
_1gtk_1separator_1tool_1item_1new_FUNC,
_1gtk_1separator_1tool_1item_1set_1draw_FUNC,
- _1gtk_1set_1locale_FUNC,
_1gtk_1settings_1get_1default_FUNC,
_1gtk_1settings_1set_1string_1property_FUNC,
_1gtk_1socket_1get_1id_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 fd25dfba3d..7602bdd83a 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
@@ -388,7 +388,6 @@ public class OS extends C {
public static final int GTK_PROGRESS_DISCRETE = 0x1;
public static final int GTK_PROGRESS_LEFT_TO_RIGHT = 0x0;
public static final int GTK_PROGRESS_BOTTOM_TO_TOP = 0x2;
- public static final int GTK_REALIZED = 1 << 6;
public static final int GTK_RECEIVES_DEFAULT = 1 << 20;
public static final int GTK_RELIEF_NONE = 0x2;
public static final int GTK_RELIEF_NORMAL = 0;
@@ -743,7 +742,7 @@ public class OS extends C {
USE_CAIRO = useCairo || OS.GTK3;
boolean initCairo = false;
if (!"false".equals(System.getProperty("org.eclipse.swt.internal.gtk.useCairo"))) {
- initCairo = GTK_VERSION >= VERSION(2, 17, 0);
+ initCairo = GTK_VERSION >= VERSION(2, 24, 0);
}
INIT_CAIRO = initCairo;
@@ -836,10 +835,6 @@ public static final native long /*int*/ G_OBJECT_CLASS_CONSTRUCTOR(long /*int*/
* @paramOFF constructor cast=(GObject* (*) (GType, guint, GObjectConstructParam *))
*/
public static final native void G_OBJECT_CLASS_SET_CONSTRUCTOR(long /*int*/ object_class, long /*int*/ constructor);
-/** @param widget cast=(GtkRange *) */
-public static final native int GTK_RANGE_SLIDER_START(long /*int*/ widget);
-/** @param widget cast=(GtkRange *) */
-public static final native int GTK_RANGE_SLIDER_END(long /*int*/ widget);
/**
* @param acce_label cast=(GtkAccelLabel *)
* @param string cast=(gchar *)
@@ -1256,16 +1251,6 @@ public static final long /*int*/ gdk_x11_display_get_xdisplay (long /*int*/ gdkd
}
}
/** @method flags=dynamic */
-public static final native long /*int*/ _gdk_x11_drawable_get_xdisplay(long /*int*/ drawable);
-public static final long /*int*/ gdk_x11_drawable_get_xdisplay(long /*int*/ drawable) {
- lock.lock();
- try {
- return _gdk_x11_drawable_get_xdisplay(drawable);
- } finally {
- lock.unlock();
- }
-}
-/** @method flags=dynamic */
public static final native long /*int*/ _gdk_x11_drawable_get_xid(long /*int*/ drawable);
public static final long /*int*/ gdk_x11_drawable_get_xid(long /*int*/ drawable) {
lock.lock();
@@ -1348,18 +1333,6 @@ public static final long /*int*/ gdk_x11_window_lookup_for_display(long /*int*/
}
}
/**
- * @method flags=dynamic
- */
-public static final native long /*int*/ _gdk_window_lookup(long /*int*/ xid);
-public static final long /*int*/ gdk_window_lookup(long /*int*/ xid) {
- lock.lock();
- try {
- return _gdk_window_lookup(xid);
- } finally {
- lock.unlock();
- }
-}
-/**
* @param window cast=(GdkWindow *)
* @param function cast=(GdkFilterFunc)
* @param data cast=(gpointer)
@@ -1757,15 +1730,6 @@ public static final long /*int*/ GTK_TYPE_WIDGET() {
lock.unlock();
}
}
-public static final native int _GTK_WIDGET_FLAGS(long /*int*/ wid);
-public static final int GTK_WIDGET_FLAGS(long /*int*/ wid) {
- lock.lock();
- try {
- return _GTK_WIDGET_FLAGS(wid);
- } finally {
- lock.unlock();
- }
-}
/** @method flags=dynamic */
public static final native boolean _gtk_widget_has_default(long /*int*/ widget);
public static final boolean gtk_widget_has_default(long /*int*/ widget) {
@@ -1776,15 +1740,6 @@ public static final boolean gtk_widget_has_default(long /*int*/ widget) {
lock.unlock();
}
}
-public static final native boolean _GTK_WIDGET_MAPPED(long /*int*/ wid);
-public static final boolean GTK_WIDGET_MAPPED(long /*int*/ wid) {
- lock.lock();
- try {
- return _GTK_WIDGET_MAPPED(wid);
- } finally {
- lock.unlock();
- }
-}
/** @method flags=dynamic */
public static final native boolean _gtk_widget_get_sensitive(long /*int*/ widget);
public static final boolean gtk_widget_get_sensitive(long /*int*/ widget) {
@@ -4493,20 +4448,6 @@ public static final long /*int*/ gdk_drawable_get_image(long /*int*/ drawable, i
lock.unlock();
}
}
-/**
- * @method flags=dynamic
- * @param width cast=(gint *),flags=no_in critical
- * @param height cast=(gint *),flags=no_in critical
- */
-public static final native void _gdk_drawable_get_size(long /*int*/ drawable, int[] width, int[] height);
-public static final void gdk_drawable_get_size(long /*int*/ drawable, int[] width, int[] height) {
- lock.lock();
- try {
- _gdk_drawable_get_size(drawable, width, height);
- } finally {
- lock.unlock();
- }
-}
/** @method flags=dynamic */
public static final native long /*int*/ _gdk_drawable_get_visible_region(long /*int*/ drawable);
public static final long /*int*/ gdk_drawable_get_visible_region(long /*int*/ drawable) {
@@ -5679,18 +5620,6 @@ public static final void gdk_set_program_class(byte[] program_class) {
}
}
/**
- * @method flags=dynamic
- */
-public static final native boolean _gdk_utf8_to_compound_text(byte[] str, long /*int*/[] encoding, int[] format, long /*int*/[] ctext, int[] length);
-public static final boolean gdk_utf8_to_compound_text(byte[] str, long /*int*/[] encoding, int[] format, long /*int*/[] ctext, int[] length) {
- lock.lock();
- try {
- return _gdk_utf8_to_compound_text(str, encoding, format, ctext, length);
- } finally {
- lock.unlock();
- }
-}
-/**
* @param display cast=(GdkDisplay *)
* @method flags=dynamic
*/
@@ -11610,16 +11539,6 @@ public static final void gtk_separator_tool_item_set_draw(long /*int*/ item, boo
lock.unlock();
}
}
-/** @method flags=dynamic */
-public static final native long /*int*/ _gtk_set_locale();
-public static final long /*int*/ gtk_set_locale() {
- lock.lock();
- try {
- return _gtk_set_locale();
- } finally {
- lock.unlock();
- }
-}
/** @param socket cast=(GtkSocket *) */
public static final native long /*int*/ _gtk_socket_get_id(long /*int*/ socket);
public static final long /*int*/ gtk_socket_get_id(long /*int*/ socket) {
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 ec9de7f483..0bf8f6af6b 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
@@ -71,9 +71,6 @@ static void gtk_init() {
OS.g_thread_init(0);
}
}
- if (OS.GTK_VERSION < OS.VERSION(2, 24, 0)) {
- OS.gtk_set_locale();
- }
if (!OS.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/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
index 343cbc729b..db9f167af9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
@@ -490,18 +490,7 @@ void copyAreaInPixels(Image image, int x, int y) {
if (data.image != null) {
Cairo.cairo_set_source_surface(cairo, data.image.surface, 0, 0);
} else if (data.drawable != 0) {
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- OS.gdk_cairo_set_source_window(cairo, data.drawable, 0, 0);
- } else {
- int[] w = new int[1], h = new int[1];
- OS.gdk_drawable_get_size(data.drawable, w, h);
- int width = w[0], height = h[0];
- long /*int*/ xDisplay = OS.gdk_x11_display_get_xdisplay(OS.gdk_display_get_default());
- long /*int*/ xDrawable = OS.gdk_x11_drawable_get_xid(data.drawable);
- long /*int*/ xVisual = OS.gdk_x11_visual_get_xvisual(OS.gdk_visual_get_system());
- long /*int*/ srcSurface = Cairo.cairo_xlib_surface_create(xDisplay, xDrawable, xVisual, width, height);
- Cairo.cairo_set_source_surface(cairo, srcSurface, 0, 0);
- }
+ OS.gdk_cairo_set_source_window(cairo, data.drawable, 0, 0);
} else {
Cairo.cairo_destroy(cairo);
return;
@@ -918,11 +907,7 @@ void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight,
} else {
int[] width = new int[1];
int[] height = new int[1];
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- OS.gdk_pixmap_get_size(srcImage.pixmap, width, height);
- } else {
- OS.gdk_drawable_get_size(srcImage.pixmap, width, height);
- }
+ OS.gdk_pixmap_get_size(srcImage.pixmap, width, height);
imgWidth = width[0];
imgHeight = height[0];
}
@@ -2910,12 +2895,8 @@ void getSize(int[] width, int[] height) {
return;
}
if (data.drawable != 0) {
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- width[0] = OS.gdk_window_get_width(data.drawable);
- height[0] = OS.gdk_window_get_height(data.drawable);
- } else {
- OS.gdk_drawable_get_size(data.drawable, width, height);
- }
+ width[0] = OS.gdk_window_get_width(data.drawable);
+ height[0] = OS.gdk_window_get_height(data.drawable);
return;
}
if (OS.USE_CAIRO) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
index 7ea44ae72e..295cd98318 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
@@ -392,11 +392,7 @@ public Image(Device device, Image srcImage, int flag) {
/* Get source image size */
int[] w = new int[1], h = new int[1];
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- OS.gdk_pixmap_get_size(srcImage.pixmap, w, h);
- } else {
- OS.gdk_drawable_get_size(srcImage.pixmap, w, h);
- }
+ OS.gdk_pixmap_get_size(srcImage.pixmap, w, h);
int width = w[0];
int height = h[0];
@@ -1111,11 +1107,7 @@ void createSurface() {
/* Generate the mask if necessary. */
if (transparentPixel != -1) createMask();
int[] w = new int[1], h = new int[1];
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- OS.gdk_pixmap_get_size(pixmap, w, h);
- } else {
- OS.gdk_drawable_get_size(pixmap, w, h);
- }
+ OS.gdk_pixmap_get_size(pixmap, w, h);
int width = w[0], height = h[0];
this.width = width;
this.height = height;
@@ -1341,11 +1333,7 @@ public Rectangle getBoundsInPixels() {
return new Rectangle(0, 0, width, height);
}
int[] w = new int[1]; int[] h = new int[1];
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- OS.gdk_pixmap_get_size(pixmap, w, h);
- } else {
- OS.gdk_drawable_get_size(pixmap, w, h);
- }
+ OS.gdk_pixmap_get_size(pixmap, w, h);
return new Rectangle(0, 0, width = w[0], height = h[0]);
}
@@ -1441,11 +1429,7 @@ public ImageData getImageDataAtCurrentZoom () {
return data;
}
int[] w = new int[1], h = new int[1];
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- OS.gdk_pixmap_get_size(pixmap, w, h);
- } else {
- OS.gdk_drawable_get_size(pixmap, w, h);
- }
+ OS.gdk_pixmap_get_size(pixmap, w, h);
int width = w[0], height = h[0];
long /*int*/ pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, width, height);
if (pixbuf == 0) SWT.error(SWT.ERROR_NO_HANDLES);
@@ -1608,17 +1592,7 @@ void init(int width, int height) {
/* Create the pixmap */
if (OS.USE_CAIRO) {
- if (OS.GTK_VERSION >= OS.VERSION(2, 22, 0)) {
- surface = OS.gdk_window_create_similar_surface(OS.gdk_get_default_root_window(), Cairo.CAIRO_CONTENT_COLOR, width, height);
- } else {
- long /*int*/ xDisplay = OS.gdk_x11_display_get_xdisplay(OS.gdk_display_get_default());
- long /*int*/ xDrawable = OS.gdk_x11_drawable_get_xid(OS.gdk_get_default_root_window());
- long /*int*/ xVisual = OS.gdk_x11_visual_get_xvisual(OS.gdk_visual_get_system());
- long /*int*/ rootSurface = Cairo.cairo_xlib_surface_create(xDisplay, xDrawable, xVisual, 1, 1);
- if (rootSurface == 0) SWT.error(SWT.ERROR_NO_HANDLES);
- surface = Cairo.cairo_surface_create_similar(rootSurface, Cairo.CAIRO_CONTENT_COLOR, width, height);
- Cairo.cairo_surface_destroy(rootSurface);
- }
+ surface = OS.gdk_window_create_similar_surface(OS.gdk_get_default_root_window(), Cairo.CAIRO_CONTENT_COLOR, width, height);
if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES);
long /*int*/ cairo = Cairo.cairo_create(surface);
if (cairo == 0) SWT.error(SWT.ERROR_NO_HANDLES);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java
index 1d919cd733..c0015ab0b9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java
@@ -102,11 +102,7 @@ public static long /*int*/ createPixbuf(Image image) {
Cairo.cairo_surface_destroy(surface);
} else {
int [] w = new int [1], h = new int [1];
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- OS.gdk_pixmap_get_size(image.pixmap, w, h);
- } else {
- OS.gdk_drawable_get_size (image.pixmap, w, h);
- }
+ OS.gdk_pixmap_get_size(image.pixmap, w, h);
long /*int*/ colormap = OS.gdk_colormap_get_system ();
boolean hasMask = image.mask != 0 && OS.gdk_drawable_get_depth (image.mask) == 1;
if (hasMask) {
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 601373b3d7..e37d4314e1 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
@@ -830,11 +830,7 @@ long /*int*/ checkIfEventProc (long /*int*/ display, long /*int*/ xEvent, long /
return 0;
}
long /*int*/ window = 0;
- if (OS.GTK_VERSION >= OS.VERSION (2, 24, 0)) {
- window = OS.gdk_x11_window_lookup_for_display(OS.gdk_display_get_default(), OS.X_EVENT_WINDOW (xEvent));
- } else {
- window = OS.gdk_window_lookup (OS.X_EVENT_WINDOW (xEvent));
- }
+ window = OS.gdk_x11_window_lookup_for_display(OS.gdk_display_get_default(), OS.X_EVENT_WINDOW (xEvent));
if (window == 0) return 0;
if (flushWindow != 0) {
if (flushAll) {
@@ -944,9 +940,6 @@ void createDisplay (DeviceData data) {
OS.g_thread_init(0);
}
}
- if (OS.GTK_VERSION < OS.VERSION(2, 24, 0)) {
- OS.gtk_set_locale();
- }
if (!OS.gtk_init_check (new long /*int*/ [] {0}, null)) {
SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]"); //$NON-NLS-1$
}
@@ -1547,11 +1540,7 @@ public Control getCursorControl () {
if ((xWindow = buffer [0]) != 0) {
xParent = xWindow;
long /*int*/ gdkWindow = 0;
- if (OS.GTK_VERSION >= OS.VERSION (2, 24, 0)) {
- gdkWindow = OS.gdk_x11_window_lookup_for_display(OS.gdk_display_get_default(), xWindow);
- } else {
- gdkWindow = OS.gdk_window_lookup (xWindow);
- }
+ gdkWindow = OS.gdk_x11_window_lookup_for_display(OS.gdk_display_get_default(), xWindow);
if (gdkWindow != 0) {
OS.gdk_window_get_user_data (gdkWindow, user_data);
if (user_data[0] != 0) handle = user_data[0];
@@ -2282,13 +2271,7 @@ public boolean getHighContrast () {
@Override
public int getDepth () {
checkDevice ();
- if (OS.GTK_VERSION >= OS.VERSION(2, 22, 0)) {
- return OS.gdk_visual_get_depth(OS.gdk_visual_get_system());
- } else {
- GdkVisual visual = new GdkVisual ();
- OS.memmove (visual, OS.gdk_visual_get_system());
- return visual.depth;
- }
+ return OS.gdk_visual_get_depth(OS.gdk_visual_get_system());
}
/**
@@ -2475,13 +2458,11 @@ public Monitor getPrimaryMonitor () {
Monitor [] monitors = getMonitors ();
int primaryMonitorIndex = 0;
- if (OS.GTK_VERSION >= OS.VERSION(2, 20, 0)) {
- //attempt to find actual primary monitor if one is configured:
- long /*int*/ screen = OS.gdk_screen_get_default ();
- if (screen != 0) {
- //if no primary monitor is configured by the user, this returns 0.
- primaryMonitorIndex = OS.gdk_screen_get_primary_monitor (screen);
- }
+ //attempt to find actual primary monitor if one is configured:
+ long /*int*/ screen = OS.gdk_screen_get_default ();
+ if (screen != 0) {
+ //if no primary monitor is configured by the user, this returns 0.
+ primaryMonitorIndex = OS.gdk_screen_get_primary_monitor (screen);
}
return monitors [primaryMonitorIndex];
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
index 82ac4ae321..0bdad536d7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
@@ -492,12 +492,7 @@ long /*int*/ gtk_change_value (long /*int*/ widget, long /*int*/ scroll, long /*
}
void gtk_range_get_slider_range (long /*int*/ widget, int [] slider_start, int [] slider_end) {
- if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
- OS.gtk_range_get_slider_range (widget, slider_start, slider_end);
- } else {
- slider_start [0] = OS.GTK_RANGE_SLIDER_START (widget);
- slider_end [0] = OS.GTK_RANGE_SLIDER_END (widget);
- }
+ OS.gtk_range_get_slider_range (widget, slider_start, slider_end);
}
@Override
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 6dc94bb5af..2a5af3f57d 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
@@ -574,11 +574,7 @@ void bringToTop (boolean force) {
if ((xFocus || (style & SWT.ON_TOP) != 0)) {
if (OS.isX11()) {
long /*int*/ xDisplay;
- if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) {
- xDisplay = OS.gdk_x11_display_get_xdisplay(OS.gdk_window_get_display(window));
- } else {
- xDisplay = OS.gdk_x11_drawable_get_xdisplay (window);
- }
+ xDisplay = OS.gdk_x11_display_get_xdisplay(OS.gdk_window_get_display(window));
long /*int*/ xWindow;
if (OS.GTK3) {
xWindow = OS.gdk_x11_window_get_xid (window);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
index fe89e6e9b0..ea4c646d22 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
@@ -952,11 +952,7 @@ void gtk_widget_reparent (long /*int*/ widget, long /*int*/ newParent) {
}
boolean gtk_widget_get_mapped (long /*int*/ widget) {
- if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
- return OS.gtk_widget_get_mapped (widget);
- } else {
- return OS.GTK_WIDGET_MAPPED (widget);
- }
+ return OS.gtk_widget_get_mapped (widget);
}
long /*int*/ gtk_window_state_event (long /*int*/ widget, long /*int*/ event) {
@@ -1804,11 +1800,7 @@ long /*int*/ sizeRequestProc (long /*int*/ handle, long /*int*/ arg0, long /*int
}
boolean gtk_widget_get_realized (long /*int*/ widget) {
- if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
- return OS.gtk_widget_get_realized (widget);
- } else {
- return (OS.GTK_WIDGET_FLAGS (widget) & OS.GTK_REALIZED) != 0;
- }
+ return OS.gtk_widget_get_realized (widget);
}
long /*int*/ gtk_widget_get_window (long /*int*/ widget){
@@ -1819,15 +1811,7 @@ long /*int*/ gtk_widget_get_window (long /*int*/ widget){
}
void gtk_widget_set_mapped (long /*int*/ widget, boolean mapped) {
- if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
- OS.gtk_widget_set_mapped (widget, mapped);
- } else {
- if (mapped) {
- OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED);
- } else {
- OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_MAPPED);
- }
- }
+ OS.gtk_widget_set_mapped (widget, mapped);
}
void gtk_widget_set_visible (long /*int*/ widget, boolean visible) {
@@ -1843,20 +1827,12 @@ void gtk_widget_set_visible (long /*int*/ widget, boolean visible) {
}
void gdk_pixmap_get_size (long /*int*/ pixmap, int[] width, int[] height) {
- if (OS.GTK_VERSION >= OS.VERSION (2, 24, 0)) {
- OS.gdk_pixmap_get_size (pixmap, width, height);
- } else {
- OS.gdk_drawable_get_size (pixmap, width, height);
- }
+ OS.gdk_pixmap_get_size (pixmap, width, height);
}
void gdk_window_get_size (long /*int*/ drawable, int[] width, int[] height) {
- if (OS.GTK_VERSION >= OS.VERSION (2, 24, 0)) {
width[0] = OS.gdk_window_get_width (drawable);
height[0] = OS.gdk_window_get_height (drawable);
- } else {
- OS.gdk_drawable_get_size (drawable, width, height);
- }
}
/**

Back to the top