alternative to assert
[gtkD.git] / src / gtk / IconView.d
blobb7a1b6938ecc12e2625096983a208596ef64ac1e
1 /*
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
26 * outPack = gtk
27 * outFile = IconView
28 * strct = GtkIconView
29 * realStrct=
30 * ctorStrct=
31 * clss = IconView
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - gtk_icon_view_
40 * - gtk_
41 * omit structs:
42 * omit prefixes:
43 * omit code:
44 * imports:
45 * - gtk.TreeModel
46 * - gtk.TreePath
47 * - gtk.CellRenderer
48 * - glib.ListG
49 * - gdk.Pixmap
50 * structWrap:
51 * - GList* -> ListG
52 * - GdkPixmap* -> Pixmap
53 * - GtkCellRenderer* -> CellRenderer
54 * - GtkTreeModel* -> TreeModel
55 * - GtkTreePath* -> TreePath
56 * local aliases:
59 module gtk.IconView;
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;
71 /**
72 * Description
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()
90 return gtkIconView;
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) )
122 Signals.connectData(
123 getStruct(),
124 "activate-cursor-item",
125 cast(GCallback)&callBackActivateCursorItem,
126 this,
127 null,
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 )
139 dlg(iconView);
142 return consumed;
145 void delegate(TreePath, IconView)[] onItemActivatedListeners;
146 void addOnItemActivated(void delegate(TreePath, IconView) dlg)
148 if ( !("item-activated" in connectedSignals) )
150 Signals.connectData(
151 getStruct(),
152 "item-activated",
153 cast(GCallback)&callBackItemActivated,
154 this,
155 null,
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);
170 return consumed;
173 gboolean delegate(GtkMovementStep, gint, IconView)[] onMoveCursorListeners;
174 void addOnMoveCursor(gboolean delegate(GtkMovementStep, gint, IconView) dlg)
176 if ( !("move-cursor" in connectedSignals) )
178 Signals.connectData(
179 getStruct(),
180 "move-cursor",
181 cast(GCallback)&callBackMoveCursor,
182 this,
183 null,
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);
198 return consumed;
201 void delegate(IconView)[] onSelectAllListeners;
202 void addOnSelectAll(void delegate(IconView) dlg)
204 if ( !("select-all" in connectedSignals) )
206 Signals.connectData(
207 getStruct(),
208 "select-all",
209 cast(GCallback)&callBackSelectAll,
210 this,
211 null,
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 )
223 dlg(iconView);
226 return consumed;
229 void delegate(IconView)[] onSelectCursorItemListeners;
230 void addOnSelectCursorItem(void delegate(IconView) dlg)
232 if ( !("select-cursor-item" in connectedSignals) )
234 Signals.connectData(
235 getStruct(),
236 "select-cursor-item",
237 cast(GCallback)&callBackSelectCursorItem,
238 this,
239 null,
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 )
251 dlg(iconView);
254 return consumed;
257 void delegate(IconView)[] onSelectionChangedListeners;
258 void addOnSelectionChanged(void delegate(IconView) dlg)
260 if ( !("selection-changed" in connectedSignals) )
262 Signals.connectData(
263 getStruct(),
264 "selection-changed",
265 cast(GCallback)&callBackSelectionChanged,
266 this,
267 null,
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 )
279 dlg(iconView);
282 return consumed;
285 void delegate(GtkAdjustment*, GtkAdjustment*, IconView)[] onSetScrollAdjustmentsListeners;
286 void addOnSetScrollAdjustments(void delegate(GtkAdjustment*, GtkAdjustment*, IconView) dlg)
288 if ( !("set-scroll-adjustments" in connectedSignals) )
290 Signals.connectData(
291 getStruct(),
292 "set-scroll-adjustments",
293 cast(GCallback)&callBackSetScrollAdjustments,
294 this,
295 null,
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);
310 return consumed;
313 void delegate(IconView)[] onToggleCursorItemListeners;
314 void addOnToggleCursorItem(void delegate(IconView) dlg)
316 if ( !("toggle-cursor-item" in connectedSignals) )
318 Signals.connectData(
319 getStruct(),
320 "toggle-cursor-item",
321 cast(GCallback)&callBackToggleCursorItem,
322 this,
323 null,
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 )
335 dlg(iconView);
338 return consumed;
341 void delegate(IconView)[] onUnselectAllListeners;
342 void addOnUnselectAll(void delegate(IconView) dlg)
344 if ( !("unselect-all" in connectedSignals) )
346 Signals.connectData(
347 getStruct(),
348 "unselect-all",
349 cast(GCallback)&callBackUnselectAll,
350 this,
351 null,
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 )
363 dlg(iconView);
366 return consumed;
373 * Creates a new GtkIconView widget
374 * Returns:
375 * A newly created GtkIconView widget
376 * Since 2.6
378 public this ()
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.
386 * model:
387 * The model.
388 * Returns:
389 * A newly created GtkIconView widget.
390 * Since 2.6
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.
403 * icon_view:
404 * A GtkIconView.
405 * model:
406 * The model.
407 * Since 2.6
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
417 * model is unset.
418 * icon_view:
419 * a GtkIconView
420 * Returns:
421 * A GtkTreeModel, or NULL if none is currently being used.
422 * Since 2.6
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.
433 * icon_view:
434 * A GtkIconView.
435 * column:
436 * A column in the currently used model.
437 * Since 2.6
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.
447 * icon_view:
448 * A GtkIconView.
449 * Returns:
450 * the text column, or -1 if it's unset.
451 * Since 2.6
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().
464 * icon_view:
465 * A GtkIconView.
466 * column:
467 * A column in the currently used model.
468 * Since 2.6
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.
478 * icon_view:
479 * A GtkIconView.
480 * Returns:
481 * the markup column, or -1 if it's unset.
482 * Since 2.6
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
493 * icon_view:
494 * A GtkIconView.
495 * column:
496 * A column in the currently used model.
497 * Since 2.6
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.
507 * icon_view:
508 * A GtkIconView.
509 * Returns:
510 * the pixbuf column, or -1 if it's unset.
511 * Since 2.6
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.
523 * icon_view:
524 * A GtkIconView.
525 * x:
526 * The x position to be identified
527 * y:
528 * The y position to be identified
529 * Returns:
530 * The GtkTreePath corresponding to the icon or NULL
531 * if no icon exists at that position.
532 * Since 2.6
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().
545 * icon_view:
546 * A GtkIconView.
547 * x:
548 * The x position to be identified
549 * y:
550 * The y position to be identified
551 * path:
552 * Return location for the path, or NULL
553 * cell:
554 * Return location for the renderer responsible for the cell
555 * at (x, y), or NULL
556 * Returns:
557 * TRUE if an item exists at the specified position
558 * Since 2.8
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.
575 * icon_view:
576 * A GtkIconView
577 * path:
578 * A GtkTreePath
579 * cell:
580 * One of the cell renderers of icon_view, or NULL
581 * start_editing:
582 * TRUE if the specified cell should start being edited.
583 * Since 2.8
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().
596 * icon_view:
597 * A GtkIconView
598 * path:
599 * Return location for the current cursor path, or NULL
600 * cell:
601 * Return location the current focus cell, or NULL
602 * Returns:
603 * TRUE if the cursor is set.
604 * Since 2.8
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.
615 * icon_view:
616 * A GtkIconView.
617 * func:
618 * The funcion to call for each selected icon.
619 * data:
620 * User data to pass to the function.
621 * Since 2.6
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.
631 * icon_view:
632 * A GtkIconView.
633 * mode:
634 * The selection mode
635 * Since 2.6
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.
645 * icon_view:
646 * A GtkIconView.
647 * Returns:
648 * the current selection mode
649 * Since 2.6
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.
660 * icon_view:
661 * a GtkIconView
662 * orientation:
663 * the relative position of texts and icons
664 * Since 2.6
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.
675 * icon_view:
676 * a GtkIconView
677 * Returns:
678 * the relative position of texts and icons
679 * Since 2.6
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.
692 * icon_view:
693 * a GtkIconView
694 * columns:
695 * the number of columns
696 * Since 2.6
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.
706 * icon_view:
707 * a GtkIconView
708 * Returns:
709 * the number of columns, or -1
710 * Since 2.6
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.
722 * icon_view:
723 * a GtkIconView
724 * item_width:
725 * the width for each item
726 * Since 2.6
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.
736 * icon_view:
737 * a GtkIconView
738 * Returns:
739 * the width of a single item, or -1
740 * Since 2.6
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.
752 * icon_view:
753 * a GtkIconView
754 * spacing:
755 * the spacing
756 * Since 2.6
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.
766 * icon_view:
767 * a GtkIconView
768 * Returns:
769 * the space between cells
770 * Since 2.6
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.
781 * icon_view:
782 * a GtkIconView
783 * row_spacing:
784 * the row spacing
785 * Since 2.6
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.
795 * icon_view:
796 * a GtkIconView
797 * Returns:
798 * the space between rows
799 * Since 2.6
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.
810 * icon_view:
811 * a GtkIconView
812 * column_spacing:
813 * the column spacing
814 * Since 2.6
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.
824 * icon_view:
825 * a GtkIconView
826 * Returns:
827 * the space between columns
828 * Since 2.6
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
839 * of the icon view.
840 * icon_view:
841 * a GtkIconView
842 * margin:
843 * the margin
844 * Since 2.6
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.
854 * icon_view:
855 * a GtkIconView
856 * Returns:
857 * the space at the borders
858 * Since 2.6
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.
868 * icon_view:
869 * A GtkIconView.
870 * path:
871 * The GtkTreePath to be selected.
872 * Since 2.6
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.
882 * icon_view:
883 * A GtkIconView.
884 * path:
885 * The GtkTreePath to be unselected.
886 * Since 2.6
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.
897 * icon_view:
898 * A GtkIconView.
899 * path:
900 * A GtkTreePath to check selection on.
901 * Returns:
902 * TRUE if path is selected.
903 * Since 2.6
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);
919 * icon_view:
920 * A GtkIconView.
921 * Returns:
922 * A GList containing a GtkTreePath for each selected row.
923 * Since 2.6
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.
934 * icon_view:
935 * A GtkIconView.
936 * Since 2.6
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.
946 * icon_view:
947 * A GtkIconView.
948 * Since 2.6
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.
958 * icon_view:
959 * A GtkIconView
960 * path:
961 * The GtkTreePath to be activated
962 * Since 2.6
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
975 * center.
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.
983 * icon_view:
984 * A GtkIconView.
985 * path:
986 * The path of the item to move to.
987 * use_align:
988 * whether to use alignment arguments, or FALSE.
989 * row_align:
990 * The vertical alignment of the item specified by path.
991 * col_align:
992 * The horizontal alignment of the item specified by path.
993 * Since 2.8
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.
1005 * icon_view:
1006 * A GtkIconView
1007 * start_path:
1008 * Return location for start of region, or NULL
1009 * end_path:
1010 * Return location for end of region, or NULL
1011 * Returns:
1012 * TRUE, if valid paths were placed in start_path and end_path
1013 * Since 2.8
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.
1024 * icon_view:
1025 * a GtkIconTreeView
1026 * start_button_mask:
1027 * Mask of allowed buttons to start drag
1028 * targets:
1029 * the table of targets that the drag will support
1030 * n_targets:
1031 * the number of items in targets
1032 * actions:
1033 * the bitmask of possible actions for a drag from this
1034 * widget
1035 * Since 2.8
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.
1045 * icon_view:
1046 * a GtkIconView
1047 * targets:
1048 * the table of targets that the drag will support
1049 * n_targets:
1050 * the number of items in targets
1051 * actions:
1052 * the bitmask of possible actions for a drag to this
1053 * widget
1054 * Since 2.8
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().
1064 * icon_view:
1065 * a GtkIconView
1066 * Since 2.8
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().
1076 * icon_view:
1077 * a GtkIconView
1078 * Since 2.8
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.
1096 * icon_view:
1097 * A GtkIconView.
1098 * reorderable:
1099 * TRUE, if the list of items can be reordered.
1100 * Since 2.8
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().
1111 * icon_view:
1112 * a GtkIconView
1113 * Returns:
1114 * TRUE if the list can be reordered.
1115 * Since 2.8
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.
1125 * icon_view:
1126 * a GtkIconView
1127 * path:
1128 * The path of the item to highlight, or NULL.
1129 * pos:
1130 * Specifies where to drop, relative to the item
1131 * Since 2.8
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.
1141 * icon_view:
1142 * a GtkIconView
1143 * path:
1144 * Return location for the path of the highlighted item, or NULL.
1145 * pos:
1146 * Return location for the drop position, or NULL
1147 * Since 2.8
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.
1157 * icon_view:
1158 * a GtkIconView
1159 * drag_x:
1160 * the position to determine the destination item for
1161 * drag_y:
1162 * the position to determine the destination item for
1163 * path:
1164 * Return location for the path of the item, or NULL.
1165 * pos:
1166 * Return location for the drop position, or NULL
1167 * Returns:
1168 * whether there is an item at the given position.
1169 * Since 2.8
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.
1180 * icon_view:
1181 * a GtkIconView
1182 * path:
1183 * a GtkTreePath in icon_view
1184 * Returns:
1185 * a newly-allocated pixmap of the drag icon.
1186 * Since 2.8
1187 * Property Details
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
1193 * Default value: 6
1194 * Since 2.6
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()) );