Bug 369228 - Kill pre GTK 2.4 leftovers from Tree. (review)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index a38b242..45a9973 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -216,10 +216,6 @@
boolean idleNeeded;
/* GtkTreeView callbacks */
- int[] treeSelection;
- int treeSelectionLength;
- int /*long*/ treeSelectionProc;
- Callback treeSelectionCallback;
int /*long*/ cellDataProc;
Callback cellDataCallback;
@@ -2547,10 +2543,6 @@
shellMapProcClosure = OS.g_cclosure_new (shellMapProc, 0, 0);
OS.g_closure_ref (shellMapProcClosure);
-
- treeSelectionCallback = new Callback(this, "treeSelectionProc", 4); //$NON-NLS-1$
- treeSelectionProc = treeSelectionCallback.getAddress();
- if (treeSelectionProc == 0) error (SWT.ERROR_NO_MORE_CALLBACKS);
cellDataCallback = new Callback (this, "cellDataProc", 5); //$NON-NLS-1$
cellDataProc = cellDataCallback.getAddress ();
@@ -3273,8 +3265,6 @@
idleHandle = 0;
/* Dispose GtkTreeView callbacks */
- treeSelectionCallback.dispose (); treeSelectionCallback = null;
- treeSelectionProc = 0;
cellDataCallback.dispose (); cellDataCallback = null;
cellDataProc = 0;
@@ -3389,7 +3379,7 @@
thread = null;
lastWidget = activeShell = null;
flushData = closures = null;
- indexTable = signalIds = treeSelection = null;
+ indexTable = signalIds = null;
widgetTable = modalShells = null;
data = null;
values = keys = null;
@@ -4141,12 +4131,6 @@
return widget.sizeRequestProc (handle, arg0, user_data);
}
-int /*long*/ treeSelectionProc (int /*long*/ model, int /*long*/ path, int /*long*/ iter, int /*long*/ data) {
- Widget widget = getWidget (data);
- if (widget == null) return 0;
- return widget.treeSelectionProc (model, path, iter, treeSelection, treeSelectionLength++);
-}
-
void saveResources () {
int resourceCount = 0;
if (resources == null) {
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 847f4e2..5ea80a8 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
@@ -1550,16 +1550,4 @@
OS.g_free (iter);
}
-int /*long*/ treeSelectionProc (int /*long*/ model, int /*long*/ path, int /*long*/ iter, int[] selection, int length) {
- if (selection != null) {
- int /*long*/ indices = OS.gtk_tree_path_get_indices (path);
- if (indices != 0) {
- int [] index = new int [1];
- OS.memmove (index, indices, 4);
- selection [length] = index [0];
- }
- }
- return 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 f78f77d..7cc3998 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
@@ -3533,18 +3533,6 @@
showItem (item.handle);
}
-int /*long*/ treeSelectionProc (int /*long*/ model, int /*long*/ path, int /*long*/ iter, int[] selection, int length) {
- if (selection != null) {
- int /*long*/ indices = OS.gtk_tree_path_get_indices (path);
- if (indices != 0) {
- int [] index = new int [1];
- OS.memmove (index, indices, 4);
- selection [(int)/*64*/length] = index [0];
- }
- }
- return 0;
-}
-
void updateScrollBarValue (ScrollBar bar) {
super.updateScrollBarValue (bar);
/*
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 1fa150e..30ef7ba 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
@@ -655,12 +655,7 @@
createRenderers (checkColumn.handle, checkColumn.modelIndex, false, checkColumn.style);
}
createRenderers (columnHandle, modelIndex, index == 0, column == null ? 0 : column.style);
- /*
- * Use GTK_TREE_VIEW_COLUMN_GROW_ONLY on GTK versions < 2.3.2
- * because fixed_height_mode is not supported.
- */
- boolean useVirtual = (style & SWT.VIRTUAL) != 0 ;
- if (!useVirtual && columnCount == 0) {
+ if ((style & SWT.VIRTUAL) == 0 && columnCount == 0) {
OS.gtk_tree_view_column_set_sizing (columnHandle, OS.GTK_TREE_VIEW_COLUMN_GROW_ONLY);
} else {
OS.gtk_tree_view_column_set_sizing (columnHandle, OS.GTK_TREE_VIEW_COLUMN_FIXED);
@@ -1676,8 +1671,7 @@
public TreeItem[] getSelection () {
checkWidget();
int /*long*/ selection = OS.gtk_tree_view_get_selection (handle);
- int /*long*/ [] model = null;
- int /*long*/ list = OS.gtk_tree_selection_get_selected_rows (selection, model);
+ int /*long*/ list = OS.gtk_tree_selection_get_selected_rows (selection, null);
if (list != 0) {
int count = OS.g_list_length (list);
TreeItem [] treeSelection = new TreeItem [count];
@@ -1948,12 +1942,6 @@
return super.gtk_expose_event (widget, eventPtr);
}
-int /*long*/ gtk_key_press_event (int /*long*/ widget, int /*long*/ eventPtr) {
- int /*long*/ result = super.gtk_key_press_event (widget, eventPtr);
- if (result != 0) return result;
- return result;
-}
-
int /*long*/ gtk_motion_notify_event (int /*long*/ widget, int /*long*/ event) {
int /*long*/ window = OS.GDK_EVENT_WINDOW (event);
if (window != OS.gtk_tree_view_get_bin_window (handle)) return 0;
@@ -3405,15 +3393,6 @@
OS.gtk_tree_path_free (path);
}
-int /*long*/ treeSelectionProc (int /*long*/ model, int /*long*/ path, int /*long*/ iter, int[] selection, int length) {
- if (selection != null) {
- int [] index = new int [1];
- OS.gtk_tree_model_get (modelHandle, iter, ID_COLUMN, index, -1);
- selection [(int)/*64*/length] = index [0];
- }
- return 0;
-}
-
void updateScrollBarValue (ScrollBar bar) {
super.updateScrollBarValue (bar);
/*
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 6285902..3196831 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
@@ -1679,10 +1679,6 @@
return 0;
}
-int /*long*/ treeSelectionProc (int /*long*/ model, int /*long*/ path, int /*long*/ iter, int [] selection, int length) {
- return 0;
-}
-
boolean translateTraversal (int event) {
return false;
}