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