1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.FlowBox;
26 
27 private import gio.ListModelIF;
28 private import glib.ConstructionException;
29 private import glib.ListG;
30 private import gobject.ObjectG;
31 private import gobject.Signals;
32 private import gtk.Adjustment;
33 private import gtk.Container;
34 private import gtk.FlowBoxChild;
35 private import gtk.OrientableIF;
36 private import gtk.OrientableT;
37 private import gtk.Widget;
38 public  import gtkc.gdktypes;
39 private import gtkc.gtk;
40 public  import gtkc.gtktypes;
41 
42 
43 /**
44  * A GtkFlowBox positions child widgets in sequence according to its
45  * orientation.
46  * 
47  * For instance, with the horizontal orientation, the widgets will be
48  * arranged from left to right, starting a new row under the previous
49  * row when necessary. Reducing the width in this case will require more
50  * rows, so a larger height will be requested.
51  * 
52  * Likewise, with the vertical orientation, the widgets will be arranged
53  * from top to bottom, starting a new column to the right when necessary.
54  * Reducing the height will require more columns, so a larger width will
55  * be requested.
56  * 
57  * The children of a GtkFlowBox can be dynamically sorted and filtered.
58  * 
59  * Although a GtkFlowBox must have only #GtkFlowBoxChild children,
60  * you can add any kind of widget to it via gtk_container_add(), and
61  * a GtkFlowBoxChild widget will automatically be inserted between
62  * the box and the widget.
63  * 
64  * Also see #GtkListBox.
65  * 
66  * GtkFlowBox was added in GTK+ 3.12.
67  * 
68  * # CSS nodes
69  * 
70  * |[<!-- language="plain" -->
71  * flowbox
72  * ├── flowboxchild
73  * │   ╰── <child>
74  * ├── flowboxchild
75  * │   ╰── <child>
76  * ┊
77  * ╰── [rubberband]
78  * ]|
79  * 
80  * GtkFlowBox uses a single CSS node with name flowbox. GtkFlowBoxChild
81  * uses a single CSS node with name flowboxchild.
82  * For rubberband selection, a subnode with name rubberband is used.
83  */
84 public class FlowBox : Container, OrientableIF
85 {
86 	/** the main Gtk struct */
87 	protected GtkFlowBox* gtkFlowBox;
88 
89 	/** Get the main Gtk struct */
90 	public GtkFlowBox* getFlowBoxStruct()
91 	{
92 		return gtkFlowBox;
93 	}
94 
95 	/** the main Gtk struct as a void* */
96 	protected override void* getStruct()
97 	{
98 		return cast(void*)gtkFlowBox;
99 	}
100 
101 	protected override void setStruct(GObject* obj)
102 	{
103 		gtkFlowBox = cast(GtkFlowBox*)obj;
104 		super.setStruct(obj);
105 	}
106 
107 	/**
108 	 * Sets our main struct and passes it to the parent class.
109 	 */
110 	public this (GtkFlowBox* gtkFlowBox, bool ownedRef = false)
111 	{
112 		this.gtkFlowBox = gtkFlowBox;
113 		super(cast(GtkContainer*)gtkFlowBox, ownedRef);
114 	}
115 
116 	// add the Orientable capabilities
117 	mixin OrientableT!(GtkFlowBox);
118 
119 
120 	/** */
121 	public static GType getType()
122 	{
123 		return gtk_flow_box_get_type();
124 	}
125 
126 	/**
127 	 * Creates a GtkFlowBox.
128 	 *
129 	 * Return: a new #GtkFlowBox container
130 	 *
131 	 * Since: 3.12
132 	 *
133 	 * Throws: ConstructionException GTK+ fails to create the object.
134 	 */
135 	public this()
136 	{
137 		auto p = gtk_flow_box_new();
138 		
139 		if(p is null)
140 		{
141 			throw new ConstructionException("null returned by new");
142 		}
143 		
144 		this(cast(GtkFlowBox*) p);
145 	}
146 
147 	/**
148 	 * Binds @model to @box.
149 	 *
150 	 * If @box was already bound to a model, that previous binding is
151 	 * destroyed.
152 	 *
153 	 * The contents of @box are cleared and then filled with widgets that
154 	 * represent items from @model. @box is updated whenever @model changes.
155 	 * If @model is %NULL, @box is left empty.
156 	 *
157 	 * It is undefined to add or remove widgets directly (for example, with
158 	 * gtk_flow_box_insert() or gtk_container_add()) while @box is bound to a
159 	 * model.
160 	 *
161 	 * Note that using a model is incompatible with the filtering and sorting
162 	 * functionality in GtkFlowBox. When using a model, filtering and sorting
163 	 * should be implemented by the model.
164 	 *
165 	 * Params:
166 	 *     model = the #GListModel to be bound to @box
167 	 *     createWidgetFunc = a function that creates widgets for items
168 	 *     userData = user data passed to @create_widget_func
169 	 *     userDataFreeFunc = function for freeing @user_data
170 	 *
171 	 * Since: 3.18
172 	 */
173 	public void bindModel(ListModelIF model, GtkFlowBoxCreateWidgetFunc createWidgetFunc, void* userData, GDestroyNotify userDataFreeFunc)
174 	{
175 		gtk_flow_box_bind_model(gtkFlowBox, (model is null) ? null : model.getListModelStruct(), createWidgetFunc, userData, userDataFreeFunc);
176 	}
177 
178 	/**
179 	 * Returns whether children activate on single clicks.
180 	 *
181 	 * Return: %TRUE if children are activated on single click,
182 	 *     %FALSE otherwise
183 	 *
184 	 * Since: 3.12
185 	 */
186 	public bool getActivateOnSingleClick()
187 	{
188 		return gtk_flow_box_get_activate_on_single_click(gtkFlowBox) != 0;
189 	}
190 
191 	/**
192 	 * Gets the nth child in the @box.
193 	 *
194 	 * Params:
195 	 *     idx = the position of the child
196 	 *
197 	 * Return: the child widget, which will
198 	 *     always be a #GtkFlowBoxChild or %NULL in case no child widget
199 	 *     with the given index exists.
200 	 *
201 	 * Since: 3.12
202 	 */
203 	public FlowBoxChild getChildAtIndex(int idx)
204 	{
205 		auto p = gtk_flow_box_get_child_at_index(gtkFlowBox, idx);
206 		
207 		if(p is null)
208 		{
209 			return null;
210 		}
211 		
212 		return ObjectG.getDObject!(FlowBoxChild)(cast(GtkFlowBoxChild*) p);
213 	}
214 
215 	/**
216 	 * Gets the horizontal spacing.
217 	 *
218 	 * Return: the horizontal spacing
219 	 *
220 	 * Since: 3.12
221 	 */
222 	public uint getColumnSpacing()
223 	{
224 		return gtk_flow_box_get_column_spacing(gtkFlowBox);
225 	}
226 
227 	/**
228 	 * Returns whether the box is homogeneous (all children are the
229 	 * same size). See gtk_box_set_homogeneous().
230 	 *
231 	 * Return: %TRUE if the box is homogeneous.
232 	 *
233 	 * Since: 3.12
234 	 */
235 	public bool getHomogeneous()
236 	{
237 		return gtk_flow_box_get_homogeneous(gtkFlowBox) != 0;
238 	}
239 
240 	/**
241 	 * Gets the maximum number of children per line.
242 	 *
243 	 * Return: the maximum number of children per line
244 	 *
245 	 * Since: 3.12
246 	 */
247 	public uint getMaxChildrenPerLine()
248 	{
249 		return gtk_flow_box_get_max_children_per_line(gtkFlowBox);
250 	}
251 
252 	/**
253 	 * Gets the minimum number of children per line.
254 	 *
255 	 * Return: the minimum number of children per line
256 	 *
257 	 * Since: 3.12
258 	 */
259 	public uint getMinChildrenPerLine()
260 	{
261 		return gtk_flow_box_get_min_children_per_line(gtkFlowBox);
262 	}
263 
264 	/**
265 	 * Gets the vertical spacing.
266 	 *
267 	 * Return: the vertical spacing
268 	 *
269 	 * Since: 3.12
270 	 */
271 	public uint getRowSpacing()
272 	{
273 		return gtk_flow_box_get_row_spacing(gtkFlowBox);
274 	}
275 
276 	/**
277 	 * Creates a list of all selected children.
278 	 *
279 	 * Return: A #GList containing the #GtkWidget for each selected child.
280 	 *     Free with g_list_free() when done.
281 	 *
282 	 * Since: 3.12
283 	 */
284 	public ListG getSelectedChildren()
285 	{
286 		auto p = gtk_flow_box_get_selected_children(gtkFlowBox);
287 		
288 		if(p is null)
289 		{
290 			return null;
291 		}
292 		
293 		return new ListG(cast(GList*) p);
294 	}
295 
296 	/**
297 	 * Gets the selection mode of @box.
298 	 *
299 	 * Return: the #GtkSelectionMode
300 	 *
301 	 * Since: 3.12
302 	 */
303 	public GtkSelectionMode getSelectionMode()
304 	{
305 		return gtk_flow_box_get_selection_mode(gtkFlowBox);
306 	}
307 
308 	/**
309 	 * Inserts the @widget into @box at @position.
310 	 *
311 	 * If a sort function is set, the widget will actually be inserted
312 	 * at the calculated position and this function has the same effect
313 	 * as gtk_container_add().
314 	 *
315 	 * If @position is -1, or larger than the total number of children
316 	 * in the @box, then the @widget will be appended to the end.
317 	 *
318 	 * Params:
319 	 *     widget = the #GtkWidget to add
320 	 *     position = the position to insert @child in
321 	 *
322 	 * Since: 3.12
323 	 */
324 	public void insert(Widget widget, int position)
325 	{
326 		gtk_flow_box_insert(gtkFlowBox, (widget is null) ? null : widget.getWidgetStruct(), position);
327 	}
328 
329 	/**
330 	 * Updates the filtering for all children.
331 	 *
332 	 * Call this function when the result of the filter
333 	 * function on the @box is changed due ot an external
334 	 * factor. For instance, this would be used if the
335 	 * filter function just looked for a specific search
336 	 * term, and the entry with the string has changed.
337 	 *
338 	 * Since: 3.12
339 	 */
340 	public void invalidateFilter()
341 	{
342 		gtk_flow_box_invalidate_filter(gtkFlowBox);
343 	}
344 
345 	/**
346 	 * Updates the sorting for all children.
347 	 *
348 	 * Call this when the result of the sort function on
349 	 * @box is changed due to an external factor.
350 	 *
351 	 * Since: 3.12
352 	 */
353 	public void invalidateSort()
354 	{
355 		gtk_flow_box_invalidate_sort(gtkFlowBox);
356 	}
357 
358 	/**
359 	 * Select all children of @box, if the selection
360 	 * mode allows it.
361 	 *
362 	 * Since: 3.12
363 	 */
364 	public void selectAll()
365 	{
366 		gtk_flow_box_select_all(gtkFlowBox);
367 	}
368 
369 	/**
370 	 * Selects a single child of @box, if the selection
371 	 * mode allows it.
372 	 *
373 	 * Params:
374 	 *     child = a child of @box
375 	 *
376 	 * Since: 3.12
377 	 */
378 	public void selectChild(FlowBoxChild child)
379 	{
380 		gtk_flow_box_select_child(gtkFlowBox, (child is null) ? null : child.getFlowBoxChildStruct());
381 	}
382 
383 	/**
384 	 * Calls a function for each selected child.
385 	 *
386 	 * Note that the selection cannot be modified from within
387 	 * this function.
388 	 *
389 	 * Params:
390 	 *     func = the function to call for each selected child
391 	 *     data = user data to pass to the function
392 	 *
393 	 * Since: 3.12
394 	 */
395 	public void selectedForeach(GtkFlowBoxForeachFunc func, void* data)
396 	{
397 		gtk_flow_box_selected_foreach(gtkFlowBox, func, data);
398 	}
399 
400 	/**
401 	 * If @single is %TRUE, children will be activated when you click
402 	 * on them, otherwise you need to double-click.
403 	 *
404 	 * Params:
405 	 *     single = %TRUE to emit child-activated on a single click
406 	 *
407 	 * Since: 3.12
408 	 */
409 	public void setActivateOnSingleClick(bool single)
410 	{
411 		gtk_flow_box_set_activate_on_single_click(gtkFlowBox, single);
412 	}
413 
414 	/**
415 	 * Sets the horizontal space to add between children.
416 	 * See the #GtkFlowBox:column-spacing property.
417 	 *
418 	 * Params:
419 	 *     spacing = the spacing to use
420 	 *
421 	 * Since: 3.12
422 	 */
423 	public void setColumnSpacing(uint spacing)
424 	{
425 		gtk_flow_box_set_column_spacing(gtkFlowBox, spacing);
426 	}
427 
428 	/**
429 	 * By setting a filter function on the @box one can decide dynamically
430 	 * which of the children to show. For instance, to implement a search
431 	 * function that only shows the children matching the search terms.
432 	 *
433 	 * The @filter_func will be called for each child after the call, and
434 	 * it will continue to be called each time a child changes (via
435 	 * gtk_flow_box_child_changed()) or when gtk_flow_box_invalidate_filter()
436 	 * is called.
437 	 *
438 	 * Note that using a filter function is incompatible with using a model
439 	 * (see gtk_flow_box_bind_model()).
440 	 *
441 	 * Params:
442 	 *     filterFunc = callback that
443 	 *         lets you filter which children to show
444 	 *     userData = user data passed to @filter_func
445 	 *     destroy = destroy notifier for @user_data
446 	 *
447 	 * Since: 3.12
448 	 */
449 	public void setFilterFunc(GtkFlowBoxFilterFunc filterFunc, void* userData, GDestroyNotify destroy)
450 	{
451 		gtk_flow_box_set_filter_func(gtkFlowBox, filterFunc, userData, destroy);
452 	}
453 
454 	/**
455 	 * Hooks up an adjustment to focus handling in @box.
456 	 * The adjustment is also used for autoscrolling during
457 	 * rubberband selection. See gtk_scrolled_window_get_hadjustment()
458 	 * for a typical way of obtaining the adjustment, and
459 	 * gtk_flow_box_set_vadjustment()for setting the vertical
460 	 * adjustment.
461 	 *
462 	 * The adjustments have to be in pixel units and in the same
463 	 * coordinate system as the allocation for immediate children
464 	 * of the box.
465 	 *
466 	 * Params:
467 	 *     adjustment = an adjustment which should be adjusted
468 	 *         when the focus is moved among the descendents of @container
469 	 *
470 	 * Since: 3.12
471 	 */
472 	public void setHadjustment(Adjustment adjustment)
473 	{
474 		gtk_flow_box_set_hadjustment(gtkFlowBox, (adjustment is null) ? null : adjustment.getAdjustmentStruct());
475 	}
476 
477 	/**
478 	 * Sets the #GtkFlowBox:homogeneous property of @box, controlling
479 	 * whether or not all children of @box are given equal space
480 	 * in the box.
481 	 *
482 	 * Params:
483 	 *     homogeneous = %TRUE to create equal allotments,
484 	 *         %FALSE for variable allotments
485 	 *
486 	 * Since: 3.12
487 	 */
488 	public void setHomogeneous(bool homogeneous)
489 	{
490 		gtk_flow_box_set_homogeneous(gtkFlowBox, homogeneous);
491 	}
492 
493 	/**
494 	 * Sets the maximum number of children to request and
495 	 * allocate space for in @box’s orientation.
496 	 *
497 	 * Setting the maximum number of children per line
498 	 * limits the overall natural size request to be no more
499 	 * than @n_children children long in the given orientation.
500 	 *
501 	 * Params:
502 	 *     nChildren = the maximum number of children per line
503 	 *
504 	 * Since: 3.12
505 	 */
506 	public void setMaxChildrenPerLine(uint nChildren)
507 	{
508 		gtk_flow_box_set_max_children_per_line(gtkFlowBox, nChildren);
509 	}
510 
511 	/**
512 	 * Sets the minimum number of children to line up
513 	 * in @box’s orientation before flowing.
514 	 *
515 	 * Params:
516 	 *     nChildren = the minimum number of children per line
517 	 *
518 	 * Since: 3.12
519 	 */
520 	public void setMinChildrenPerLine(uint nChildren)
521 	{
522 		gtk_flow_box_set_min_children_per_line(gtkFlowBox, nChildren);
523 	}
524 
525 	/**
526 	 * Sets the vertical space to add between children.
527 	 * See the #GtkFlowBox:row-spacing property.
528 	 *
529 	 * Params:
530 	 *     spacing = the spacing to use
531 	 *
532 	 * Since: 3.12
533 	 */
534 	public void setRowSpacing(uint spacing)
535 	{
536 		gtk_flow_box_set_row_spacing(gtkFlowBox, spacing);
537 	}
538 
539 	/**
540 	 * Sets how selection works in @box.
541 	 * See #GtkSelectionMode for details.
542 	 *
543 	 * Params:
544 	 *     mode = the new selection mode
545 	 *
546 	 * Since: 3.12
547 	 */
548 	public void setSelectionMode(GtkSelectionMode mode)
549 	{
550 		gtk_flow_box_set_selection_mode(gtkFlowBox, mode);
551 	}
552 
553 	/**
554 	 * By setting a sort function on the @box, one can dynamically
555 	 * reorder the children of the box, based on the contents of
556 	 * the children.
557 	 *
558 	 * The @sort_func will be called for each child after the call,
559 	 * and will continue to be called each time a child changes (via
560 	 * gtk_flow_box_child_changed()) and when gtk_flow_box_invalidate_sort()
561 	 * is called.
562 	 *
563 	 * Note that using a sort function is incompatible with using a model
564 	 * (see gtk_flow_box_bind_model()).
565 	 *
566 	 * Params:
567 	 *     sortFunc = the sort function
568 	 *     userData = user data passed to @sort_func
569 	 *     destroy = destroy notifier for @user_data
570 	 *
571 	 * Since: 3.12
572 	 */
573 	public void setSortFunc(GtkFlowBoxSortFunc sortFunc, void* userData, GDestroyNotify destroy)
574 	{
575 		gtk_flow_box_set_sort_func(gtkFlowBox, sortFunc, userData, destroy);
576 	}
577 
578 	/**
579 	 * Hooks up an adjustment to focus handling in @box.
580 	 * The adjustment is also used for autoscrolling during
581 	 * rubberband selection. See gtk_scrolled_window_get_vadjustment()
582 	 * for a typical way of obtaining the adjustment, and
583 	 * gtk_flow_box_set_hadjustment()for setting the horizontal
584 	 * adjustment.
585 	 *
586 	 * The adjustments have to be in pixel units and in the same
587 	 * coordinate system as the allocation for immediate children
588 	 * of the box.
589 	 *
590 	 * Params:
591 	 *     adjustment = an adjustment which should be adjusted
592 	 *         when the focus is moved among the descendents of @container
593 	 *
594 	 * Since: 3.12
595 	 */
596 	public void setVadjustment(Adjustment adjustment)
597 	{
598 		gtk_flow_box_set_vadjustment(gtkFlowBox, (adjustment is null) ? null : adjustment.getAdjustmentStruct());
599 	}
600 
601 	/**
602 	 * Unselect all children of @box, if the selection
603 	 * mode allows it.
604 	 *
605 	 * Since: 3.12
606 	 */
607 	public void unselectAll()
608 	{
609 		gtk_flow_box_unselect_all(gtkFlowBox);
610 	}
611 
612 	/**
613 	 * Unselects a single child of @box, if the selection
614 	 * mode allows it.
615 	 *
616 	 * Params:
617 	 *     child = a child of @box
618 	 *
619 	 * Since: 3.12
620 	 */
621 	public void unselectChild(FlowBoxChild child)
622 	{
623 		gtk_flow_box_unselect_child(gtkFlowBox, (child is null) ? null : child.getFlowBoxChildStruct());
624 	}
625 
626 	int[string] connectedSignals;
627 
628 	void delegate(FlowBox)[] onActivateCursorChildListeners;
629 	/**
630 	 * The ::activate-cursor-child signal is a
631 	 * [keybinding signal][GtkBindingSignal]
632 	 * which gets emitted when the user activates the @box.
633 	 */
634 	void addOnActivateCursorChild(void delegate(FlowBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
635 	{
636 		if ( "activate-cursor-child" !in connectedSignals )
637 		{
638 			Signals.connectData(
639 				this,
640 				"activate-cursor-child",
641 				cast(GCallback)&callBackActivateCursorChild,
642 				cast(void*)this,
643 				null,
644 				connectFlags);
645 			connectedSignals["activate-cursor-child"] = 1;
646 		}
647 		onActivateCursorChildListeners ~= dlg;
648 	}
649 	extern(C) static void callBackActivateCursorChild(GtkFlowBox* flowboxStruct, FlowBox _flowbox)
650 	{
651 		foreach ( void delegate(FlowBox) dlg; _flowbox.onActivateCursorChildListeners )
652 		{
653 			dlg(_flowbox);
654 		}
655 	}
656 
657 	void delegate(FlowBoxChild, FlowBox)[] onChildActivatedListeners;
658 	/**
659 	 * The ::child-activated signal is emitted when a child has been
660 	 * activated by the user.
661 	 *
662 	 * Params:
663 	 *     child = the child that is activated
664 	 */
665 	void addOnChildActivated(void delegate(FlowBoxChild, FlowBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
666 	{
667 		if ( "child-activated" !in connectedSignals )
668 		{
669 			Signals.connectData(
670 				this,
671 				"child-activated",
672 				cast(GCallback)&callBackChildActivated,
673 				cast(void*)this,
674 				null,
675 				connectFlags);
676 			connectedSignals["child-activated"] = 1;
677 		}
678 		onChildActivatedListeners ~= dlg;
679 	}
680 	extern(C) static void callBackChildActivated(GtkFlowBox* flowboxStruct, GtkFlowBoxChild* child, FlowBox _flowbox)
681 	{
682 		foreach ( void delegate(FlowBoxChild, FlowBox) dlg; _flowbox.onChildActivatedListeners )
683 		{
684 			dlg(ObjectG.getDObject!(FlowBoxChild)(child), _flowbox);
685 		}
686 	}
687 
688 	bool delegate(GtkMovementStep, int, FlowBox)[] onMoveCursorListeners;
689 	/**
690 	 * The ::move-cursor signal is a
691 	 * [keybinding signal][GtkBindingSignal]
692 	 * which gets emitted when the user initiates a cursor movement.
693 	 *
694 	 * Applications should not connect to it, but may emit it with
695 	 * g_signal_emit_by_name() if they need to control the cursor
696 	 * programmatically.
697 	 *
698 	 * The default bindings for this signal come in two variants,
699 	 * the variant with the Shift modifier extends the selection,
700 	 * the variant without the Shift modifer does not.
701 	 * There are too many key combinations to list them all here.
702 	 * - Arrow keys move by individual children
703 	 * - Home/End keys move to the ends of the box
704 	 * - PageUp/PageDown keys move vertically by pages
705 	 *
706 	 * Params:
707 	 *     step = the granularity fo the move, as a #GtkMovementStep
708 	 *     count = the number of @step units to move
709 	 *
710 	 * Return: %TRUE to stop other handlers from being invoked for the event.
711 	 *     %FALSE to propagate the event further.
712 	 */
713 	void addOnMoveCursor(bool delegate(GtkMovementStep, int, FlowBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
714 	{
715 		if ( "move-cursor" !in connectedSignals )
716 		{
717 			Signals.connectData(
718 				this,
719 				"move-cursor",
720 				cast(GCallback)&callBackMoveCursor,
721 				cast(void*)this,
722 				null,
723 				connectFlags);
724 			connectedSignals["move-cursor"] = 1;
725 		}
726 		onMoveCursorListeners ~= dlg;
727 	}
728 	extern(C) static int callBackMoveCursor(GtkFlowBox* flowboxStruct, GtkMovementStep step, int count, FlowBox _flowbox)
729 	{
730 		foreach ( bool delegate(GtkMovementStep, int, FlowBox) dlg; _flowbox.onMoveCursorListeners )
731 		{
732 			if ( dlg(step, count, _flowbox) )
733 			{
734 				return 1;
735 			}
736 		}
737 		
738 		return 0;
739 	}
740 
741 	void delegate(FlowBox)[] onSelectAllListeners;
742 	/**
743 	 * The ::select-all signal is a
744 	 * [keybinding signal][GtkBindingSignal]
745 	 * which gets emitted to select all children of the box, if
746 	 * the selection mode permits it.
747 	 *
748 	 * The default bindings for this signal is Ctrl-a.
749 	 */
750 	void addOnSelectAll(void delegate(FlowBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
751 	{
752 		if ( "select-all" !in connectedSignals )
753 		{
754 			Signals.connectData(
755 				this,
756 				"select-all",
757 				cast(GCallback)&callBackSelectAll,
758 				cast(void*)this,
759 				null,
760 				connectFlags);
761 			connectedSignals["select-all"] = 1;
762 		}
763 		onSelectAllListeners ~= dlg;
764 	}
765 	extern(C) static void callBackSelectAll(GtkFlowBox* flowboxStruct, FlowBox _flowbox)
766 	{
767 		foreach ( void delegate(FlowBox) dlg; _flowbox.onSelectAllListeners )
768 		{
769 			dlg(_flowbox);
770 		}
771 	}
772 
773 	void delegate(FlowBox)[] onSelectedChildrenChangedListeners;
774 	/**
775 	 * The ::selected-children-changed signal is emitted when the
776 	 * set of selected children changes.
777 	 *
778 	 * Use gtk_flow_box_selected_foreach() or
779 	 * gtk_flow_box_get_selected_children() to obtain the
780 	 * selected children.
781 	 */
782 	void addOnSelectedChildrenChanged(void delegate(FlowBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
783 	{
784 		if ( "selected-children-changed" !in connectedSignals )
785 		{
786 			Signals.connectData(
787 				this,
788 				"selected-children-changed",
789 				cast(GCallback)&callBackSelectedChildrenChanged,
790 				cast(void*)this,
791 				null,
792 				connectFlags);
793 			connectedSignals["selected-children-changed"] = 1;
794 		}
795 		onSelectedChildrenChangedListeners ~= dlg;
796 	}
797 	extern(C) static void callBackSelectedChildrenChanged(GtkFlowBox* flowboxStruct, FlowBox _flowbox)
798 	{
799 		foreach ( void delegate(FlowBox) dlg; _flowbox.onSelectedChildrenChangedListeners )
800 		{
801 			dlg(_flowbox);
802 		}
803 	}
804 
805 	void delegate(FlowBox)[] onToggleCursorChildListeners;
806 	/**
807 	 * The ::toggle-cursor-child signal is a
808 	 * [keybinding signal][GtkBindingSignal]
809 	 * which toggles the selection of the child that has the focus.
810 	 *
811 	 * The default binding for this signal is Ctrl-Space.
812 	 */
813 	void addOnToggleCursorChild(void delegate(FlowBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
814 	{
815 		if ( "toggle-cursor-child" !in connectedSignals )
816 		{
817 			Signals.connectData(
818 				this,
819 				"toggle-cursor-child",
820 				cast(GCallback)&callBackToggleCursorChild,
821 				cast(void*)this,
822 				null,
823 				connectFlags);
824 			connectedSignals["toggle-cursor-child"] = 1;
825 		}
826 		onToggleCursorChildListeners ~= dlg;
827 	}
828 	extern(C) static void callBackToggleCursorChild(GtkFlowBox* flowboxStruct, FlowBox _flowbox)
829 	{
830 		foreach ( void delegate(FlowBox) dlg; _flowbox.onToggleCursorChildListeners )
831 		{
832 			dlg(_flowbox);
833 		}
834 	}
835 
836 	void delegate(FlowBox)[] onUnselectAllListeners;
837 	/**
838 	 * The ::unselect-all signal is a
839 	 * [keybinding signal][GtkBindingSignal]
840 	 * which gets emitted to unselect all children of the box, if
841 	 * the selection mode permits it.
842 	 *
843 	 * The default bindings for this signal is Ctrl-Shift-a.
844 	 */
845 	void addOnUnselectAll(void delegate(FlowBox) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
846 	{
847 		if ( "unselect-all" !in connectedSignals )
848 		{
849 			Signals.connectData(
850 				this,
851 				"unselect-all",
852 				cast(GCallback)&callBackUnselectAll,
853 				cast(void*)this,
854 				null,
855 				connectFlags);
856 			connectedSignals["unselect-all"] = 1;
857 		}
858 		onUnselectAllListeners ~= dlg;
859 	}
860 	extern(C) static void callBackUnselectAll(GtkFlowBox* flowboxStruct, FlowBox _flowbox)
861 	{
862 		foreach ( void delegate(FlowBox) dlg; _flowbox.onUnselectAllListeners )
863 		{
864 			dlg(_flowbox);
865 		}
866 	}
867 }