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