diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-07-16 14:12:50 -0400 |
---|---|---|
committer | Anatoly Spektor <aspektor@redhat.com> | 2012-07-16 14:12:50 -0400 |
commit | b468e9239bca7d603290b2d0bfc1e6125b9458ad (patch) | |
tree | fe3e6e159945bda628dce979290468b6a44de34e | |
parent | c9f7838af1e54e39107b4e5302048b7cebef9023 (diff) | |
download | eclipse.platform.swt-gtk_widget_flags.tar.gz eclipse.platform.swt-gtk_widget_flags.tar.xz eclipse.platform.swt-gtk_widget_flags.zip |
Omit use of deprecated GTK_WIDGET_FLAGSgtk_widget_flags
13 files changed, 201 insertions, 23 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..f04dd9c63f 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 @@ -15397,6 +15397,26 @@ JNIEXPORT jint JNICALL OS_NATIVE(_1gtk_1widget_1get_1events) } #endif +#ifndef NO__1gtk_1widget_1get_1has_1window +JNIEXPORT jboolean JNICALL OS_NATIVE(_1gtk_1widget_1get_1has_1window) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jboolean rc = 0; + OS_NATIVE_ENTER(env, that, _1gtk_1widget_1get_1has_1window_FUNC); +/* + rc = (jboolean)gtk_widget_get_has_window(arg0); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_widget_get_has_window) + if (fp) { + rc = (jboolean)((jboolean (CALLING_CONVENTION*)(jintLong))fp)(arg0); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1widget_1get_1has_1window_FUNC); + return rc; +} +#endif + #ifndef NO__1gtk_1widget_1get_1modifier_1style JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1modifier_1style) (JNIEnv *env, jclass that, jintLong arg0) @@ -15445,6 +15465,26 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1parent_1window) } #endif +#ifndef NO__1gtk_1widget_1get_1realized +JNIEXPORT jboolean JNICALL OS_NATIVE(_1gtk_1widget_1get_1realized) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jboolean rc = 0; + OS_NATIVE_ENTER(env, that, _1gtk_1widget_1get_1realized_FUNC); +/* + rc = (jboolean)gtk_widget_get_realized(arg0); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_widget_get_realized) + if (fp) { + rc = (jboolean)((jboolean (CALLING_CONVENTION*)(jintLong))fp)(arg0); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1widget_1get_1realized_FUNC); + return rc; +} +#endif + #ifndef NO__1gtk_1widget_1get_1size_1request JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1get_1size_1request) (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jintArray arg2) @@ -15506,6 +15546,26 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1widget_1get_1toplevel) } #endif +#ifndef NO__1gtk_1widget_1get_1visible +JNIEXPORT jboolean JNICALL OS_NATIVE(_1gtk_1widget_1get_1visible) + (JNIEnv *env, jclass that, jintLong arg0) +{ + jboolean rc = 0; + OS_NATIVE_ENTER(env, that, _1gtk_1widget_1get_1visible_FUNC); +/* + rc = (jboolean)gtk_widget_get_visible(arg0); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_widget_get_visible) + if (fp) { + rc = (jboolean)((jboolean (CALLING_CONVENTION*)(jintLong))fp)(arg0); + } + } + OS_NATIVE_EXIT(env, that, _1gtk_1widget_1get_1visible_FUNC); + return rc; +} +#endif + #ifndef NO__1gtk_1widget_1grab_1focus JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1widget_1grab_1focus) (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..5ab98cd1b8 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,9 @@ #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_get_has_window_LIB LIB_GTK +#define gtk_widget_get_visible_LIB LIB_GTK +#define gtk_widget_get_realized_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 +359,9 @@ #else #define GTK_SCROLLED_WINDOW_VSCROLLBAR(arg0) (arg0)->vscrollbar #endif +#ifndef GTK_OBJECT_FLAGS +#define GTK_OBJECT_FLAGS(arg0) 0 +#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..e68edff975 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 = 1318; +int OS_nativeFunctionCallCount[1318]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -1224,14 +1224,17 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1widget_1get_1child_1visible", "_1gtk_1widget_1get_1default_1style", "_1gtk_1widget_1get_1events", + "_1gtk_1widget_1get_1has_1window", "_1gtk_1widget_1get_1modifier_1style", "_1gtk_1widget_1get_1pango_1context", "_1gtk_1widget_1get_1parent", "_1gtk_1widget_1get_1parent_1window", + "_1gtk_1widget_1get_1realized", "_1gtk_1widget_1get_1size_1request", "_1gtk_1widget_1get_1style", "_1gtk_1widget_1get_1tooltip_1text", "_1gtk_1widget_1get_1toplevel", + "_1gtk_1widget_1get_1visible", "_1gtk_1widget_1grab_1focus", "_1gtk_1widget_1hide", "_1gtk_1widget_1is_1composited", 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..0932c16c05 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 @@ -1232,14 +1232,17 @@ typedef enum { _1gtk_1widget_1get_1child_1visible_FUNC, _1gtk_1widget_1get_1default_1style_FUNC, _1gtk_1widget_1get_1events_FUNC, + _1gtk_1widget_1get_1has_1window_FUNC, _1gtk_1widget_1get_1modifier_1style_FUNC, _1gtk_1widget_1get_1pango_1context_FUNC, _1gtk_1widget_1get_1parent_FUNC, _1gtk_1widget_1get_1parent_1window_FUNC, + _1gtk_1widget_1get_1realized_FUNC, _1gtk_1widget_1get_1size_1request_FUNC, _1gtk_1widget_1get_1style_FUNC, _1gtk_1widget_1get_1tooltip_1text_FUNC, _1gtk_1widget_1get_1toplevel_FUNC, + _1gtk_1widget_1get_1visible_FUNC, _1gtk_1widget_1grab_1focus_FUNC, _1gtk_1widget_1hide_FUNC, _1gtk_1widget_1is_1composited_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..758d35e027 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 @@ -12047,6 +12047,36 @@ public static final int /*long*/ gtk_widget_get_accessible (int /*long*/ widget) lock.unlock(); } } +/** @method flags=dynamic */ +public static final native boolean _gtk_widget_get_visible (int /*long*/ widget); +public static final boolean gtk_widget_get_visible (int /*long*/ widget) { + lock.lock(); + try { + return _gtk_widget_get_visible(widget); + } finally { + lock.unlock(); + } +} +/** @method flags=dynamic */ +public static final native boolean _gtk_widget_get_realized (int /*long*/ widget); +public static final boolean gtk_widget_get_realized (int /*long*/ widget) { + lock.lock(); + try { + return _gtk_widget_get_realized(widget); + } finally { + lock.unlock(); + } +} +/** @method flags=dynamic */ +public static final native boolean _gtk_widget_get_has_window (int /*long*/ widget); +public static final boolean gtk_widget_get_has_window (int /*long*/ widget) { + lock.lock(); + try { + return _gtk_widget_get_has_window(widget); + } finally { + lock.unlock(); + } +} /** @param widget cast=(GtkWidget *) */ public static final native boolean _gtk_widget_get_child_visible (int /*long*/ widget); public static final boolean gtk_widget_get_child_visible (int /*long*/ widget) { 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..61b4c4ff6a 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 @@ -184,7 +184,12 @@ public Point computeSize (int wHint, int hHint, boolean changed) { OS.gtk_widget_set_size_request (boxHandle, -1, -1); } Point size; - boolean wrap = labelHandle != 0 && (style & SWT.WRAP) != 0 && (OS.GTK_WIDGET_FLAGS (labelHandle) & OS.GTK_VISIBLE) != 0; + boolean wrap; + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + wrap = labelHandle != 0 && (style & SWT.WRAP) != 0 && OS.gtk_widget_get_visible(labelHandle); + }else{ + wrap = labelHandle != 0 && (style & SWT.WRAP) != 0 && (OS.GTK_WIDGET_FLAGS (labelHandle) & OS.GTK_VISIBLE) != 0; + } if (wrap) { int borderWidth = OS.gtk_container_get_border_width (handle); int[] focusWidth = new int[1]; @@ -730,7 +735,13 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize * resized to the preferred size but it still * won't draw properly. */ - boolean wrap = labelHandle != 0 && (style & SWT.WRAP) != 0 && (OS.GTK_WIDGET_FLAGS (labelHandle) & OS.GTK_VISIBLE) != 0; + boolean wrap; + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + wrap = labelHandle != 0 && (style & SWT.WRAP) != 0 && OS.gtk_widget_get_visible(labelHandle); + }else{ + wrap = labelHandle != 0 && (style & SWT.WRAP) != 0 && (OS.GTK_WIDGET_FLAGS (labelHandle) & OS.GTK_VISIBLE) != 0; + } + if (wrap) OS.gtk_widget_set_size_request (boxHandle, -1, -1); int result = super.setBounds (x, y, width, height, move, resize); /* 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..db78069c5c 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 @@ -351,8 +351,13 @@ int /*long*/ paintHandle () { int /*long*/ topHandle = topHandle (); int /*long*/ paintHandle = handle; while (paintHandle != topHandle) { - if ((OS.GTK_WIDGET_FLAGS (paintHandle) & OS.GTK_NO_WINDOW) == 0) break; - paintHandle = OS.gtk_widget_get_parent (paintHandle); + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + if (OS.gtk_widget_get_has_window(paintHandle)) break; + paintHandle = OS.gtk_widget_get_parent (paintHandle); + }else{ + if ((OS.GTK_WIDGET_FLAGS (paintHandle) & OS.GTK_NO_WINDOW) == 0) break; + paintHandle = OS.gtk_widget_get_parent (paintHandle); + } } return paintHandle; } @@ -822,11 +827,20 @@ void moveHandle (int x, int y) { * NOTE: Because every widget in SWT has an X window, the new and * old bounds of the child are correctly redrawn. */ - int flags = OS.GTK_WIDGET_FLAGS (parentHandle); - 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)) { + boolean visible = OS.gtk_widget_get_visible(parentHandle); + 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); + } + }else{ + int flags = OS.GTK_WIDGET_FLAGS (parentHandle); + 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); + } } } @@ -2313,8 +2327,14 @@ int /*long*/ fixedMapProc (int /*long*/ widget) { } OS.g_list_free (widgetList); } - if ((OS.GTK_WIDGET_FLAGS (widget) & OS.GTK_NO_WINDOW) == 0) { - OS.gdk_window_show_unraised (OS.GTK_WIDGET_WINDOW (widget)); + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + if (OS.gtk_widget_get_has_window(widget)) { + OS.gdk_window_show_unraised (OS.GTK_WIDGET_WINDOW (widget)); + } + }else{ + if ((OS.GTK_WIDGET_FLAGS (widget) & OS.GTK_NO_WINDOW) == 0) { + OS.gdk_window_show_unraised (OS.GTK_WIDGET_WINDOW (widget)); + } } return 0; } @@ -3491,7 +3511,11 @@ void redrawChildren () { } void redrawWidget (int x, int y, int width, int height, boolean redrawAll, boolean all, boolean trim) { - if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) == 0) return; + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + if (!OS.gtk_widget_get_realized(handle)) return; + }else{ + if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) == 0) return; + } int /*long*/ window = paintWindow (); GdkRectangle rect = new GdkRectangle (); if (redrawAll) { @@ -4307,7 +4331,13 @@ public void setRedraw (boolean redraw) { } } else { if (drawCount++ == 0) { - if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) != 0) { + boolean flags; + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + flags = OS.gtk_widget_get_realized(handle); + }else{ + flags = (OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) != 0; + } + if (flags) { int /*long*/ window = paintWindow (); Rectangle rect = getBounds (); GdkWindowAttr attributes = new GdkWindowAttr (); @@ -5057,7 +5087,12 @@ public void update () { void update (boolean all, boolean flush) { // checkWidget(); if (!OS.GTK_WIDGET_VISIBLE (topHandle ())) return; - if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) == 0) return; + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + if (!OS.gtk_widget_get_realized(handle)) return; + }else{ + if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) == 0) return; + } + int /*long*/ window = paintWindow (); if (flush) display.flushExposes (window, all); OS.gdk_window_process_updates (window, all); 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..920a6d5b8f 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 @@ -129,7 +129,12 @@ public Point computeSize (int wHint, int hHint, boolean changed) { * The fix is to use pango layout directly instead of the label size request * to calculate its preferred size. */ - boolean fixWrap = labelHandle != 0 && (style & SWT.WRAP) != 0 && (OS.GTK_WIDGET_FLAGS (labelHandle) & OS.GTK_VISIBLE) != 0; + boolean fixWrap; + if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { + fixWrap = labelHandle != 0 && (style & SWT.WRAP) != 0 && OS.gtk_widget_get_visible(labelHandle); + }else{ + fixWrap = labelHandle != 0 && (style & SWT.WRAP) != 0 && (OS.GTK_WIDGET_FLAGS (labelHandle) & OS.GTK_VISIBLE) != 0; + } if (fixWrap || frameHandle != 0) forceResize (); if (fixWrap) { int /*long*/ labelLayout = OS.gtk_label_get_layout (labelHandle); 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..d73a5072f1 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 @@ -287,8 +287,11 @@ void updateBar (int selection, int minimum, int maximum) { * fix is to update the progress bar state only when realized and restore * the state when the progress bar becomes realized. */ - if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) == 0) return; - + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + if (!OS.gtk_widget_get_realized(handle)) return; + }else{ + if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) == 0) return; + } double fraction = minimum == maximum ? 1 : (double)(selection - minimum) / (maximum - minimum); OS.gtk_progress_bar_set_fraction (handle, fraction); /* 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 5f63d5d518..ee76230343 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 @@ -357,7 +357,11 @@ 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_FLAGS (handle) & OS.GTK_REALIZED) == 0) return; + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + if (!OS.gtk_widget_get_realized(handle)) return; + }else{ + if ((OS.GTK_WIDGET_FLAGS (handle) & OS.GTK_REALIZED) == 0) 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/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java index deed81c947..a425c021ce 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 @@ -2490,7 +2490,13 @@ void setToolTipText (int /*long*/ rootWidget, int /*long*/ tipWidget, String str */ boolean set = true; if (tipWindow != 0) { - if ((OS.GTK_WIDGET_FLAGS (tipWidget) & (OS.GTK_REALIZED | OS.GTK_VISIBLE)) != 0) { + boolean flags; + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + flags = (OS.gtk_widget_get_visible(tipWidget) | OS.gtk_widget_get_realized(tipWidget)); + }else{ + flags = (OS.GTK_WIDGET_FLAGS (tipWidget) & (OS.GTK_REALIZED | OS.GTK_VISIBLE)) != 0; + } + if (flags) { int [] x = new int [1], y = new int [1]; int /*long*/ window = OS.gdk_window_at_pointer (x, y); if (window != 0) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java index 9042ad2475..ee4c38f1cf 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java @@ -697,7 +697,13 @@ public Rectangle getTextBounds (int index) { } void redraw () { - if ((OS.GTK_WIDGET_FLAGS (parent.handle) & OS.GTK_REALIZED) != 0) { + boolean flags; + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + flags= OS.gtk_widget_get_realized(parent.handle); + }else{ + flags = (OS.GTK_WIDGET_FLAGS (parent.handle) & OS.GTK_REALIZED) != 0; + } + if (flags) { int /*long*/ parentHandle = parent.handle; int /*long*/ path = OS.gtk_tree_model_get_path (parent.modelHandle, handle); GdkRectangle rect = new GdkRectangle (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java index 43277b1721..251864f468 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java @@ -1052,7 +1052,13 @@ public int indexOf (TreeItem item) { void redraw () { int /*long*/ parentHandle = parent.handle; - if ((OS.GTK_WIDGET_FLAGS (parentHandle) & OS.GTK_REALIZED) != 0) { + boolean flags; + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + flags = OS.gtk_widget_get_child_visible(parentHandle); + }else{ + flags = (OS.GTK_WIDGET_FLAGS (parentHandle) & OS.GTK_REALIZED) != 0; + } + if (flags) { int /*long*/ path = OS.gtk_tree_model_get_path (parent.modelHandle, handle); GdkRectangle rect = new GdkRectangle (); OS.gtk_tree_view_get_cell_area (parentHandle, path, 0, rect); |