summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-07-06 15:22:07 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-08-01 10:19:25 -0400
commit0d23f871e57d5ad4ac4223f8da9d549bb534627e (patch)
tree6b0cc2ee1dec16e06e10492b272f2482d1de742b
parentb2f2631812bb255ec81879bc4ce8063e64a87354 (diff)
downloadeclipse.platform.swt-0d23f871e57d5ad4ac4223f8da9d549bb534627e.tar.gz
eclipse.platform.swt-0d23f871e57d5ad4ac4223f8da9d549bb534627e.tar.xz
eclipse.platform.swt-0d23f871e57d5ad4ac4223f8da9d549bb534627e.zip
Use gtk_widget_set_has_window() instead of gtk_fixed_set_has_window()
Conflicts: bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java15
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java6
24 files changed, 145 insertions, 25 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 63031a38ab..f2fee3d8f5 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
@@ -9238,7 +9238,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1fixed_1set_1has_1window)
(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
{
OS_NATIVE_ENTER(env, that, _1gtk_1fixed_1set_1has_1window_FUNC);
- gtk_fixed_set_has_window((GtkFixed *)arg0, (gboolean)arg1);
+/*
+ gtk_fixed_set_has_window(arg0, arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_fixed_set_has_window)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gtk_1fixed_1set_1has_1window_FUNC);
}
#endif
@@ -15819,6 +15827,24 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1double_1buffered)
}
#endif
+#ifndef NO__1gtk_1widget_1set_1has_1window
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1has_1window)
+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1widget_1set_1has_1window_FUNC);
+/*
+ gtk_widget_set_has_window(arg0, arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_widget_set_has_window)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1widget_1set_1has_1window_FUNC);
+}
+#endif
+
#ifndef NO__1gtk_1widget_1set_1name
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1name)
(JNIEnv *env, jclass that, jintLong arg0, jbyteArray arg1)
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 c2e471afaf..7996ea0d06 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
@@ -202,6 +202,8 @@
#define gtk_widget_get_tooltip_text_LIB LIB_GTK
#define gtk_widget_has_default_LIB LIB_GTK
#define gtk_widget_set_tooltip_text_LIB LIB_GTK
+#define gtk_widget_set_has_window_LIB LIB_GTK
+#define gtk_fixed_set_has_window_LIB LIB_GTK
#define gdk_pango_context_set_colormap_LIB LIB_GDK
#define gdk_x11_screen_get_window_manager_name_LIB LIB_GDK
#define gdk_x11_screen_lookup_visual_LIB LIB_GDK
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 d82496e9d6..bedece6c8d 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
@@ -18,8 +18,8 @@
#ifdef NATIVE_STATS
-int OS_nativeFunctionCount = 1319;
-int OS_nativeFunctionCallCount[1319];
+int OS_nativeFunctionCount = 1320;
+int OS_nativeFunctionCallCount[1320];
char * OS_nativeFunctionNames[] = {
#ifndef JNI64
"Call__IIII",
@@ -1255,6 +1255,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1widget_1set_1default_1direction",
"_1gtk_1widget_1set_1direction",
"_1gtk_1widget_1set_1double_1buffered",
+ "_1gtk_1widget_1set_1has_1window",
"_1gtk_1widget_1set_1name",
"_1gtk_1widget_1set_1parent_1window",
"_1gtk_1widget_1set_1redraw_1on_1allocate",
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 140db9df8b..c1af2f83cb 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
@@ -1263,6 +1263,7 @@ typedef enum {
_1gtk_1widget_1set_1default_1direction_FUNC,
_1gtk_1widget_1set_1direction_FUNC,
_1gtk_1widget_1set_1double_1buffered_FUNC,
+ _1gtk_1widget_1set_1has_1window_FUNC,
_1gtk_1widget_1set_1name_FUNC,
_1gtk_1widget_1set_1parent_1window_FUNC,
_1gtk_1widget_1set_1redraw_1on_1allocate_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 c5c40cc494..03395f8eba 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
@@ -6969,8 +6969,7 @@ public static final int /*long*/ gtk_fixed_new() {
}
}
/**
- * @param fixed cast=(GtkFixed *)
- * @param has_window cast=(gboolean)
+ * @method flags=dynamic
*/
public static final native void _gtk_fixed_set_has_window(int /*long*/ fixed, boolean has_window);
public static final void gtk_fixed_set_has_window(int /*long*/ fixed, boolean has_window) {
@@ -6981,6 +6980,18 @@ public static final void gtk_fixed_set_has_window(int /*long*/ fixed, boolean ha
lock.unlock();
}
}
+/**
+ * @method flags=dynamic
+ */
+public static final native void _gtk_widget_set_has_window(int /*long*/ widget, boolean has_window);
+public static final void gtk_widget_set_has_window(int /*long*/ widget, boolean has_window) {
+ lock.lock();
+ try {
+ _gtk_fixed_set_has_window(widget, has_window);
+ } finally {
+ lock.unlock();
+ }
+}
/** @param fsd cast=(GtkFontSelectionDialog *) */
public static final native int /*long*/ _gtk_font_selection_dialog_get_font_name(int /*long*/ fsd);
public static final int /*long*/ gtk_font_selection_dialog_get_font_name(int /*long*/ fsd) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index 6cc5df8fbc..fcc81fcfc6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -258,7 +258,11 @@ void createHandle (int index) {
int bits = SWT.ARROW | SWT.TOGGLE | SWT.CHECK | SWT.RADIO | SWT.PUSH;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
switch (style & bits) {
case SWT.ARROW:
int arrow_type = OS.GTK_ARROW_UP;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
index 5adc42c51e..f521a7a0a8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java
@@ -366,7 +366,11 @@ void createHandle (int index) {
state |= HANDLE | MENU;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
int /*long*/ oldList = OS.gtk_window_list_toplevels ();
if ((style & SWT.READ_ONLY) != 0) {
handle = OS.gtk_combo_box_new_text ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
index 81445e9bd1..895e41b9e7 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
@@ -262,8 +262,12 @@ void createHandle (int index, boolean fixed, boolean scrolled) {
if (fixed) {
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
OS.gtk_fixed_set_has_window (fixedHandle, true);
}
+ }
int /*long*/ vadj = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
if (vadj == 0) error (SWT.ERROR_NO_HANDLES);
int /*long*/ hadj = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
@@ -273,7 +277,11 @@ void createHandle (int index, boolean fixed, boolean scrolled) {
}
handle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (handle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(handle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (handle, true);
+ }
OS.GTK_WIDGET_SET_FLAGS(handle, OS.GTK_CAN_FOCUS);
if ((style & SWT.EMBEDDED) == 0) {
if ((state & CANVAS) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
index b83a946591..b086ff7e5b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/DateTime.java
@@ -339,7 +339,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_calendar_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
index fc1b31bb47..699573e19b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandBar.java
@@ -129,7 +129,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_vbox_new (false, 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.V_SCROLL) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
index 40e6c20bc5..3600299cdc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Group.java
@@ -122,7 +122,11 @@ void createHandle(int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_frame_new (null);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
labelHandle = OS.gtk_label_new (null);
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 3bceccdeaf..048a08897e 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
@@ -202,7 +202,11 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
if ((style & SWT.SEPARATOR) != 0) {
if ((style & SWT.HORIZONTAL)!= 0) {
handle = OS.gtk_hseparator_new ();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
index 8fee01a0e1..b0ac93f4d9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java
@@ -145,7 +145,11 @@ void createHandle(int index) {
state |= HANDLE | THEME_BACKGROUND;
handle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (handle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(handle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (handle, true);
+ }
OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
layout = new TextLayout (display);
linkColor = new Color (display, LINK_FOREGROUND);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
index 30ddc1cc21..a653341f4d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java
@@ -189,7 +189,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
scrolledHandle = OS.gtk_scrolled_window_new (0, 0);
if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES);
/*
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
index ad416a46ce..74ba019ab5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
@@ -83,7 +83,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_progress_bar_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
index 34f8213b7c..e338f99abf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java
@@ -136,7 +136,11 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
handle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (handle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(handle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (handle, true);
+ }
OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
int type = (style & SWT.VERTICAL) != 0 ? OS.GDK_SB_H_DOUBLE_ARROW : OS.GDK_SB_V_DOUBLE_ARROW;
defaultCursor = OS.gdk_cursor_new (type);
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 55e9f89488..86e0dd646b 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
@@ -125,7 +125,11 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
int /*long*/ hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 0);
if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.HORIZONTAL) != 0) {
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 8b20f25e10..c990d0687c 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
@@ -152,7 +152,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
int /*long*/ hAdjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 10);
if (hAdjustment == 0) error (SWT.ERROR_NO_HANDLES);
if ((style & SWT.HORIZONTAL) != 0) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
index 2fecb00b13..60a4564444 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Spinner.java
@@ -290,7 +290,11 @@ void createHandle (int index) {
state |= HANDLE | MENU;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
int /*long*/ adjustment = OS.gtk_adjustment_new (0, 0, 100, 1, 10, 0);
if (adjustment == 0) error (SWT.ERROR_NO_HANDLES);
handle = OS.gtk_spin_button_new (adjustment, climbRate, 0);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
index 3dc637f570..dd932be3b5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabFolder.java
@@ -184,8 +184,11 @@ public Rectangle computeTrim (int x, int y, int width, int height) {
void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
- if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_notebook_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 74bea0bb9b..87b8168166 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -593,7 +593,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
scrolledHandle = OS.gtk_scrolled_window_new (0, 0);
if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES);
int /*long*/ [] types = getColumnTypes (1);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
index 2e018aba52..02f270ef5d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java
@@ -193,7 +193,11 @@ void createHandle (int index) {
}
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
if ((style & SWT.SINGLE) != 0) {
handle = OS.gtk_entry_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
index a4d939d1aa..5216b06846 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolBar.java
@@ -130,7 +130,11 @@ void createHandle (int index) {
state |= HANDLE | THEME_BACKGROUND;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
handle = OS.gtk_toolbar_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index e49ef7abc4..29cfc8c787 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -698,7 +698,11 @@ void createHandle (int index) {
state |= HANDLE;
fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0);
if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.gtk_fixed_set_has_window (fixedHandle, true);
+ if (OS.GTK_VERSION >= OS.VERSION(2, 18, 0)) {
+ OS.gtk_widget_set_has_window(fixedHandle, true);
+ }else{
+ OS.gtk_fixed_set_has_window (fixedHandle, true);
+ }
scrolledHandle = OS.gtk_scrolled_window_new (0, 0);
if (scrolledHandle == 0) error (SWT.ERROR_NO_HANDLES);
int /*long*/ [] types = getColumnTypes (1);