2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkIconView.html
52 * - GdkPixmap* -> Pixmap
53 * - GtkCellRenderer* -> CellRenderer
54 * - GtkTreeModel* -> TreeModel
55 * - GtkTreePath* -> TreePath
61 private import gtk
.gtktypes
;
63 private import lib
.gtk
;
65 private import gtk
.TreeModel
;
66 private import gtk
.TreePath
;
67 private import gtk
.CellRenderer
;
68 private import glib
.ListG
;
69 private import gdk
.Pixmap
;
73 * GtkIconView provides an alternative view on a list model.
74 * It displays the model as a grid of icons with labels. Like
75 * GtkTreeView, it allows to select one or multiple items
76 * (depending on the selection mode, see gtk_icon_view_set_selection_mode()).
77 * In addition to selection with the arrow keys, GtkIconView supports
78 * rubberband selection, which is controlled by dragging the pointer.
80 private import gtk
.Container
;
81 public class IconView
: Container
84 /** the main Gtk struct */
85 protected GtkIconView
* gtkIconView
;
88 public GtkIconView
* getIconViewStruct()
94 /** the main Gtk struct as a void* */
95 protected void* getStruct()
97 return cast(void*)gtkIconView
;
101 * Sets our main struct and passes it to the parent class
103 public this (GtkIconView
* gtkIconView
)
105 super(cast(GtkContainer
*)gtkIconView
);
106 this.gtkIconView
= gtkIconView
;
112 // imports for the signal processing
113 private import gobject
.Signals
;
114 private import gdk
.gdktypes
;
115 int[char[]] connectedSignals
;
117 gboolean
delegate(IconView
)[] onActivateCursorItemListeners
;
118 void addOnActivateCursorItem(gboolean
delegate(IconView
) dlg
)
120 if ( !("activate-cursor-item" in connectedSignals
) )
124 "activate-cursor-item",
125 cast(GCallback
)&callBackActivateCursorItem
,
128 cast(ConnectFlags
)0);
129 connectedSignals
["activate-cursor-item"] = 1;
131 onActivateCursorItemListeners
~= dlg
;
133 extern(C
) static void callBackActivateCursorItem(GtkIconView
* iconviewStruct
, IconView iconView
)
135 bit consumed
= false;
137 foreach ( gboolean
delegate(IconView
) dlg
; iconView
.onActivateCursorItemListeners
)
145 void delegate(TreePath
, IconView
)[] onItemActivatedListeners
;
146 void addOnItemActivated(void delegate(TreePath
, IconView
) dlg
)
148 if ( !("item-activated" in connectedSignals
) )
153 cast(GCallback
)&callBackItemActivated
,
156 cast(ConnectFlags
)0);
157 connectedSignals
["item-activated"] = 1;
159 onItemActivatedListeners
~= dlg
;
161 extern(C
) static void callBackItemActivated(GtkIconView
* iconviewStruct
, GtkTreePath
* arg1
, IconView iconView
)
163 bit consumed
= false;
165 foreach ( void delegate(TreePath
, IconView
) dlg
; iconView
.onItemActivatedListeners
)
167 dlg(new TreePath(arg1
), iconView
);
173 gboolean
delegate(GtkMovementStep
, gint
, IconView
)[] onMoveCursorListeners
;
174 void addOnMoveCursor(gboolean
delegate(GtkMovementStep
, gint
, IconView
) dlg
)
176 if ( !("move-cursor" in connectedSignals
) )
181 cast(GCallback
)&callBackMoveCursor
,
184 cast(ConnectFlags
)0);
185 connectedSignals
["move-cursor"] = 1;
187 onMoveCursorListeners
~= dlg
;
189 extern(C
) static void callBackMoveCursor(GtkIconView
* iconviewStruct
, GtkMovementStep arg1
, gint arg2
, IconView iconView
)
191 bit consumed
= false;
193 foreach ( gboolean
delegate(GtkMovementStep
, gint
, IconView
) dlg
; iconView
.onMoveCursorListeners
)
195 dlg(arg1
, arg2
, iconView
);
201 void delegate(IconView
)[] onSelectAllListeners
;
202 void addOnSelectAll(void delegate(IconView
) dlg
)
204 if ( !("select-all" in connectedSignals
) )
209 cast(GCallback
)&callBackSelectAll
,
212 cast(ConnectFlags
)0);
213 connectedSignals
["select-all"] = 1;
215 onSelectAllListeners
~= dlg
;
217 extern(C
) static void callBackSelectAll(GtkIconView
* iconviewStruct
, IconView iconView
)
219 bit consumed
= false;
221 foreach ( void delegate(IconView
) dlg
; iconView
.onSelectAllListeners
)
229 void delegate(IconView
)[] onSelectCursorItemListeners
;
230 void addOnSelectCursorItem(void delegate(IconView
) dlg
)
232 if ( !("select-cursor-item" in connectedSignals
) )
236 "select-cursor-item",
237 cast(GCallback
)&callBackSelectCursorItem
,
240 cast(ConnectFlags
)0);
241 connectedSignals
["select-cursor-item"] = 1;
243 onSelectCursorItemListeners
~= dlg
;
245 extern(C
) static void callBackSelectCursorItem(GtkIconView
* iconviewStruct
, IconView iconView
)
247 bit consumed
= false;
249 foreach ( void delegate(IconView
) dlg
; iconView
.onSelectCursorItemListeners
)
257 void delegate(IconView
)[] onSelectionChangedListeners
;
258 void addOnSelectionChanged(void delegate(IconView
) dlg
)
260 if ( !("selection-changed" in connectedSignals
) )
265 cast(GCallback
)&callBackSelectionChanged
,
268 cast(ConnectFlags
)0);
269 connectedSignals
["selection-changed"] = 1;
271 onSelectionChangedListeners
~= dlg
;
273 extern(C
) static void callBackSelectionChanged(GtkIconView
* iconviewStruct
, IconView iconView
)
275 bit consumed
= false;
277 foreach ( void delegate(IconView
) dlg
; iconView
.onSelectionChangedListeners
)
285 void delegate(GtkAdjustment
*, GtkAdjustment
*, IconView
)[] onSetScrollAdjustmentsListeners
;
286 void addOnSetScrollAdjustments(void delegate(GtkAdjustment
*, GtkAdjustment
*, IconView
) dlg
)
288 if ( !("set-scroll-adjustments" in connectedSignals
) )
292 "set-scroll-adjustments",
293 cast(GCallback
)&callBackSetScrollAdjustments
,
296 cast(ConnectFlags
)0);
297 connectedSignals
["set-scroll-adjustments"] = 1;
299 onSetScrollAdjustmentsListeners
~= dlg
;
301 extern(C
) static void callBackSetScrollAdjustments(GtkIconView
* iconviewStruct
, GtkAdjustment
* arg1
, GtkAdjustment
* arg2
, IconView iconView
)
303 bit consumed
= false;
305 foreach ( void delegate(GtkAdjustment
*, GtkAdjustment
*, IconView
) dlg
; iconView
.onSetScrollAdjustmentsListeners
)
307 dlg(arg1
, arg2
, iconView
);
313 void delegate(IconView
)[] onToggleCursorItemListeners
;
314 void addOnToggleCursorItem(void delegate(IconView
) dlg
)
316 if ( !("toggle-cursor-item" in connectedSignals
) )
320 "toggle-cursor-item",
321 cast(GCallback
)&callBackToggleCursorItem
,
324 cast(ConnectFlags
)0);
325 connectedSignals
["toggle-cursor-item"] = 1;
327 onToggleCursorItemListeners
~= dlg
;
329 extern(C
) static void callBackToggleCursorItem(GtkIconView
* iconviewStruct
, IconView iconView
)
331 bit consumed
= false;
333 foreach ( void delegate(IconView
) dlg
; iconView
.onToggleCursorItemListeners
)
341 void delegate(IconView
)[] onUnselectAllListeners
;
342 void addOnUnselectAll(void delegate(IconView
) dlg
)
344 if ( !("unselect-all" in connectedSignals
) )
349 cast(GCallback
)&callBackUnselectAll
,
352 cast(ConnectFlags
)0);
353 connectedSignals
["unselect-all"] = 1;
355 onUnselectAllListeners
~= dlg
;
357 extern(C
) static void callBackUnselectAll(GtkIconView
* iconviewStruct
, IconView iconView
)
359 bit consumed
= false;
361 foreach ( void delegate(IconView
) dlg
; iconView
.onUnselectAllListeners
)
373 * Creates a new GtkIconView widget
375 * A newly created GtkIconView widget
380 // GtkWidget* gtk_icon_view_new (void);
381 this(cast(GtkIconView
*)gtk_icon_view_new() );
385 * Creates a new GtkIconView widget with the model model.
389 * A newly created GtkIconView widget.
392 public this (TreeModel model
)
394 // GtkWidget* gtk_icon_view_new_with_model (GtkTreeModel *model);
395 this(cast(GtkIconView
*)gtk_icon_view_new_with_model((model
is null) ?
null : model
.getTreeModelStruct()) );
399 * Sets the model for a GtkIconView.
400 * If the icon_view already has a model set, it will remove
401 * it before setting the new model. If model is NULL, then
402 * it will unset the old model.
409 public void setModel(TreeModel model
)
411 // void gtk_icon_view_set_model (GtkIconView *icon_view, GtkTreeModel *model);
412 gtk_icon_view_set_model(gtkIconView
, (model
is null) ?
null : model
.getTreeModelStruct());
416 * Returns the model the GtkIconView is based on. Returns NULL if the
421 * A GtkTreeModel, or NULL if none is currently being used.
424 public TreeModel
getModel()
426 // GtkTreeModel* gtk_icon_view_get_model (GtkIconView *icon_view);
427 return new TreeModel( gtk_icon_view_get_model(gtkIconView
) );
431 * Sets the column with text for icon_view to be column. The text
432 * column must be of type G_TYPE_STRING.
436 * A column in the currently used model.
439 public void setTextColumn(int column
)
441 // void gtk_icon_view_set_text_column (GtkIconView *icon_view, gint column);
442 gtk_icon_view_set_text_column(gtkIconView
, column
);
446 * Returns the column with text for icon_view.
450 * the text column, or -1 if it's unset.
453 public int getTextColumn()
455 // gint gtk_icon_view_get_text_column (GtkIconView *icon_view);
456 return gtk_icon_view_get_text_column(gtkIconView
);
460 * Sets the column with markup information for icon_view to be
461 * column. The markup column must be of type G_TYPE_STRING.
462 * If the markup column is set to something, it overrides
463 * the text column set by gtk_icon_view_set_text_column().
467 * A column in the currently used model.
470 public void setMarkupColumn(int column
)
472 // void gtk_icon_view_set_markup_column (GtkIconView *icon_view, gint column);
473 gtk_icon_view_set_markup_column(gtkIconView
, column
);
477 * Returns the column with markup text for icon_view.
481 * the markup column, or -1 if it's unset.
484 public int getMarkupColumn()
486 // gint gtk_icon_view_get_markup_column (GtkIconView *icon_view);
487 return gtk_icon_view_get_markup_column(gtkIconView
);
491 * Sets the column with pixbufs for icon_view to be column. The pixbuf
492 * column must be of type GDK_TYPE_PIXBUF
496 * A column in the currently used model.
499 public void setPixbufColumn(int column
)
501 // void gtk_icon_view_set_pixbuf_column (GtkIconView *icon_view, gint column);
502 gtk_icon_view_set_pixbuf_column(gtkIconView
, column
);
506 * Returns the column with pixbufs for icon_view.
510 * the pixbuf column, or -1 if it's unset.
513 public int getPixbufColumn()
515 // gint gtk_icon_view_get_pixbuf_column (GtkIconView *icon_view);
516 return gtk_icon_view_get_pixbuf_column(gtkIconView
);
520 * Finds the path at the point (x, y), relative to widget coordinates.
521 * See gtk_icon_view_get_item_at_pos(), if you are also interested in
522 * the cell at the specified position.
526 * The x position to be identified
528 * The y position to be identified
530 * The GtkTreePath corresponding to the icon or NULL
531 * if no icon exists at that position.
534 public TreePath
getPathAtPos(int x
, int y
)
536 // GtkTreePath* gtk_icon_view_get_path_at_pos (GtkIconView *icon_view, gint x, gint y);
537 return new TreePath( gtk_icon_view_get_path_at_pos(gtkIconView
, x
, y
) );
541 * Finds the path at the point (x, y), relative to widget coordinates.
542 * In contrast to gtk_icon_view_get_path_at_pos(), this function also
543 * obtains the cell at the specified position. The returned path should
544 * be freed with gtk_tree_path_free().
548 * The x position to be identified
550 * The y position to be identified
552 * Return location for the path, or NULL
554 * Return location for the renderer responsible for the cell
557 * TRUE if an item exists at the specified position
560 public int getItemAtPos(int x
, int y
, GtkTreePath
** path
, GtkCellRenderer
** cell
)
562 // gboolean gtk_icon_view_get_item_at_pos (GtkIconView *icon_view, gint x, gint y, GtkTreePath **path, GtkCellRenderer **cell);
563 return gtk_icon_view_get_item_at_pos(gtkIconView
, x
, y
, path
, cell
);
567 * Sets the current keyboard focus to be at path, and selects it. This is
568 * useful when you want to focus the user's attention on a particular item.
569 * If cell is not NULL, then focus is given to the cell specified by
570 * it. Additionally, if start_editing is TRUE, then editing should be
571 * started in the specified cell.
572 * This function is often followed by gtk_widget_grab_focus
573 * (icon_view) in order to give keyboard focus to the widget.
574 * Please note that editing can only happen when the widget is realized.
580 * One of the cell renderers of icon_view, or NULL
582 * TRUE if the specified cell should start being edited.
585 public void setCursor(TreePath path
, CellRenderer cell
, int startEditing
)
587 // void gtk_icon_view_set_cursor (GtkIconView *icon_view, GtkTreePath *path, GtkCellRenderer *cell, gboolean start_editing);
588 gtk_icon_view_set_cursor(gtkIconView
, (path
is null) ?
null : path
.getTreePathStruct(), (cell
is null) ?
null : cell
.getCellRendererStruct(), startEditing
);
592 * Fills in path and cell with the current cursor path and cell.
593 * If the cursor isn't currently set, then *path will be NULL.
594 * If no cell currently has focus, then *cell will be NULL.
595 * The returned GtkTreePath must be freed with gtk_tree_path_free().
599 * Return location for the current cursor path, or NULL
601 * Return location the current focus cell, or NULL
603 * TRUE if the cursor is set.
606 public int getCursor(GtkTreePath
** path
, GtkCellRenderer
** cell
)
608 // gboolean gtk_icon_view_get_cursor (GtkIconView *icon_view, GtkTreePath **path, GtkCellRenderer **cell);
609 return gtk_icon_view_get_cursor(gtkIconView
, path
, cell
);
613 * Calls a function for each selected icon. Note that the model or
614 * selection cannot be modified from within this function.
618 * The funcion to call for each selected icon.
620 * User data to pass to the function.
623 public void selectedForeach(GtkIconViewForeachFunc func
, void* data
)
625 // void gtk_icon_view_selected_foreach (GtkIconView *icon_view, GtkIconViewForeachFunc func, gpointer data);
626 gtk_icon_view_selected_foreach(gtkIconView
, func
, data
);
630 * Sets the selection mode of the icon_view.
637 public void setSelectionMode(GtkSelectionMode mode
)
639 // void gtk_icon_view_set_selection_mode (GtkIconView *icon_view, GtkSelectionMode mode);
640 gtk_icon_view_set_selection_mode(gtkIconView
, mode
);
644 * Gets the selection mode of the icon_view.
648 * the current selection mode
651 public GtkSelectionMode
getSelectionMode()
653 // GtkSelectionMode gtk_icon_view_get_selection_mode (GtkIconView *icon_view);
654 return gtk_icon_view_get_selection_mode(gtkIconView
);
658 * Sets the ::orientation property which determines whether the labels
659 * are drawn beside the icons instead of below.
663 * the relative position of texts and icons
666 public void setOrientation(GtkOrientation orientation
)
668 // void gtk_icon_view_set_orientation (GtkIconView *icon_view, GtkOrientation orientation);
669 gtk_icon_view_set_orientation(gtkIconView
, orientation
);
673 * Returns the value of the ::orientation property which determines
674 * whether the labels are drawn beside the icons instead of below.
678 * the relative position of texts and icons
681 public GtkOrientation
getOrientation()
683 // GtkOrientation gtk_icon_view_get_orientation (GtkIconView *icon_view);
684 return gtk_icon_view_get_orientation(gtkIconView
);
688 * Sets the ::columns property which determines in how
689 * many columns the icons are arranged. If columns is
690 * -1, the number of columns will be chosen automatically
691 * to fill the available area.
695 * the number of columns
698 public void setColumns(int columns
)
700 // void gtk_icon_view_set_columns (GtkIconView *icon_view, gint columns);
701 gtk_icon_view_set_columns(gtkIconView
, columns
);
705 * Returns the value of the ::columns property.
709 * the number of columns, or -1
712 public int getColumns()
714 // gint gtk_icon_view_get_columns (GtkIconView *icon_view);
715 return gtk_icon_view_get_columns(gtkIconView
);
719 * Sets the ::item-width property which specifies the width
720 * to use for each item. If it is set to -1, the icon view will
721 * automatically determine a suitable item size.
725 * the width for each item
728 public void setItemWidth(int itemWidth
)
730 // void gtk_icon_view_set_item_width (GtkIconView *icon_view, gint item_width);
731 gtk_icon_view_set_item_width(gtkIconView
, itemWidth
);
735 * Returns the value of the ::item-width property.
739 * the width of a single item, or -1
742 public int getItemWidth()
744 // gint gtk_icon_view_get_item_width (GtkIconView *icon_view);
745 return gtk_icon_view_get_item_width(gtkIconView
);
749 * Sets the ::spacing property which specifies the space
750 * which is inserted between the cells (i.e. the icon and
751 * the text) of an item.
758 public void setSpacing(int spacing
)
760 // void gtk_icon_view_set_spacing (GtkIconView *icon_view, gint spacing);
761 gtk_icon_view_set_spacing(gtkIconView
, spacing
);
765 * Returns the value of the ::spacing property.
769 * the space between cells
772 public int getSpacing()
774 // gint gtk_icon_view_get_spacing (GtkIconView *icon_view);
775 return gtk_icon_view_get_spacing(gtkIconView
);
779 * Sets the ::row-spacing property which specifies the space
780 * which is inserted between the rows of the icon view.
787 public void setRowSpacing(int rowSpacing
)
789 // void gtk_icon_view_set_row_spacing (GtkIconView *icon_view, gint row_spacing);
790 gtk_icon_view_set_row_spacing(gtkIconView
, rowSpacing
);
794 * Returns the value of the ::row-spacing property.
798 * the space between rows
801 public int getRowSpacing()
803 // gint gtk_icon_view_get_row_spacing (GtkIconView *icon_view);
804 return gtk_icon_view_get_row_spacing(gtkIconView
);
808 * Sets the ::column-spacing property which specifies the space
809 * which is inserted between the columns of the icon view.
816 public void setColumnSpacing(int columnSpacing
)
818 // void gtk_icon_view_set_column_spacing (GtkIconView *icon_view, gint column_spacing);
819 gtk_icon_view_set_column_spacing(gtkIconView
, columnSpacing
);
823 * Returns the value of the ::column-spacing property.
827 * the space between columns
830 public int getColumnSpacing()
832 // gint gtk_icon_view_get_column_spacing (GtkIconView *icon_view);
833 return gtk_icon_view_get_column_spacing(gtkIconView
);
837 * Sets the ::margin property which specifies the space
838 * which is inserted at the top, bottom, left and right
846 public void setMargin(int margin
)
848 // void gtk_icon_view_set_margin (GtkIconView *icon_view, gint margin);
849 gtk_icon_view_set_margin(gtkIconView
, margin
);
853 * Returns the value of the ::margin property.
857 * the space at the borders
860 public int getMargin()
862 // gint gtk_icon_view_get_margin (GtkIconView *icon_view);
863 return gtk_icon_view_get_margin(gtkIconView
);
867 * Selects the row at path.
871 * The GtkTreePath to be selected.
874 public void selectPath(TreePath path
)
876 // void gtk_icon_view_select_path (GtkIconView *icon_view, GtkTreePath *path);
877 gtk_icon_view_select_path(gtkIconView
, (path
is null) ?
null : path
.getTreePathStruct());
881 * Unselects the row at path.
885 * The GtkTreePath to be unselected.
888 public void unselectPath(TreePath path
)
890 // void gtk_icon_view_unselect_path (GtkIconView *icon_view, GtkTreePath *path);
891 gtk_icon_view_unselect_path(gtkIconView
, (path
is null) ?
null : path
.getTreePathStruct());
895 * Returns TRUE if the icon pointed to by path is currently
896 * selected. If icon does not point to a valid location, FALSE is returned.
900 * A GtkTreePath to check selection on.
902 * TRUE if path is selected.
905 public int pathIsSelected(TreePath path
)
907 // gboolean gtk_icon_view_path_is_selected (GtkIconView *icon_view, GtkTreePath *path);
908 return gtk_icon_view_path_is_selected(gtkIconView
, (path
is null) ?
null : path
.getTreePathStruct());
912 * Creates a list of paths of all selected items. Additionally, if you are
913 * planning on modifying the model after calling this function, you may
914 * want to convert the returned list into a list of GtkTreeRowReferences.
915 * To do this, you can use gtk_tree_row_reference_new().
916 * To free the return value, use:
917 * g_list_foreach (list, gtk_tree_path_free, NULL);
918 * g_list_free (list);
922 * A GList containing a GtkTreePath for each selected row.
925 public ListG
getSelectedItems()
927 // GList* gtk_icon_view_get_selected_items (GtkIconView *icon_view);
928 return new ListG( gtk_icon_view_get_selected_items(gtkIconView
) );
932 * Selects all the icons. icon_view must has its selection mode set
933 * to GTK_SELECTION_MULTIPLE.
938 public void selectAll()
940 // void gtk_icon_view_select_all (GtkIconView *icon_view);
941 gtk_icon_view_select_all(gtkIconView
);
945 * Unselects all the icons.
950 public void unselectAll()
952 // void gtk_icon_view_unselect_all (GtkIconView *icon_view);
953 gtk_icon_view_unselect_all(gtkIconView
);
957 * Activates the item determined by path.
961 * The GtkTreePath to be activated
964 public void itemActivated(TreePath path
)
966 // void gtk_icon_view_item_activated (GtkIconView *icon_view, GtkTreePath *path);
967 gtk_icon_view_item_activated(gtkIconView
, (path
is null) ?
null : path
.getTreePathStruct());
971 * Moves the alignments of icon_view to the position specified by path.
972 * row_align determines where the row is placed, and col_align determines
973 * where column is placed. Both are expected to be between 0.0 and 1.0.
974 * 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means
976 * If use_align is FALSE, then the alignment arguments are ignored, and the
977 * tree does the minimum amount of work to scroll the item onto the screen.
978 * This means that the item will be scrolled to the edge closest to its current
979 * position. If the item is currently visible on the screen, nothing is done.
980 * This function only works if the model is set, and path is a valid row on
981 * the model. If the model changes before the icon_view is realized, the
982 * centered path will be modified to reflect this change.
986 * The path of the item to move to.
988 * whether to use alignment arguments, or FALSE.
990 * The vertical alignment of the item specified by path.
992 * The horizontal alignment of the item specified by path.
995 public void scrollToPath(TreePath path
, int useAlign
, float rowAlign
, float colAlign
)
997 // void gtk_icon_view_scroll_to_path (GtkIconView *icon_view, GtkTreePath *path, gboolean use_align, gfloat row_align, gfloat col_align);
998 gtk_icon_view_scroll_to_path(gtkIconView
, (path
is null) ?
null : path
.getTreePathStruct(), useAlign
, rowAlign
, colAlign
);
1002 * Sets start_path and end_path to be the first and last visible path.
1003 * Note that there may be invisible paths in between.
1004 * Both paths should be freed with gtk_tree_path_free() after use.
1008 * Return location for start of region, or NULL
1010 * Return location for end of region, or NULL
1012 * TRUE, if valid paths were placed in start_path and end_path
1015 public int getVisibleRange(GtkTreePath
** startPath
, GtkTreePath
** endPath
)
1017 // gboolean gtk_icon_view_get_visible_range (GtkIconView *icon_view, GtkTreePath **start_path, GtkTreePath **end_path);
1018 return gtk_icon_view_get_visible_range(gtkIconView
, startPath
, endPath
);
1023 * Turns icon_view into a drag source for automatic DND.
1026 * start_button_mask:
1027 * Mask of allowed buttons to start drag
1029 * the table of targets that the drag will support
1031 * the number of items in targets
1033 * the bitmask of possible actions for a drag from this
1037 public void enableModelDragSource(GdkModifierType startButtonMask
, GtkTargetEntry
* targets
, int nTargets
, GdkDragAction actions
)
1039 // void gtk_icon_view_enable_model_drag_source (GtkIconView *icon_view, GdkModifierType start_button_mask, const GtkTargetEntry *targets, gint n_targets, GdkDragAction actions);
1040 gtk_icon_view_enable_model_drag_source(gtkIconView
, startButtonMask
, targets
, nTargets
, actions
);
1044 * Turns icon_view into a drop destination for automatic DND.
1048 * the table of targets that the drag will support
1050 * the number of items in targets
1052 * the bitmask of possible actions for a drag to this
1056 public void enableModelDragDest(GtkTargetEntry
* targets
, int nTargets
, GdkDragAction actions
)
1058 // void gtk_icon_view_enable_model_drag_dest (GtkIconView *icon_view, const GtkTargetEntry *targets, gint n_targets, GdkDragAction actions);
1059 gtk_icon_view_enable_model_drag_dest(gtkIconView
, targets
, nTargets
, actions
);
1063 * Undoes the effect of gtk_icon_view_enable_model_drag_source().
1068 public void unsetModelDragSource()
1070 // void gtk_icon_view_unset_model_drag_source (GtkIconView *icon_view);
1071 gtk_icon_view_unset_model_drag_source(gtkIconView
);
1075 * Undoes the effect of gtk_icon_view_enable_model_drag_dest().
1080 public void unsetModelDragDest()
1082 // void gtk_icon_view_unset_model_drag_dest (GtkIconView *icon_view);
1083 gtk_icon_view_unset_model_drag_dest(gtkIconView
);
1087 * This function is a convenience function to allow you to reorder models that
1088 * support the GtkTreeDragSourceIface and the GtkTreeDragDestIface. Both
1089 * GtkTreeStore and GtkListStore support these. If reorderable is TRUE, then
1090 * the user can reorder the model by dragging and dropping rows. The
1091 * developer can listen to these changes by connecting to the model's
1092 * row_inserted and row_deleted signals.
1093 * This function does not give you any degree of control over the order -- any
1094 * reordering is allowed. If more control is needed, you should probably
1095 * handle drag and drop manually.
1099 * TRUE, if the list of items can be reordered.
1102 public void setReorderable(int reorderable
)
1104 // void gtk_icon_view_set_reorderable (GtkIconView *icon_view, gboolean reorderable);
1105 gtk_icon_view_set_reorderable(gtkIconView
, reorderable
);
1109 * Retrieves whether the user can reorder the list via drag-and-drop.
1110 * See gtk_icon_view_set_reorderable().
1114 * TRUE if the list can be reordered.
1117 public int getReorderable()
1119 // gboolean gtk_icon_view_get_reorderable (GtkIconView *icon_view);
1120 return gtk_icon_view_get_reorderable(gtkIconView
);
1124 * Sets the item that is highlighted for feedback.
1128 * The path of the item to highlight, or NULL.
1130 * Specifies where to drop, relative to the item
1133 public void setDragDestItem(TreePath path
, GtkIconViewDropPosition pos
)
1135 // void gtk_icon_view_set_drag_dest_item (GtkIconView *icon_view, GtkTreePath *path, GtkIconViewDropPosition pos);
1136 gtk_icon_view_set_drag_dest_item(gtkIconView
, (path
is null) ?
null : path
.getTreePathStruct(), pos
);
1140 * Gets information about the item that is highlighted for feedback.
1144 * Return location for the path of the highlighted item, or NULL.
1146 * Return location for the drop position, or NULL
1149 public void getDragDestItem(GtkTreePath
** path
, GtkIconViewDropPosition
* pos
)
1151 // void gtk_icon_view_get_drag_dest_item (GtkIconView *icon_view, GtkTreePath **path, GtkIconViewDropPosition *pos);
1152 gtk_icon_view_get_drag_dest_item(gtkIconView
, path
, pos
);
1156 * Determines the destination item for a given position.
1160 * the position to determine the destination item for
1162 * the position to determine the destination item for
1164 * Return location for the path of the item, or NULL.
1166 * Return location for the drop position, or NULL
1168 * whether there is an item at the given position.
1171 public int getDestItemAtPos(int dragX
, int dragY
, GtkTreePath
** path
, GtkIconViewDropPosition
* pos
)
1173 // gboolean gtk_icon_view_get_dest_item_at_pos (GtkIconView *icon_view, gint drag_x, gint drag_y, GtkTreePath **path, GtkIconViewDropPosition *pos);
1174 return gtk_icon_view_get_dest_item_at_pos(gtkIconView
, dragX
, dragY
, path
, pos
);
1178 * Creates a GdkPixmap representation of the item at path.
1179 * This image is used for a drag icon.
1183 * a GtkTreePath in icon_view
1185 * a newly-allocated pixmap of the drag icon.
1188 * The "column-spacing" property
1189 * "column-spacing" gint : Read / Write
1190 * The column-spacing property specifies the space which is inserted between
1191 * the columns of the icon view.
1192 * Allowed values: >= 0
1196 public Pixmap
createDragIcon(TreePath path
)
1198 // GdkPixmap* gtk_icon_view_create_drag_icon (GtkIconView *icon_view, GtkTreePath *path);
1199 return new Pixmap( gtk_icon_view_create_drag_icon(gtkIconView
, (path
is null) ?
null : path
.getTreePathStruct()) );