diff options
10 files changed, 81 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDropTargetEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDropTargetEffect.java index ace9718800..00642a449b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDropTargetEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDropTargetEffect.java @@ -167,7 +167,11 @@ public class TreeDropTargetEffect extends DropTargetEffect { OS.gtk_tree_view_get_cell_area (handle, path[0], 0, cellRect); if (cellRect.y < cellRect.height) { int[] tx = new int[1], ty = new int[1]; - OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y - cellRect.height, tx, ty); + if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) { + OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y - cellRect.height, tx, ty); + } else { + OS.gtk_tree_view_convert_widget_to_bin_window_coords(handle, cellRect.x, cellRect.y - cellRect.height, tx, ty); + } OS.gtk_tree_view_scroll_to_point (handle, -1, ty[0]); } else { //scroll down 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 8444a6dc7f..075721ddf0 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 @@ -15179,7 +15179,7 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1column_1set_1cell_1data_1fun (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3, jintLong arg4) { OS_NATIVE_ENTER(env, that, _1gtk_1tree_1view_1column_1set_1cell_1data_1func_FUNC); - gtk_tree_view_column_set_cell_data_func((GtkTreeViewColumn *)arg0, (GtkCellRenderer *)arg1, (GtkTreeCellDataFunc)arg2, (gpointer)arg3, (GtkDestroyNotify)arg4); + gtk_tree_view_column_set_cell_data_func((GtkTreeViewColumn *)arg0, (GtkCellRenderer *)arg1, (GtkTreeCellDataFunc)arg2, (gpointer)arg3, (GDestroyNotify)arg4); OS_NATIVE_EXIT(env, that, _1gtk_1tree_1view_1column_1set_1cell_1data_1func_FUNC); } #endif @@ -15298,6 +15298,31 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1column_1set_1widget) } #endif +#ifndef NO__1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords +JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords) + (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jintArray arg3, jintArray arg4) +{ + jint *lparg3=NULL; + jint *lparg4=NULL; + OS_NATIVE_ENTER(env, that, _1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords_FUNC); + if (arg3) if ((lparg3 = (*env)->GetIntArrayElements(env, arg3, NULL)) == NULL) goto fail; + if (arg4) if ((lparg4 = (*env)->GetIntArrayElements(env, arg4, NULL)) == NULL) goto fail; +/* + gtk_tree_view_convert_widget_to_bin_window_coords((GtkTreeView *)arg0, arg1, arg2, lparg3, lparg4); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_tree_view_convert_widget_to_bin_window_coords) + if (fp) { + ((void (CALLING_CONVENTION*)(GtkTreeView *, jint, jint, jint *, jint *))fp)((GtkTreeView *)arg0, arg1, arg2, lparg3, lparg4); + } + } +fail: + if (arg4 && lparg4) (*env)->ReleaseIntArrayElements(env, arg4, lparg4, 0); + if (arg3 && lparg3) (*env)->ReleaseIntArrayElements(env, arg3, lparg3, 0); + OS_NATIVE_EXIT(env, that, _1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords_FUNC); +} +#endif + #ifndef NO__1gtk_1tree_1view_1create_1row_1drag_1icon JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1tree_1view_1create_1row_1drag_1icon) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) @@ -15673,7 +15698,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gtk_1tree_1view_1widget_1to_1tree_1coords) OS_NATIVE_ENTER(env, that, _1gtk_1tree_1view_1widget_1to_1tree_1coords_FUNC); if (arg3) if ((lparg3 = (*env)->GetIntArrayElements(env, arg3, NULL)) == NULL) goto fail; if (arg4) if ((lparg4 = (*env)->GetIntArrayElements(env, arg4, NULL)) == NULL) goto fail; +/* gtk_tree_view_widget_to_tree_coords((GtkTreeView *)arg0, arg1, arg2, lparg3, lparg4); +*/ + { + OS_LOAD_FUNCTION(fp, gtk_tree_view_widget_to_tree_coords) + if (fp) { + ((void (CALLING_CONVENTION*)(GtkTreeView *, jint, jint, jint *, jint *))fp)((GtkTreeView *)arg0, arg1, arg2, lparg3, lparg4); + } + } fail: if (arg4 && lparg4) (*env)->ReleaseIntArrayElements(env, arg4, lparg4, 0); if (arg3 && lparg3) (*env)->ReleaseIntArrayElements(env, arg3, lparg3, 0); diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h index d949a80cb3..7c0079e869 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.h @@ -19,9 +19,11 @@ #define NDEBUG #define G_DISABLE_DEPRECATED -/* #define GTK_DISABLE_DEPRECATED /* +#define GDK_DISABLE_DEPRECATED +#define GTK_DISABLE_SINGLE_INCLUDES +#define GSEAL_ENABLE */ #include <stdlib.h> 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 4172256436..c52e9f5850 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 @@ -130,7 +130,9 @@ #define gtk_tree_selection_count_selected_rows_LIB LIB_GTK #define gtk_tree_selection_get_selected_rows_LIB LIB_GTK #define gtk_tree_view_column_cell_get_position_LIB LIB_GTK +#define gtk_tree_view_convert_widget_to_bin_window_coords_LIB LIB_GTK #define gtk_tree_view_set_grid_lines_LIB LIB_GTK +#define gtk_tree_view_widget_to_tree_coords_LIB LIB_GTK #define gtk_entry_set_alignment_LIB LIB_GTK #define gtk_entry_set_icon_from_stock_LIB LIB_GTK #define gtk_entry_set_icon_sensitive_LIB LIB_GTK 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 a586ecb379..35b668272d 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 = 1377; -int OS_nativeFunctionCallCount[1377]; +int OS_nativeFunctionCount = 1378; +int OS_nativeFunctionCallCount[1378]; char * OS_nativeFunctionNames[] = { #ifndef JNI64 "Call__IIII", @@ -1218,6 +1218,7 @@ char * OS_nativeFunctionNames[] = { "_1gtk_1tree_1view_1column_1set_1title", "_1gtk_1tree_1view_1column_1set_1visible", "_1gtk_1tree_1view_1column_1set_1widget", + "_1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords", "_1gtk_1tree_1view_1create_1row_1drag_1icon", "_1gtk_1tree_1view_1expand_1row", "_1gtk_1tree_1view_1get_1background_1area", 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 2961535a3a..c611bcbb88 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 @@ -1226,6 +1226,7 @@ typedef enum { _1gtk_1tree_1view_1column_1set_1title_FUNC, _1gtk_1tree_1view_1column_1set_1visible_FUNC, _1gtk_1tree_1view_1column_1set_1widget_FUNC, + _1gtk_1tree_1view_1convert_1widget_1to_1bin_1window_1coords_FUNC, _1gtk_1tree_1view_1create_1row_1drag_1icon_FUNC, _1gtk_1tree_1view_1expand_1row_FUNC, _1gtk_1tree_1view_1get_1background_1area_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 b7f8bdf8de..74b4a76c14 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 @@ -11938,7 +11938,7 @@ public static final void gtk_tree_view_column_set_alignment(int /*long*/ tree_co * @param cell_renderer cast=(GtkCellRenderer *) * @param func cast=(GtkTreeCellDataFunc) * @param func_data cast=(gpointer) - * @param destroy cast=(GtkDestroyNotify) + * @param destroy cast=(GDestroyNotify) */ public static final native void _gtk_tree_view_column_set_cell_data_func(int /*long*/ tree_column, int /*long*/ cell_renderer, int /*long*/ func, int /*long*/ func_data, int /*long*/ destroy); public static final void gtk_tree_view_column_set_cell_data_func(int /*long*/ tree_column, int /*long*/ cell_renderer, int /*long*/ func, int /*long*/ func_data, int /*long*/ destroy) { @@ -12455,7 +12455,10 @@ public static final void gtk_tree_view_unset_rows_drag_dest(int /*long*/ tree_vi lock.unlock(); } } -/** @param tree_view cast=(GtkTreeView *) */ +/** + * @method flags=dynamic + * @param tree_view cast=(GtkTreeView *) + */ public static final native void _gtk_tree_view_widget_to_tree_coords(int /*long*/ tree_view, int wx, int wy, int[] tx, int[] ty); public static final void gtk_tree_view_widget_to_tree_coords(int /*long*/ tree_view, int wx, int wy, int[] tx, int[] ty) { lock.lock(); @@ -12465,6 +12468,19 @@ public static final void gtk_tree_view_widget_to_tree_coords(int /*long*/ tree_v lock.unlock(); } } +/** + * @method flags=dynamic + * @param tree_view cast=(GtkTreeView *) + */ +public static final native void _gtk_tree_view_convert_widget_to_bin_window_coords(int /*long*/ tree_view, int wx, int wy, int[] tx, int[] ty); +public static final void gtk_tree_view_convert_widget_to_bin_window_coords(int /*long*/ tree_view, int wx, int wy, int[] tx, int[] ty) { + lock.lock(); + try { + _gtk_tree_view_convert_widget_to_bin_window_coords(tree_view, wx, wy, tx, ty); + } finally { + lock.unlock(); + } +} /** * @param homogeneous cast=(gboolean) * @param spacing cast=(gint) 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 996751d8b7..c382a04297 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 @@ -1583,7 +1583,11 @@ public void showSelection () { GdkRectangle cellRect = new GdkRectangle (); OS.gtk_tree_view_get_cell_area (handle, path, 0, cellRect); int[] tx = new int[1], ty = new int[1]; - OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty); + if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) { + OS.gtk_tree_view_convert_widget_to_bin_window_coords(handle, cellRect.x, cellRect.y, tx, ty); + } else { + OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty); + } if (ty[0] < visibleRect.y ) { OS.gtk_tree_view_scroll_to_cell (handle, path, 0, true, 0f, 0f); OS.gtk_tree_view_scroll_to_point (handle, -1, ty[0]); 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 771173ef41..b58c8b51d4 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 @@ -3576,7 +3576,11 @@ void showItem (int /*long*/ iter) { GdkRectangle cellRect = new GdkRectangle (); OS.gtk_tree_view_get_cell_area (handle, path, 0, cellRect); int[] tx = new int[1], ty = new int[1]; - OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty); + if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) { + OS.gtk_tree_view_convert_widget_to_bin_window_coords(handle, cellRect.x, cellRect.y, tx, ty); + } else { + OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty); + } if (ty[0] < visibleRect.y ) { OS.gtk_tree_view_scroll_to_cell (handle, path, 0, true, 0f, 0f); OS.gtk_tree_view_scroll_to_point (handle, -1, ty[0]); 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 513622771a..196ba6e989 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 @@ -3408,7 +3408,11 @@ void showItem (int /*long*/ path, boolean scroll) { OS.gtk_tree_view_get_cell_area (handle, path, 0, cellRect); boolean isHidden = cellRect.y == 0 && cellRect.height == 0; int [] tx = new int [1], ty = new int [1]; - OS.gtk_tree_view_widget_to_tree_coords (handle, cellRect.x, cellRect.y, tx, ty); + if (OS.GTK_VERSION >= OS.VERSION(2, 12, 0)) { + OS.gtk_tree_view_convert_widget_to_bin_window_coords(handle, cellRect.x, cellRect.y, tx, ty); + } else { + OS.gtk_tree_view_widget_to_tree_coords(handle, cellRect.x, cellRect.y, tx, ty); + } GdkRectangle visibleRect = new GdkRectangle (); OS.gtk_tree_view_get_visible_rect (handle, visibleRect); if (!isHidden) { |