diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/List.java | 156 |
1 files changed, 78 insertions, 78 deletions
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 f7dbfe5506..17f46889cd 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 @@ -40,7 +40,7 @@ import org.eclipse.swt.events.*; * @noextend This class is not intended to be subclassed by clients. */ public class List extends Scrollable { - int /*long*/ modelHandle; + long /*int*/ modelHandle; static final int TEXT_COLUMN = 0; @@ -96,7 +96,7 @@ public void add (String string) { checkWidget(); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); byte [] buffer = Converter.wcsToMbcs (null, string, true); - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); if (iter == 0) error (SWT.ERROR_ITEM_NOT_ADDED); OS.gtk_list_store_append (modelHandle, iter); OS.gtk_list_store_set (modelHandle, iter, TEXT_COLUMN, buffer, -1); @@ -134,7 +134,7 @@ public void add (String string, int index) { error (SWT.ERROR_INVALID_RANGE); } byte [] buffer = Converter.wcsToMbcs (null, string, true); - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); if (iter == 0) error (SWT.ERROR_ITEM_NOT_ADDED); /* * Feature in GTK. It is much faster to append to a list store @@ -196,14 +196,14 @@ void createHandle (int index) { * Columns: * 0 - text */ - int /*long*/ [] types = new int /*long*/ [] {OS.G_TYPE_STRING ()}; + long /*int*/ [] types = new long /*int*/ [] {OS.G_TYPE_STRING ()}; modelHandle = OS.gtk_list_store_newv (types.length, types); if (modelHandle == 0) error (SWT.ERROR_NO_HANDLES); handle = OS.gtk_tree_view_new_with_model (modelHandle); if (handle == 0) error (SWT.ERROR_NO_HANDLES); - int /*long*/ textRenderer = OS.gtk_cell_renderer_text_new (); + long /*int*/ textRenderer = OS.gtk_cell_renderer_text_new (); if (textRenderer == 0) error (SWT.ERROR_NO_HANDLES); - int /*long*/ columnHandle = OS.gtk_tree_view_column_new (); + long /*int*/ columnHandle = OS.gtk_tree_view_column_new (); if (columnHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_tree_view_column_pack_start (columnHandle, textRenderer, true); OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.text, TEXT_COLUMN); @@ -213,7 +213,7 @@ void createHandle (int index) { OS.gtk_container_add (scrolledHandle, handle); int mode = (style & SWT.MULTI) != 0 ? OS.GTK_SELECTION_MULTIPLE : OS.GTK_SELECTION_BROWSE; - int /*long*/ selectionHandle = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selectionHandle = OS.gtk_tree_view_get_selection (handle); OS.gtk_tree_selection_set_mode (selectionHandle, mode); OS.gtk_tree_view_set_headers_visible (handle, false); int hsp = (style & SWT.H_SCROLL) != 0 ? OS.GTK_POLICY_AUTOMATIC : OS.GTK_POLICY_NEVER; @@ -279,8 +279,8 @@ void deregister() { public void deselect (int index) { checkWidget(); if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (modelHandle, 0))) return; - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); OS.gtk_tree_selection_unselect_iter (selection, iter); @@ -310,8 +310,8 @@ public void deselect (int start, int end) { if (start >= count && end >= count) return; start = Math.min (count - 1, Math.max (0, start)); end = Math.min (count - 1, Math.max (0, end)); - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); for (int index=start; index<=end; index++) { OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); @@ -341,9 +341,9 @@ public void deselect (int start, int end) { public void deselect (int [] indices) { checkWidget(); if (indices == null) error (SWT.ERROR_NULL_ARGUMENT); - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); int count = OS.gtk_tree_model_iter_n_children (modelHandle, 0); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); for (int i=0; i<indices.length; i++) { int index = indices [i]; @@ -365,7 +365,7 @@ public void deselect (int [] indices) { */ public void deselectAll () { checkWidget(); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); OS.gtk_tree_selection_unselect_all (selection); OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); @@ -374,10 +374,10 @@ public void deselectAll () { boolean dragDetect (int x, int y, boolean filter, boolean dragOnTimeout, boolean [] consume) { boolean selected = false; if (filter) { - int /*long*/ [] path = new int /*long*/ [1]; + long /*int*/ [] path = new long /*int*/ [1]; if (OS.gtk_tree_view_get_path_at_pos (handle, x, y, path, null, null, null)) { if (path [0] != 0) { - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); if (OS.gtk_tree_selection_path_is_selected (selection, path [0])) selected = true; OS.gtk_tree_path_free (path [0]); } @@ -390,7 +390,7 @@ boolean dragDetect (int x, int y, boolean filter, boolean dragOnTimeout, boolean return dragDetect; } -int /*long*/ eventWindow () { +long /*int*/ eventWindow () { return paintWindow (); } @@ -411,10 +411,10 @@ GdkColor getBackgroundColor () { */ public int getFocusIndex () { checkWidget(); - int /*long*/ [] path = new int /*long*/ [1]; + long /*int*/ [] path = new long /*int*/ [1]; OS.gtk_tree_view_get_cursor (handle, path, null); if (path [0] == 0) return -1; - int /*long*/ indices = OS.gtk_tree_path_get_indices (path [0]); + long /*int*/ indices = OS.gtk_tree_path_get_indices (path [0]); int [] index = new int []{-1}; if (indices != 0) OS.memmove (index, indices, 4); OS.gtk_tree_path_free (path [0]); @@ -445,8 +445,8 @@ public String getItem (int index) { if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (modelHandle, 0))) { error (SWT.ERROR_INVALID_RANGE); } - int /*long*/ [] ptr = new int /*long*/ [1]; - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ [] ptr = new long /*int*/ [1]; + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); OS.gtk_tree_model_get (modelHandle, iter, 0, ptr, -1); OS.g_free (iter); @@ -487,13 +487,13 @@ public int getItemCount () { public int getItemHeight () { checkWidget(); int itemCount = OS.gtk_tree_model_iter_n_children (modelHandle, 0); - int /*long*/ column = OS.gtk_tree_view_get_column (handle, 0); + long /*int*/ column = OS.gtk_tree_view_get_column (handle, 0); if (itemCount == 0) { int [] w = new int [1], h = new int [1]; OS.gtk_tree_view_column_cell_get_size (column, null, null, null, w, h); return h [0]; } else { - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); OS.gtk_tree_model_get_iter_first (modelHandle, iter); OS.gtk_tree_view_column_cell_set_cell_data (column, modelHandle, iter, false, false); int [] w = new int [1], h = new int [1]; @@ -522,9 +522,9 @@ public int getItemHeight () { public String [] getItems () { checkWidget(); int count = OS.gtk_tree_model_iter_n_children (modelHandle, 0); - int /*long*/ [] ptr = new int /*long*/ [1]; + long /*int*/ [] ptr = new long /*int*/ [1]; String [] result = new String [count]; - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); for (int index=0; index<count; index++) { OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); OS.gtk_tree_model_get (modelHandle, iter, 0, ptr, -1); @@ -578,7 +578,7 @@ public String [] getSelection () { */ public int getSelectionCount () { checkWidget(); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); return OS.gtk_tree_selection_count_selected_rows (selection); } @@ -595,14 +595,14 @@ public int getSelectionCount () { */ public int getSelectionIndex () { checkWidget(); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); - int /*long*/ list = OS.gtk_tree_selection_get_selected_rows (selection, null); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ list = OS.gtk_tree_selection_get_selected_rows (selection, null); if (list != 0) { int count = OS.g_list_length (list); int [] index = new int [1]; for (int i=0; i<count; i++) { - int /*long*/ data = OS.g_list_nth_data (list, i); - int /*long*/ indices = OS.gtk_tree_path_get_indices (data); + long /*int*/ data = OS.g_list_nth_data (list, i); + long /*int*/ indices = OS.gtk_tree_path_get_indices (data); if (indices != 0) { OS.memmove (index, indices, 4); for (int j = i; j < count; j++) { @@ -637,15 +637,15 @@ public int getSelectionIndex () { */ public int [] getSelectionIndices () { checkWidget(); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); - int /*long*/ list = OS.gtk_tree_selection_get_selected_rows (selection, null); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ list = OS.gtk_tree_selection_get_selected_rows (selection, null); if (list != 0) { int count = OS.g_list_length (list); int [] treeSelection = new int [count]; int length = 0; for (int i=0; i<count; i++) { - int /*long*/ data = OS.g_list_nth_data (list, i); - int /*long*/ indices = OS.gtk_tree_path_get_indices (data); + long /*int*/ data = OS.g_list_nth_data (list, i); + long /*int*/ indices = OS.gtk_tree_path_get_indices (data); if (indices != 0) { int [] index = new int [1]; OS.memmove (index, indices, 4); @@ -676,23 +676,23 @@ public int [] getSelectionIndices () { */ public int getTopIndex () { checkWidget(); - int /*long*/ [] path = new int /*long*/ [1]; + long /*int*/ [] path = new long /*int*/ [1]; OS.gtk_widget_realize (handle); if (!OS.gtk_tree_view_get_path_at_pos (handle, 1, 1, path, null, null, null)) return 0; if (path [0] == 0) return 0; - int /*long*/ indices = OS.gtk_tree_path_get_indices (path[0]); + long /*int*/ indices = OS.gtk_tree_path_get_indices (path[0]); int[] index = new int [1]; if (indices != 0) OS.memmove (index, indices, 4); OS.gtk_tree_path_free (path [0]); return index [0]; } -int /*long*/ gtk_changed (int /*long*/ widget) { +long /*int*/ gtk_changed (long /*int*/ widget) { sendSelectionEvent (SWT.Selection); return 0; } -int /*long*/ gtk_event_after (int /*long*/ widget, int /*long*/ gdkEvent) { +long /*int*/ gtk_event_after (long /*int*/ widget, long /*int*/ gdkEvent) { switch (OS.GDK_EVENT_TYPE (gdkEvent)) { case OS.GDK_EXPOSE: { /* @@ -711,8 +711,8 @@ int /*long*/ gtk_event_after (int /*long*/ widget, int /*long*/ gdkEvent) { return super.gtk_event_after (widget, gdkEvent); } -int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) { - int /*long*/ result = super.gtk_button_press_event (widget, event); +long /*int*/ gtk_button_press_event (long /*int*/ widget, long /*int*/ event) { + long /*int*/ result = super.gtk_button_press_event (widget, event); if (result != 0) return result; /* * Feature in GTK. In a multi-select list view, when multiple items are already @@ -726,10 +726,10 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) { OS.memmove (gdkEvent, event, GdkEventButton.sizeof); int button = gdkEvent.button; if (button == 3 && gdkEvent.type == OS.GDK_BUTTON_PRESS) { - int /*long*/ [] path = new int /*long*/ [1]; + long /*int*/ [] path = new long /*int*/ [1]; if (OS.gtk_tree_view_get_path_at_pos (handle, (int)gdkEvent.x, (int)gdkEvent.y, path, null, null, null)) { if (path [0] != 0) { - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); if (OS.gtk_tree_selection_path_is_selected (selection, path [0])) result = 1; OS.gtk_tree_path_free (path [0]); } @@ -744,10 +744,10 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) { * widget from automatically selecting the first item. */ if ((style & SWT.SINGLE) != 0 && getSelectionCount () == 0) { - int /*long*/ [] path = new int /*long*/ [1]; + long /*int*/ [] path = new long /*int*/ [1]; if (OS.gtk_tree_view_get_path_at_pos (handle, (int)gdkEvent.x, (int)gdkEvent.y, path, null, null, null)) { if (path [0] != 0) { - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); OS.gtk_tree_view_set_cursor (handle, path [0], 0, false); OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); @@ -767,8 +767,8 @@ int /*long*/ gtk_button_press_event (int /*long*/ widget, int /*long*/ event) { return result; } -int /*long*/ gtk_popup_menu (int /*long*/ widget) { - int /*long*/ result = super.gtk_popup_menu (widget); +long /*int*/ gtk_popup_menu (long /*int*/ widget) { + long /*int*/ result = super.gtk_popup_menu (widget); /* * Bug in GTK. The context menu for the typeahead in GtkTreeViewer * opens in the bottom right corner of the screen when Shift+F10 @@ -781,14 +781,14 @@ int /*long*/ gtk_popup_menu (int /*long*/ widget) { return OS.GTK_VERSION < OS.VERSION (2, 6, 5) ? 1 : result; } -int /*long*/ gtk_row_activated (int /*long*/ tree, int /*long*/ path, int /*long*/ column) { +long /*int*/ gtk_row_activated (long /*int*/ tree, long /*int*/ path, long /*int*/ column) { sendSelectionEvent (SWT.DefaultSelection); return 0; } void hookEvents () { super.hookEvents(); - int /*long*/ selection = OS.gtk_tree_view_get_selection(handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection(handle); OS.g_signal_connect_closure (selection, OS.changed, display.closures [CHANGED], false); OS.g_signal_connect_closure (handle, OS.row_activated, display.closures [ROW_ACTIVATED], false); } @@ -861,15 +861,15 @@ public int indexOf (String string, int start) { */ public boolean isSelected (int index) { checkWidget(); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); byte [] buffer = Converter.wcsToMbcs (null, Integer.toString (index), true); - int /*long*/ path = OS.gtk_tree_path_new_from_string (buffer); + long /*int*/ path = OS.gtk_tree_path_new_from_string (buffer); boolean answer = OS.gtk_tree_selection_path_is_selected (selection, path); OS.gtk_tree_path_free (path); return answer; } -int /*long*/ paintWindow () { +long /*int*/ paintWindow () { OS.gtk_widget_realize (handle); return OS.gtk_tree_view_get_bin_window (handle); } @@ -904,9 +904,9 @@ public void remove (int index) { if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (modelHandle, 0))) { error (SWT.ERROR_INVALID_RANGE); } - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); OS.gtk_list_store_remove (modelHandle, iter); OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); @@ -936,8 +936,8 @@ public void remove (int start, int end) { if (!(0 <= start && start <= end && end < count)) { error (SWT.ERROR_INVALID_RANGE); } - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); for (int index=end; index>=start; index--) { OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); @@ -998,8 +998,8 @@ public void remove (int [] indices) { if (!(0 <= start && start <= end && end < count)) { error (SWT.ERROR_INVALID_RANGE); } - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); int last = -1; for (int i=0; i<newIndices.length; i++) { @@ -1024,7 +1024,7 @@ public void remove (int [] indices) { */ public void removeAll () { checkWidget(); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); OS.gtk_list_store_clear (modelHandle); OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); @@ -1070,13 +1070,13 @@ public void removeSelectionListener(SelectionListener listener) { public void select (int index) { checkWidget(); if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (modelHandle, 0))) return; - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); OS.gtk_tree_selection_select_iter (selection, iter); if ((style & SWT.SINGLE) != 0) { - int /*long*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); + long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); OS.gtk_tree_view_set_cursor (handle, path, 0, false); OS.gtk_tree_path_free (path); } @@ -1113,14 +1113,14 @@ public void select (int start, int end) { if (count == 0 || start >= count) return; start = Math.max (0, start); end = Math.min (end, count - 1); - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); for (int index=start; index<=end; index++) { OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); OS.gtk_tree_selection_select_iter (selection, iter); if ((style & SWT.SINGLE) != 0) { - int /*long*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); + long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); OS.gtk_tree_view_set_cursor (handle, path, 0, false); OS.gtk_tree_path_free (path); } @@ -1156,9 +1156,9 @@ public void select (int [] indices) { if (indices == null) error (SWT.ERROR_NULL_ARGUMENT); int length = indices.length; if (length == 0 || ((style & SWT.SINGLE) != 0 && length > 1)) return; - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); int count = OS.gtk_tree_model_iter_n_children (modelHandle, 0); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); for (int i=0; i<length; i++) { int index = indices [i]; @@ -1166,7 +1166,7 @@ public void select (int [] indices) { OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); OS.gtk_tree_selection_select_iter (selection, iter); if ((style & SWT.SINGLE) != 0) { - int /*long*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); + long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); OS.gtk_tree_view_set_cursor (handle, path, 0, false); OS.gtk_tree_path_free (path); } @@ -1188,7 +1188,7 @@ public void select (int [] indices) { public void selectAll () { checkWidget(); if ((style & SWT.SINGLE) != 0) return; - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); OS.gtk_tree_selection_select_all (selection); OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); @@ -1202,10 +1202,10 @@ void selectFocusIndex (int index) { */ int count = OS.gtk_tree_model_iter_n_children (modelHandle, 0); if (!(0 <= index && index < count)) return; - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); - int /*long*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); OS.gtk_tree_view_set_cursor (handle, path, 0, false); /* @@ -1272,7 +1272,7 @@ public void setItem (int index, String string) { if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (modelHandle, 0))) { error (SWT.ERROR_INVALID_RANGE); } - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); byte [] buffer = Converter.wcsToMbcs (null, string, true); OS.gtk_list_store_set (modelHandle, iter, TEXT_COLUMN, buffer, -1); @@ -1299,11 +1299,11 @@ public void setItems (String [] items) { for (int i=0; i<items.length; i++) { if (items [i] == null) error (SWT.ERROR_INVALID_ARGUMENT); } - int /*long*/ selection = OS.gtk_tree_view_get_selection (handle); + long /*int*/ selection = OS.gtk_tree_view_get_selection (handle); OS.g_signal_handlers_block_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); OS.gtk_list_store_clear (modelHandle); OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, CHANGED); - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); if (iter == 0) error (SWT.ERROR_ITEM_NOT_ADDED); for (int i=0; i<items.length; i++) { String string = items [i]; @@ -1477,9 +1477,9 @@ public void setSelection (String [] items) { public void setTopIndex (int index) { checkWidget(); if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (modelHandle, 0))) return; - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); - int /*long*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); + long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); OS.gtk_tree_view_scroll_to_cell (handle, path, 0, true, 0, 0); if (OS.GTK_VERSION < OS.VERSION (2, 8, 0)) { /* @@ -1516,9 +1516,9 @@ public void showSelection () { checkWidget(); int index = getSelectionIndex (); if (index == -1) return; - int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); + long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); OS.gtk_tree_model_iter_nth_child (modelHandle, iter, 0, index); - int /*long*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); + long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter); /* * This code intentionally commented. * Bug in GTK. According to the documentation, gtk_tree_view_scroll_to_cell |