summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-07-17 09:49:07 -0400
committerAnatoly Spektor <aspektor@redhat.com>2012-07-17 09:49:07 -0400
commit92293800b9f236b712c98f8b8cb6ac398f1e13c5 (patch)
tree3a72262dccfec779d51d7712f5e97e6693738c89
parente3a2594d93baac57c5e342d2c7769e2b4dd79d71 (diff)
downloadeclipse.platform.swt-widget_set_flags.tar.gz
eclipse.platform.swt-widget_set_flags.tar.xz
eclipse.platform.swt-widget_set_flags.zip
Omit use of deprecated GTK_WIDGET_SET_FLAGwidget_set_flags
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c84
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java12
-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/Menu.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java2
-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/Slider.java6
14 files changed, 213 insertions, 22 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 155872e3dd..60f3d5e963 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
@@ -15688,6 +15688,44 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1app_1paintable)
}
#endif
+#ifndef NO__1gtk_1widget_1set_1can_1default
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1can_1default)
+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1widget_1set_1can_1default_FUNC);
+/*
+ gtk_widget_set_can_default(arg0, arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_widget_set_can_default)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1widget_1set_1can_1default_FUNC);
+}
+#endif
+
+#ifndef NO__1gtk_1widget_1set_1can_1focus
+JNIEXPORT jboolean JNICALL OS_NATIVE(_1gtk_1widget_1set_1can_1focus)
+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
+{
+ jboolean rc = 0;
+ OS_NATIVE_ENTER(env, that, _1gtk_1widget_1set_1can_1focus_FUNC);
+/*
+ rc = (jboolean)gtk_widget_set_can_focus(arg0, arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_widget_set_can_focus)
+ if (fp) {
+ rc = (jboolean)((jboolean (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1widget_1set_1can_1focus_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1gtk_1widget_1set_1default_1direction
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1default_1direction)
(JNIEnv *env, jclass that, jint arg0)
@@ -15718,6 +15756,24 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1double_1buffered)
}
#endif
+#ifndef NO__1gtk_1widget_1set_1mapped
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1mapped)
+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1widget_1set_1mapped_FUNC);
+/*
+ gtk_widget_set_mapped(arg0, arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_widget_set_mapped)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1widget_1set_1mapped_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)
@@ -15757,7 +15813,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1sensitive)
(JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
{
OS_NATIVE_ENTER(env, that, _1gtk_1widget_1set_1sensitive_FUNC);
- gtk_widget_set_sensitive((GtkWidget *)arg0, (gboolean)arg1);
+/*
+ gtk_widget_set_sensitive(arg0, arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_widget_set_sensitive)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gtk_1widget_1set_1sensitive_FUNC);
}
#endif
@@ -15804,6 +15868,24 @@ fail:
}
#endif
+#ifndef NO__1gtk_1widget_1set_1visible
+JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1visible)
+ (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1)
+{
+ OS_NATIVE_ENTER(env, that, _1gtk_1widget_1set_1visible_FUNC);
+/*
+ gtk_widget_set_visible(arg0, arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gtk_widget_set_visible)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1);
+ }
+ }
+ OS_NATIVE_EXIT(env, that, _1gtk_1widget_1set_1visible_FUNC);
+}
+#endif
+
#ifndef NO__1gtk_1widget_1show
JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1show)
(JNIEnv *env, jclass that, jintLong arg0)
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 f21e8ca75a..f6e6c10c31 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
@@ -198,6 +198,11 @@
#define gtk_widget_is_composited_LIB LIB_GTK
#define gtk_widget_get_tooltip_text_LIB LIB_GTK
#define gtk_widget_set_tooltip_text_LIB LIB_GTK
+#define gtk_widget_set_can_default_LIB LIB_GTK
+#define gtk_widget_set_can_focus_LIB LIB_GTK
+#define gtk_widget_set_mapped_LIB LIB_GTK
+#define gtk_widget_set_sensitive_LIB LIB_GTK
+#define gtk_widget_set_visible_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
@@ -356,6 +361,9 @@
#else
#define GTK_SCROLLED_WINDOW_VSCROLLBAR(arg0) (arg0)->vscrollbar
#endif
+#if GTK_CHECK_VERSION(2,22,0) || !defined(GTK_WIDGET_SET_FLAGS)
+#define GTK_WIDGET_SET_FLAGS(arg0, arg1)
+#endif
#define GTK_WIDGET_HEIGHT(arg0) (arg0)->allocation.height
#define GTK_WIDGET_SET_HEIGHT(arg0, arg1) (arg0)->allocation.height = arg1
#define GTK_WIDGET_WIDTH(arg0) (arg0)->allocation.width
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 b8074eb1de..afa904b81b 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 = 1315;
-int OS_nativeFunctionCallCount[1315];
+int OS_nativeFunctionCount = 1319;
+int OS_nativeFunctionCallCount[1319];
char * OS_nativeFunctionNames[] = {
#ifndef JNI64
"Call__IIII",
@@ -1248,9 +1248,12 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1widget_1reparent",
"_1gtk_1widget_1send_1expose",
"_1gtk_1widget_1set_1app_1paintable",
+ "_1gtk_1widget_1set_1can_1default",
+ "_1gtk_1widget_1set_1can_1focus",
"_1gtk_1widget_1set_1default_1direction",
"_1gtk_1widget_1set_1direction",
"_1gtk_1widget_1set_1double_1buffered",
+ "_1gtk_1widget_1set_1mapped",
"_1gtk_1widget_1set_1name",
"_1gtk_1widget_1set_1parent_1window",
"_1gtk_1widget_1set_1redraw_1on_1allocate",
@@ -1258,6 +1261,7 @@ char * OS_nativeFunctionNames[] = {
"_1gtk_1widget_1set_1size_1request",
"_1gtk_1widget_1set_1state",
"_1gtk_1widget_1set_1tooltip_1text",
+ "_1gtk_1widget_1set_1visible",
"_1gtk_1widget_1show",
"_1gtk_1widget_1size_1allocate",
"_1gtk_1widget_1size_1request",
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 75194be58b..369ce9d1a9 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
@@ -1256,9 +1256,12 @@ typedef enum {
_1gtk_1widget_1reparent_FUNC,
_1gtk_1widget_1send_1expose_FUNC,
_1gtk_1widget_1set_1app_1paintable_FUNC,
+ _1gtk_1widget_1set_1can_1default_FUNC,
+ _1gtk_1widget_1set_1can_1focus_FUNC,
_1gtk_1widget_1set_1default_1direction_FUNC,
_1gtk_1widget_1set_1direction_FUNC,
_1gtk_1widget_1set_1double_1buffered_FUNC,
+ _1gtk_1widget_1set_1mapped_FUNC,
_1gtk_1widget_1set_1name_FUNC,
_1gtk_1widget_1set_1parent_1window_FUNC,
_1gtk_1widget_1set_1redraw_1on_1allocate_FUNC,
@@ -1266,6 +1269,7 @@ typedef enum {
_1gtk_1widget_1set_1size_1request_FUNC,
_1gtk_1widget_1set_1state_FUNC,
_1gtk_1widget_1set_1tooltip_1text_FUNC,
+ _1gtk_1widget_1set_1visible_FUNC,
_1gtk_1widget_1show_FUNC,
_1gtk_1widget_1size_1allocate_FUNC,
_1gtk_1widget_1size_1request_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 0a5969cade..964db1348a 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
@@ -12361,6 +12361,36 @@ public static final void gtk_widget_set_default_direction(int dir) {
lock.unlock();
}
}
+/** @method flags=dynamic */
+public static final native void _gtk_widget_set_can_default(int /*long*/ widget, boolean can_default);
+public static final void gtk_widget_set_can_default(int /*long*/ widget, boolean can_default) {
+ lock.lock();
+ try {
+ _gtk_widget_set_can_default(widget,can_default) ;
+ } finally {
+ lock.unlock();
+ }
+}
+/** @method flags=dynamic */
+public static final native boolean _gtk_widget_set_can_focus(int /*long*/ widget, boolean can_focus);
+public static final boolean gtk_widget_set_can_focus(int /*long*/ widget, boolean can_focus) {
+ lock.lock();
+ try {
+ return _gtk_widget_set_can_focus(widget,can_focus);
+ } finally {
+ lock.unlock();
+ }
+}
+/** @method flags=dynamic */
+public static final native void _gtk_widget_set_mapped(int /*long*/ widget, boolean mapped);
+public static final void gtk_widget_set_mapped(int /*long*/ widget, boolean mapped) {
+ lock.lock();
+ try {
+ _gtk_widget_set_mapped(widget,mapped);
+ } finally {
+ lock.unlock();
+ }
+}
/**
* @param widget cast=(GtkWidget *)
* @param dir cast=(GtkTextDirection)
@@ -12413,10 +12443,7 @@ public static final void gtk_widget_set_redraw_on_allocate(int /*long*/ widget,
lock.unlock();
}
}
-/**
- * @param widget cast=(GtkWidget *)
- * @param sensitive cast=(gboolean)
- */
+/** @method flags=dynamic */
public static final native void _gtk_widget_set_sensitive(int /*long*/ widget, boolean sensitive);
public static final void gtk_widget_set_sensitive(int /*long*/ widget, boolean sensitive) {
lock.lock();
@@ -12426,6 +12453,16 @@ public static final void gtk_widget_set_sensitive(int /*long*/ widget, boolean s
lock.unlock();
}
}
+/** @method flags=dynamic */
+public static final native void _gtk_widget_set_visible(int /*long*/ widget, boolean visible);
+public static final void gtk_widget_set_visible(int /*long*/ widget, boolean visible) {
+ lock.lock();
+ try {
+ _gtk_widget_set_visible(widget, visible);
+ } finally {
+ lock.unlock();
+ }
+}
/**
* @param widget cast=(GtkWidget *)
* @param width cast=(gint)
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 77d5d6b13d..752c7e93aa 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
@@ -302,7 +302,12 @@ void createHandle (int index) {
default:
handle = OS.gtk_button_new ();
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
- OS.GTK_WIDGET_SET_FLAGS(handle, OS.GTK_CAN_DEFAULT);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_can_default(handle, true);
+ }else{
+ OS.GTK_WIDGET_SET_FLAGS(handle, OS.GTK_CAN_DEFAULT);
+ }
+
break;
}
if ((style & SWT.ARROW) != 0) {
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..45c9234612 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
@@ -274,7 +274,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);
- OS.GTK_WIDGET_SET_FLAGS(handle, OS.GTK_CAN_FOCUS);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_can_focus(handle, true);
+ }else{
+ OS.GTK_WIDGET_SET_FLAGS(handle, OS.GTK_CAN_FOCUS);
+ }
if ((style & SWT.EMBEDDED) == 0) {
if ((state & CANVAS) != 0) {
/* Prevent an input method context from being created for the Browser widget */
@@ -527,7 +531,11 @@ int /*long*/ focusHandle () {
}
boolean forceFocus (int /*long*/ focusHandle) {
- if (socketHandle != 0) OS.GTK_WIDGET_SET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ if (socketHandle != 0) OS.gtk_widget_set_can_focus(handle, true);
+ }else{
+ if (socketHandle != 0) OS.GTK_WIDGET_SET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
+ }
boolean result = super.forceFocus (focusHandle);
if (socketHandle != 0) OS.GTK_WIDGET_UNSET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
return result;
@@ -1472,7 +1480,14 @@ boolean setTabItemFocus (boolean next) {
int direction = next ? OS.GTK_DIR_TAB_FORWARD : OS.GTK_DIR_TAB_BACKWARD;
OS.GTK_WIDGET_UNSET_FLAGS (socketHandle, OS.GTK_HAS_FOCUS);
OS.gtk_widget_child_focus (socketHandle, direction);
- OS.GTK_WIDGET_SET_FLAGS (socketHandle, OS.GTK_HAS_FOCUS);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_can_focus(socketHandle, true);
+ OS.gtk_widget_realize(socketHandle);
+ OS.gtk_widget_grab_focus(socketHandle);
+ }else{
+ OS.GTK_WIDGET_SET_FLAGS (socketHandle, OS.GTK_HAS_FOCUS);
+ }
+
}
return true;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index 7404d61334..19a8b4ac50 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -191,7 +191,11 @@ void fixFocus (Control focusControl) {
}
shell.setSavedFocus (focusControl);
int /*long*/ focusHandle = shell.vboxHandle;
- OS.GTK_WIDGET_SET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_can_focus(handle, true);
+ }else{
+ OS.GTK_WIDGET_SET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS);
+ }
OS.gtk_widget_grab_focus (focusHandle);
// widget could be disposed at this point
if (isDisposed ()) return;
@@ -826,7 +830,11 @@ void moveHandle (int x, int y) {
OS.GTK_WIDGET_UNSET_FLAGS (parentHandle, OS.GTK_VISIBLE);
OS.gtk_fixed_move (parentHandle, topHandle, x, y);
if ((flags & OS.GTK_VISIBLE) != 0) {
- OS.GTK_WIDGET_SET_FLAGS (parentHandle, OS.GTK_VISIBLE);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_visible(parentHandle,true);
+ }else{
+ OS.GTK_WIDGET_SET_FLAGS (parentHandle, OS.GTK_VISIBLE);
+ }
}
}
@@ -2300,7 +2308,11 @@ void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, De
}
int /*long*/ fixedMapProc (int /*long*/ widget) {
- OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) {
+ OS.gtk_widget_set_mapped(widget, true);
+ }else{
+ OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED);
+ }
int /*long*/ widgetList = OS.gtk_container_get_children (widget);
if (widgetList != 0) {
int /*long*/ widgets = widgetList;
@@ -4458,7 +4470,11 @@ public void setVisible (boolean visible) {
OS.GTK_WIDGET_UNSET_FLAGS (topHandle, OS.GTK_VISIBLE);
fixFocus (control);
if (isDisposed ()) return;
- OS.GTK_WIDGET_SET_FLAGS (topHandle, OS.GTK_VISIBLE);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_visible(topHandle,true);
+ }else{
+ OS.GTK_WIDGET_SET_FLAGS (topHandle, OS.GTK_VISIBLE);
+ }
}
OS.gtk_widget_hide (topHandle);
if (isDisposed ()) return;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
index 5bd836678d..5cb2257bc3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
@@ -136,7 +136,11 @@ void createHandle (int index) {
OS.gtk_container_add (boxHandle, imageHandle);
OS.gtk_container_add (boxHandle, labelHandle);
OS.gtk_expander_set_label_widget (handle, boxHandle);
- OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_can_focus(handle, true);
+ }else{
+ OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+ }
}
void createWidget (int index) {
@@ -481,7 +485,11 @@ public void setExpanded (boolean expanded) {
boolean setFocus () {
if (!OS.gtk_widget_get_child_visible (handle)) return false;
- OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_can_focus(handle, true);
+ }else{
+ OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+ }
OS.gtk_widget_grab_focus (handle);
// widget could be disposed at this point
if (isDisposed ()) return false;
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..0146ef9b2d 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
@@ -146,7 +146,11 @@ void createHandle(int index) {
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);
- OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_can_focus(handle, true);
+ }else{
+ OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+ }
layout = new TextLayout (display);
linkColor = new Color (display, LINK_FOREGROUND);
disabledColor = new Color (display, LINK_DISABLED_FOREGROUND);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
index 8bd103943e..a9551d23c3 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java
@@ -947,7 +947,7 @@ public void setDefaultItem (MenuItem item) {
public void setEnabled (boolean enabled) {
checkWidget();
if (enabled) {
- OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_SENSITIVE);
+ OS.gtk_widget_set_sensitive(handle, true);
} else {
OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_SENSITIVE);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
index 69f6ae0f87..299af97d27 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
@@ -276,7 +276,7 @@ void createHandle (int index) {
}
int /*long*/ parentHandle = parent.handle;
boolean enabled = OS.GTK_WIDGET_SENSITIVE (parentHandle);
- if (!enabled) OS.GTK_WIDGET_SET_FLAGS (parentHandle, OS.GTK_SENSITIVE);
+ if (!enabled) OS.gtk_widget_set_sensitive(parentHandle, true);
OS.gtk_menu_shell_insert (parentHandle, handle, index);
if (!enabled) OS.GTK_WIDGET_UNSET_FLAGS (parentHandle, OS.GTK_SENSITIVE);
OS.gtk_widget_show (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..38312496a3 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
@@ -137,7 +137,11 @@ void createHandle (int index) {
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);
- OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_can_focus(handle, true);
+ }else{
+ 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/Slider.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Slider.java
index 8b20f25e10..6400fe7979 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
@@ -170,7 +170,11 @@ void createHandle (int index) {
* (http://bugzilla.gnome.org/show_bug.cgi?id=475909)
*/
if (OS.GTK_VERSION < OS.VERSION (2, 10, 0) || (style & SWT.VERTICAL) != 0) {
- OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+ if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) {
+ OS.gtk_widget_set_can_focus(handle, true);
+ }else{
+ OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS);
+ }
}
OS.gtk_container_add (fixedHandle, handle);
}