From fc2d2ec1727bbf89af6fa75dcff471c41c95b0be Mon Sep 17 00:00:00 2001 From: Anatoly Spektor Date: Tue, 7 Aug 2012 13:24:13 -0400 Subject: Omit use of deprecated GTK_WIDGET_SET_FLAG Conflicts: bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Link.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Sash.java --- .../Eclipse SWT PI/gtk/library/os.c | 74 ++++++++++++++++++++++ .../Eclipse SWT PI/gtk/library/os_custom.h | 5 ++ .../Eclipse SWT PI/gtk/library/os_stats.c | 8 ++- .../Eclipse SWT PI/gtk/library/os_stats.h | 4 ++ .../gtk/org/eclipse/swt/internal/gtk/OS.java | 40 ++++++++++++ .../gtk/org/eclipse/swt/widgets/Button.java | 2 +- .../gtk/org/eclipse/swt/widgets/Composite.java | 4 +- .../gtk/org/eclipse/swt/widgets/Control.java | 8 +-- .../gtk/org/eclipse/swt/widgets/ExpandItem.java | 4 +- .../gtk/org/eclipse/swt/widgets/Link.java | 2 +- .../gtk/org/eclipse/swt/widgets/Menu.java | 2 +- .../gtk/org/eclipse/swt/widgets/MenuItem.java | 2 +- .../gtk/org/eclipse/swt/widgets/Sash.java | 2 +- .../gtk/org/eclipse/swt/widgets/Slider.java | 2 +- .../gtk/org/eclipse/swt/widgets/Widget.java | 32 ++++++++++ 15 files changed, 175 insertions(+), 16 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 c8897bb7e8..41d9821b4e 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 @@ -16019,6 +16019,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) @@ -16067,6 +16105,24 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1has_1window) } #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) @@ -16153,6 +16209,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 42ff173ec1..1e38d0b6f1 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 @@ -218,6 +218,11 @@ #define gtk_widget_get_realized_LIB LIB_GTK #define gtk_widget_get_can_default_LIB LIB_GTK #define gtk_widget_get_window_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 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 3f141d272a..626e121e85 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 = 1330; -int OS_nativeFunctionCallCount[1330]; +int OS_nativeFunctionCount = 1334; +int OS_nativeFunctionCallCount[1334]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -1262,10 +1262,13 @@ 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_1has_1window", + "_1gtk_1widget_1set_1mapped", "_1gtk_1widget_1set_1name", "_1gtk_1widget_1set_1parent_1window", "_1gtk_1widget_1set_1redraw_1on_1allocate", @@ -1273,6 +1276,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 ff90161771..8975724e97 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 @@ -1270,10 +1270,13 @@ 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_1has_1window_FUNC, + _1gtk_1widget_1set_1mapped_FUNC, _1gtk_1widget_1set_1name_FUNC, _1gtk_1widget_1set_1parent_1window_FUNC, _1gtk_1widget_1set_1redraw_1on_1allocate_FUNC, @@ -1281,6 +1284,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 a1c1097216..eb2d39ae14 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 @@ -12545,6 +12545,46 @@ 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(); + } +} +/** @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 dir cast=(GtkTextDirection) 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 8a1d466bc9..b4a341f417 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,7 @@ 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); + gtk_widget_set_can_default (handle, true); 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 84c8a8e26e..35c0369518 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 @@ -277,7 +277,7 @@ 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); gtk_widget_set_has_window (handle, true); - OS.GTK_WIDGET_SET_FLAGS(handle, OS.GTK_CAN_FOCUS); + gtk_widget_set_can_focus (handle, true); if ((style & SWT.EMBEDDED) == 0) { if ((state & CANVAS) != 0) { /* Prevent an input method context from being created for the Browser widget */ @@ -530,7 +530,7 @@ int /*long*/ focusHandle () { } boolean forceFocus (int /*long*/ focusHandle) { - if (socketHandle != 0) OS.GTK_WIDGET_SET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS); + if (socketHandle != 0) gtk_widget_set_can_focus (focusHandle, true); boolean result = super.forceFocus (focusHandle); if (socketHandle != 0) OS.GTK_WIDGET_UNSET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS); return result; 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 27e8a5be3f..6e57710576 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,7 @@ void fixFocus (Control focusControl) { } shell.setSavedFocus (focusControl); int /*long*/ focusHandle = shell.vboxHandle; - OS.GTK_WIDGET_SET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS); + gtk_widget_set_can_focus (focusHandle, true); OS.gtk_widget_grab_focus (focusHandle); // widget could be disposed at this point if (isDisposed ()) return; @@ -843,7 +843,7 @@ void moveHandle (int x, int y) { OS.GTK_WIDGET_UNSET_FLAGS (parentHandle, OS.GTK_VISIBLE); OS.gtk_fixed_move (parentHandle, topHandle, x, y); if (visible) { - OS.GTK_WIDGET_SET_FLAGS (parentHandle, OS.GTK_VISIBLE); + gtk_widget_set_visible (parentHandle, true); } } @@ -2368,7 +2368,7 @@ void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, De } int /*long*/ fixedMapProc (int /*long*/ widget) { - OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED); + gtk_widget_set_mapped (widget, true); int /*long*/ widgetList = OS.gtk_container_get_children (widget); if (widgetList != 0) { int /*long*/ widgets = widgetList; @@ -4567,7 +4567,7 @@ 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); + gtk_widget_set_visible (topHandle, true); } 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 62ac399ec3..05d4dcec64 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,7 @@ 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); + gtk_widget_set_can_focus (handle, true); } void createWidget (int index) { @@ -509,7 +509,7 @@ 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); + gtk_widget_set_can_focus (handle, true); 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 d45f7c2273..9afefbb3ef 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,7 @@ void createHandle(int index) { handle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (handle == 0) error (SWT.ERROR_NO_HANDLES); gtk_widget_set_has_window (handle, true); - OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS); + gtk_widget_set_can_focus (handle, true); 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 65c035644f..072dd38538 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 @@ -961,7 +961,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 ee8915ea35..87f0b0a3fd 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 = gtk_widget_get_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 036c84cb51..7485d194c6 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,7 @@ void createHandle (int index) { handle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (handle == 0) error (SWT.ERROR_NO_HANDLES); gtk_widget_set_has_window (handle, true); - OS.GTK_WIDGET_SET_FLAGS (handle, OS.GTK_CAN_FOCUS); + gtk_widget_set_can_focus (handle, true); 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 e2386d1aed..fb26b7dc08 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,7 @@ 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); + gtk_widget_set_can_focus (handle, true); } OS.gtk_container_add (fixedHandle, handle); } 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 0c8ec24ccd..eb1b4e8b87 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 @@ -1746,6 +1746,38 @@ int /*long*/ gtk_widget_get_window (int /*long*/ widget){ } } +void gtk_widget_set_can_default (int /*long*/ widget, boolean can_default) { + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + OS.gtk_widget_set_can_default (widget, can_default); + } else { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_CAN_DEFAULT); + } +} + +void gtk_widget_set_can_focus (int /*long*/ widget, boolean can_focus) { + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + OS.gtk_widget_set_can_focus (widget, can_focus); + } else { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_CAN_FOCUS); + } +} + +void gtk_widget_set_mapped (int /*long*/ widget, boolean mapped) { + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + OS.gtk_widget_set_mapped (widget, mapped); + } else { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED); + } +} + +void gtk_widget_set_visible (int /*long*/ widget, boolean visible) { + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + OS.gtk_widget_set_visible (widget,visible); + } else { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_VISIBLE); + } +} + /** * Returns a string containing a concise, human-readable * description of the receiver. -- cgit From 37911e0ffd8884382e7030a0b8c6d0f4e7752bc6 Mon Sep 17 00:00:00 2001 From: Anatoly Spektor Date: Tue, 7 Aug 2012 14:17:06 -0400 Subject: Omit use of deprecated GTK_WIDGET_UNSET_FLAGS Conflicts: bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java --- .../org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c | 18 ++++++++++++++++++ .../Eclipse SWT PI/gtk/library/os_custom.h | 1 + .../Eclipse SWT PI/gtk/library/os_stats.c | 5 +++-- .../Eclipse SWT PI/gtk/library/os_stats.h | 1 + .../gtk/org/eclipse/swt/internal/gtk/OS.java | 10 ++++++++++ .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Combo.java | 2 +- .../gtk/org/eclipse/swt/widgets/Composite.java | 2 +- .../gtk/org/eclipse/swt/widgets/Control.java | 6 +++--- .../gtk/org/eclipse/swt/widgets/DateTime.java | 6 +++--- .../gtk/org/eclipse/swt/widgets/ExpandItem.java | 4 ++-- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Menu.java | 2 +- .../gtk/org/eclipse/swt/widgets/MenuItem.java | 2 +- .../gtk/org/eclipse/swt/widgets/Widget.java | 8 ++++++++ 13 files changed, 53 insertions(+), 14 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 41d9821b4e..92f1670fae 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 @@ -16147,6 +16147,24 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1parent_1window) } #endif +#ifndef NO__1gtk_1widget_1set_1receives_1default +JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1receives_1default) + (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1) +{ + OS_NATIVE_ENTER(env, that, _1gtk_1widget_1set_1receives_1default_FUNC); +/* + gtk_widget_set_receives_default(arg0, arg1); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_widget_set_receives_default) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong, jboolean))fp)(arg0, arg1); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1widget_1set_1receives_1default_FUNC); +} +#endif + #ifndef NO__1gtk_1widget_1set_1redraw_1on_1allocate JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1set_1redraw_1on_1allocate) (JNIEnv *env, jclass that, jintLong arg0, jboolean 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 1e38d0b6f1..3b2b5ba659 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 @@ -222,6 +222,7 @@ #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_receives_default_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 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 626e121e85..b1b6aaeda9 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 = 1334; -int OS_nativeFunctionCallCount[1334]; +int OS_nativeFunctionCount = 1335; +int OS_nativeFunctionCallCount[1335]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -1271,6 +1271,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1widget_1set_1mapped", "_1gtk_1widget_1set_1name", "_1gtk_1widget_1set_1parent_1window", + "_1gtk_1widget_1set_1receives_1default", "_1gtk_1widget_1set_1redraw_1on_1allocate", "_1gtk_1widget_1set_1sensitive", "_1gtk_1widget_1set_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 8975724e97..81bd7056a9 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 @@ -1279,6 +1279,7 @@ typedef enum { _1gtk_1widget_1set_1mapped_FUNC, _1gtk_1widget_1set_1name_FUNC, _1gtk_1widget_1set_1parent_1window_FUNC, + _1gtk_1widget_1set_1receives_1default_FUNC, _1gtk_1widget_1set_1redraw_1on_1allocate_FUNC, _1gtk_1widget_1set_1sensitive_FUNC, _1gtk_1widget_1set_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 eb2d39ae14..1b27f48bda 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 @@ -12598,6 +12598,16 @@ public static final void gtk_widget_set_direction(int /*long*/ widget, int dir) lock.unlock(); } } +/** @method flags=dynamic */ +public static final native void _gtk_widget_set_receives_default(int /*long*/ widget, boolean receives_default); +public static final void gtk_widget_set_receives_default(int /*long*/ widget, boolean receives_default) { + lock.lock(); + try { + _gtk_widget_set_receives_default(widget, receives_default); + } finally { + lock.unlock(); + } +} /** * @param widget cast=(GtkWidget *) * @param double_buffered cast=(gboolean) 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 6b4b552719..b34449a7ea 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 @@ -450,7 +450,7 @@ void createHandle (int index) { * clear the GTK_RECEIVES_DEFAULT flag. */ if ((style & SWT.READ_ONLY) != 0 && buttonHandle != 0) { - OS.GTK_WIDGET_UNSET_FLAGS (buttonHandle, OS.GTK_RECEIVES_DEFAULT); + gtk_widget_set_receives_default (buttonHandle, false); } } 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 35c0369518..8d68182c7d 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 @@ -532,7 +532,7 @@ int /*long*/ focusHandle () { boolean forceFocus (int /*long*/ focusHandle) { if (socketHandle != 0) gtk_widget_set_can_focus (focusHandle, true); boolean result = super.forceFocus (focusHandle); - if (socketHandle != 0) OS.GTK_WIDGET_UNSET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS); + if (socketHandle != 0) gtk_widget_set_can_focus (focusHandle, false); return result; } 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 6e57710576..83d1920130 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 @@ -195,7 +195,7 @@ void fixFocus (Control focusControl) { OS.gtk_widget_grab_focus (focusHandle); // widget could be disposed at this point if (isDisposed ()) return; - OS.GTK_WIDGET_UNSET_FLAGS (focusHandle, OS.GTK_CAN_FOCUS); + gtk_widget_set_can_focus (focusHandle, false); } void fixStyle () { @@ -840,7 +840,7 @@ void moveHandle (int x, int y) { * old bounds of the child are correctly redrawn. */ boolean visible = gtk_widget_get_visible (parentHandle); - OS.GTK_WIDGET_UNSET_FLAGS (parentHandle, OS.GTK_VISIBLE); + gtk_widget_set_visible (parentHandle, false); OS.gtk_fixed_move (parentHandle, topHandle, x, y); if (visible) { gtk_widget_set_visible (parentHandle, true); @@ -4564,7 +4564,7 @@ public void setVisible (boolean visible) { } state |= HIDDEN; if (fixFocus) { - OS.GTK_WIDGET_UNSET_FLAGS (topHandle, OS.GTK_VISIBLE); + gtk_widget_set_visible (topHandle, false); fixFocus (control); if (isDisposed ()) return; gtk_widget_set_visible (topHandle, true); 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 e65d539966..96cd6be002 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 @@ -163,10 +163,10 @@ void createText(boolean dropDown) { createPopupShell(-1, -1, -1); } else { up = new Button(this, SWT.ARROW | SWT.UP); - OS.GTK_WIDGET_UNSET_FLAGS(up.handle, OS.GTK_CAN_FOCUS); + gtk_widget_set_can_focus (up.handle, false); //up.setToolTipText(SWT.getMessage ("SWT_Up")); //$NON-NLS-1$ down = new Button(this, SWT.ARROW | SWT.DOWN); - OS.GTK_WIDGET_UNSET_FLAGS(down.handle, OS.GTK_CAN_FOCUS); + gtk_widget_set_can_focus (down.handle, false); //down.setToolTipText(SWT.getMessage ("SWT_Down")); //$NON-NLS-1$ up.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { @@ -185,7 +185,7 @@ void createText(boolean dropDown) { void createDropDownButton() { down = new Button(this, SWT.ARROW | SWT.DOWN); - OS.GTK_WIDGET_UNSET_FLAGS(down.handle, OS.GTK_CAN_FOCUS); + gtk_widget_set_can_focus (down.handle, false); down.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { boolean dropped = isDropped(); 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 05d4dcec64..7da2a5e5bf 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 @@ -329,7 +329,7 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) { } int /*long*/ gtk_focus_out_event (int /*long*/ widget, int /*long*/ event) { - OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_CAN_FOCUS); + gtk_widget_set_can_focus (handle, false); parent.lastFocus = this; return 0; } @@ -514,7 +514,7 @@ boolean setFocus () { // widget could be disposed at this point if (isDisposed ()) return false; boolean result = OS.gtk_widget_is_focus (handle); - if (!result) OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_CAN_FOCUS); + if (!result) gtk_widget_set_can_focus (handle, false); return result; } 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 072dd38538..7a45c3af0d 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 @@ -963,7 +963,7 @@ public void setEnabled (boolean enabled) { if (enabled) { OS.gtk_widget_set_sensitive (handle, true); } else { - OS.GTK_WIDGET_UNSET_FLAGS (handle, OS.GTK_SENSITIVE); + OS.gtk_widget_set_sensitive (handle, false); } } 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 87f0b0a3fd..ccaa1c62ec 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 @@ -278,7 +278,7 @@ void createHandle (int index) { boolean enabled = gtk_widget_get_sensitive (parentHandle); 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); + if (!enabled) OS.gtk_widget_set_sensitive (parentHandle, false); OS.gtk_widget_show (handle); } 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 eb1b4e8b87..e69adb80a7 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 @@ -1778,6 +1778,14 @@ void gtk_widget_set_visible (int /*long*/ widget, boolean visible) { } } +void gtk_widget_set_receives_default (int /*long*/ widget, boolean receives_default) { + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + OS.gtk_widget_set_receives_default (widget, receives_default); + } else { + OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_RECEIVES_DEFAULT); + } +} + /** * Returns a string containing a concise, human-readable * description of the receiver. -- cgit From 27e4e4382fd0d1ea5096b74264f64b5ca0207625 Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Wed, 8 Aug 2012 10:23:59 -0400 Subject: fix: use helper instead of OS native. And fix helpers to call OS.GTK_WIDGET_UNSET_FLAGS when parameter is false --- .../gtk/org/eclipse/swt/widgets/Scrollable.java | 2 +- .../gtk/org/eclipse/swt/widgets/Widget.java | 24 ++++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java index 697d33939f..c08b0f3994 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java @@ -370,7 +370,7 @@ void redrawBackgroundImage () { void redrawWidget (int x, int y, int width, int height, boolean redrawAll, boolean all, boolean trim) { super.redrawWidget (x, y, width, height, redrawAll, all, trim); - if (!OS.gtk_widget_get_realized (handle)) return; + if (!gtk_widget_get_realized (handle)) return; if (!trim) return; int /*long*/ topHandle = topHandle (), paintHandle = paintHandle (); if (topHandle == paintHandle) return; 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 e69adb80a7..9b944e5b4e 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 @@ -1750,7 +1750,11 @@ void gtk_widget_set_can_default (int /*long*/ widget, boolean can_default) { if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { OS.gtk_widget_set_can_default (widget, can_default); } else { - OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_CAN_DEFAULT); + if (can_default) { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_CAN_DEFAULT); + } else { + OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_CAN_DEFAULT); + } } } @@ -1758,7 +1762,11 @@ void gtk_widget_set_can_focus (int /*long*/ widget, boolean can_focus) { if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { OS.gtk_widget_set_can_focus (widget, can_focus); } else { - OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_CAN_FOCUS); + if (can_focus) { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_CAN_FOCUS); + } else { + OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_CAN_FOCUS); + } } } @@ -1766,7 +1774,11 @@ void gtk_widget_set_mapped (int /*long*/ widget, boolean mapped) { if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { OS.gtk_widget_set_mapped (widget, mapped); } else { - OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED); + if (mapped) { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_MAPPED); + } else { + OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_MAPPED); + } } } @@ -1774,7 +1786,11 @@ void gtk_widget_set_visible (int /*long*/ widget, boolean visible) { if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { OS.gtk_widget_set_visible (widget,visible); } else { - OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_VISIBLE); + if (visible) { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_VISIBLE); + } else { + OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_VISIBLE); + } } } -- cgit From feeb829364550341b4ae470013292e77198660ff Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Wed, 8 Aug 2012 10:46:52 -0400 Subject: forgot to fix Widget.gtk_widget_set_receives_default --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 9b944e5b4e..bf9d1c108a 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 @@ -1798,7 +1798,11 @@ void gtk_widget_set_receives_default (int /*long*/ widget, boolean receives_defa if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { OS.gtk_widget_set_receives_default (widget, receives_default); } else { - OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_RECEIVES_DEFAULT); + if (receives_default) { + OS.GTK_WIDGET_SET_FLAGS (widget, OS.GTK_RECEIVES_DEFAULT); + } else { + OS.GTK_WIDGET_UNSET_FLAGS (widget, OS.GTK_RECEIVES_DEFAULT); + } } } -- cgit