portico/Sources/Portico/Generated/IconView.swift

1263 lines
84 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Generated by PorticoGen. DO NOT EDIT. See Sources/PorticoGen to make changes.
import Adw
import Gtk
import Gio
import Gdk
// PorticoGen: generateStruct | source: Gtk.IconView
/// `GtkIconView` is a widget which displays data in a grid of icons.
///
/// <picture>
/// <source srcset="icon-view-dark.png" media="(prefers-color-scheme: dark)">
/// <img alt="An example GtkIconView" src="icon-view.png">
/// </picture>
///
/// `GtkIconView` provides an alternative view on a `GtkTreeModel`.
/// It displays the model as a grid of icons with labels. Like
/// [class`Gtk`.TreeView], it allows to select one or multiple items
/// (depending on the selection mode, see [method`Gtk`.IconView.set_selection_mode]).
/// In addition to selection with the arrow keys, `GtkIconView` supports
/// rubberband selection, which is controlled by dragging the pointer.
///
/// Note that if the tree model is backed by an actual tree store (as
/// opposed to a flat list where the mapping to icons is obvious),
/// `GtkIconView` will only display the first level of the tree and
/// ignore the trees branches.
///
/// ## CSS nodes
///
/// ```
/// iconview.view
/// [rubberband]
/// ```
///
/// `GtkIconView` has a single CSS node with name iconview and style class .view.
/// For rubberband selection, a subnode with name rubberband is used.
///
/// A Portico view that mounts a `Gtk.IconView`.
@MainActor public struct IconView: View {
private let make: (MountContext) -> Gtk.IconView
private var configure: [(Gtk.IconView, MountContext) -> Void] = []
public var body: Never { fatalError() }
// PorticoGen: generateInits(static) | source: Gtk.IconView.init()
/// Creates a new `GtkIconView` widget
///
/// Applied once at mount; use the `Binding` or closure overload for values that change.
/// Optional value parameters are applied only when non-`nil`; a `nil` argument leaves the widget's own default in place and cannot clear a nullable property - use the matching modifier for that.
///
/// - Parameter activateOnSingleClick: The activate-on-single-click property specifies whether the "item-activated" signal will be emitted after a single click.
/// - Parameter columnSpacing: The column-spacing property specifies the space which is inserted between the columns of the icon view.
/// - Parameter columns: The columns property contains the number of the columns in which the items should be displayed. If it is -1, the number of columns will be chosen automatically to fill the available area.
/// - Parameter itemOrientation: The item-orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other.
/// - Parameter itemPadding: The item-padding property specifies the padding around each of the icon view's item.
/// - Parameter itemWidth: The item-width property specifies the width to use for each item. If it is set to -1, the icon view will automatically determine a suitable item size.
/// - Parameter margin: The margin property specifies the space which is inserted at the edges of the icon view.
/// - Parameter markupColumn: The ::markup-column property contains the number of the model column containing markup information to be displayed. The markup column must be of type `G_TYPE_STRING`. If this property and the :text-column property are both set to column numbers, it overrides the text column. If both are set to -1, no texts are displayed.
/// - Parameter pixbufColumn: The ::pixbuf-column property contains the number of the model column containing the pixbufs which are displayed. The pixbuf column must be of type `GDK_TYPE_PIXBUF`. Setting this property to -1 turns off the display of pixbufs.
/// - Parameter reorderable: The reorderable property specifies if the items can be reordered by DND.
/// - Parameter rowSpacing: The row-spacing property specifies the space which is inserted between the rows of the icon view.
/// - Parameter selectionMode: The ::selection-mode property specifies the selection mode of icon view. If the mode is `GTK_SELECTION_MULTIPLE`, rubberband selection is enabled, for the other modes, only keyboard selection is possible.
/// - Parameter spacing: The spacing property specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.
/// - Parameter textColumn: The ::text-column property contains the number of the model column containing the texts which are displayed. The text column must be of type `G_TYPE_STRING`. If this property and the :markup-column property are both set to -1, no texts are displayed.
/// - Parameter tooltipColumn: The column of the icon view model which is being used for displaying tooltips on it's rows.
/// - Parameter onActivateCursorItem: Invoked when the widget emits the `activate-cursor-item` signal. Its return value is forwarded to GTK as the signal's result.
/// - Parameter onItemActivated: Invoked when the widget emits the `item-activated` signal. The closure receives the signal's arguments in order.
/// - Parameter onMoveCursor: Invoked when the widget emits the `move-cursor` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
/// - Parameter onSelectAll: Invoked when the widget emits the `select-all` signal.
/// - Parameter onSelectCursorItem: Invoked when the widget emits the `select-cursor-item` signal.
/// - Parameter onSelectionChanged: Invoked when the widget emits the `selection-changed` signal.
/// - Parameter onToggleCursorItem: Invoked when the widget emits the `toggle-cursor-item` signal.
/// - Parameter onUnselectAll: Invoked when the widget emits the `unselect-all` signal.
public init(activateOnSingleClick: Bool? = nil, columnSpacing: Int32? = nil, columns: Int32? = nil, itemOrientation: Gtk.Orientation? = nil, itemPadding: Int32? = nil, itemWidth: Int32? = nil, margin: Int32? = nil, markupColumn: Int32? = nil, pixbufColumn: Int32? = nil, reorderable: Bool? = nil, rowSpacing: Int32? = nil, selectionMode: Gtk.SelectionMode? = nil, spacing: Int32? = nil, textColumn: Int32? = nil, tooltipColumn: Int32? = nil, onActivateCursorItem: (() -> Bool)? = nil, onItemActivated: ((Gtk.TreePath) -> Void)? = nil, onMoveCursor: ((Gtk.MovementStep, Int32, Bool, Bool) -> Bool)? = nil, onSelectAll: (() -> Void)? = nil, onSelectCursorItem: (() -> Void)? = nil, onSelectionChanged: (() -> Void)? = nil, onToggleCursorItem: (() -> Void)? = nil, onUnselectAll: (() -> Void)? = nil) {
make = { _ in Gtk.IconView() }
configure.append { w, ctx in
if let activateOnSingleClick { w.setActivateOnSingleClick(single: activateOnSingleClick) }
if let columnSpacing { w.setColumnSpacing(columnSpacing: columnSpacing) }
if let columns { w.setColumns(columns: columns) }
if let itemOrientation { w.setItemOrientation(orientation: itemOrientation) }
if let itemPadding { w.setItemPadding(itemPadding: itemPadding) }
if let itemWidth { w.setItemWidth(itemWidth: itemWidth) }
if let margin { w.setMargin(margin: margin) }
if let markupColumn { w.setMarkupColumn(column: markupColumn) }
if let pixbufColumn { w.setPixbufColumn(column: pixbufColumn) }
if let reorderable { w.setReorderable(reorderable: reorderable) }
if let rowSpacing { w.setRowSpacing(rowSpacing: rowSpacing) }
if let selectionMode { w.setSelectionMode(mode: selectionMode) }
if let spacing { w.setSpacing(spacing: spacing) }
if let textColumn { w.setTextColumn(column: textColumn) }
if let tooltipColumn { w.setTooltipColumn(column: tooltipColumn) }
if let onActivateCursorItem { ctx.registry.add(w.connectActivateCursorItem { _ in onActivateCursorItem() }) }
if let onItemActivated { ctx.registry.add(w.connectItemActivated { _, a0 in onItemActivated(a0) }) }
if let onMoveCursor { ctx.registry.add(w.connectMoveCursor { _, a0, a1, a2, a3 in onMoveCursor(a0, a1, a2, a3) }) }
if let onSelectAll { ctx.registry.add(w.connectSelectAll { _ in onSelectAll() }) }
if let onSelectCursorItem { ctx.registry.add(w.connectSelectCursorItem { _ in onSelectCursorItem() }) }
if let onSelectionChanged { ctx.registry.add(w.connectSelectionChanged { _ in onSelectionChanged() }) }
if let onToggleCursorItem { ctx.registry.add(w.connectToggleCursorItem { _ in onToggleCursorItem() }) }
if let onUnselectAll { ctx.registry.add(w.connectUnselectAll { _ in onUnselectAll() }) }
}
}
// PorticoGen: generateInits(static) | source: Gtk.IconView.init(area:)
/// Creates a new `GtkIconView` widget using the
/// specified `area` to layout cells inside the icons.
///
/// Applied once at mount; use the `Binding` or closure overload for values that change.
/// Optional value parameters are applied only when non-`nil`; a `nil` argument leaves the widget's own default in place and cannot clear a nullable property - use the matching modifier for that.
///
/// - Parameter area: The `area` value forwarded to `Gtk.IconView`.
/// - Parameter activateOnSingleClick: The activate-on-single-click property specifies whether the "item-activated" signal will be emitted after a single click.
/// - Parameter columnSpacing: The column-spacing property specifies the space which is inserted between the columns of the icon view.
/// - Parameter columns: The columns property contains the number of the columns in which the items should be displayed. If it is -1, the number of columns will be chosen automatically to fill the available area.
/// - Parameter itemOrientation: The item-orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other.
/// - Parameter itemPadding: The item-padding property specifies the padding around each of the icon view's item.
/// - Parameter itemWidth: The item-width property specifies the width to use for each item. If it is set to -1, the icon view will automatically determine a suitable item size.
/// - Parameter margin: The margin property specifies the space which is inserted at the edges of the icon view.
/// - Parameter markupColumn: The ::markup-column property contains the number of the model column containing markup information to be displayed. The markup column must be of type `G_TYPE_STRING`. If this property and the :text-column property are both set to column numbers, it overrides the text column. If both are set to -1, no texts are displayed.
/// - Parameter pixbufColumn: The ::pixbuf-column property contains the number of the model column containing the pixbufs which are displayed. The pixbuf column must be of type `GDK_TYPE_PIXBUF`. Setting this property to -1 turns off the display of pixbufs.
/// - Parameter reorderable: The reorderable property specifies if the items can be reordered by DND.
/// - Parameter rowSpacing: The row-spacing property specifies the space which is inserted between the rows of the icon view.
/// - Parameter selectionMode: The ::selection-mode property specifies the selection mode of icon view. If the mode is `GTK_SELECTION_MULTIPLE`, rubberband selection is enabled, for the other modes, only keyboard selection is possible.
/// - Parameter spacing: The spacing property specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.
/// - Parameter textColumn: The ::text-column property contains the number of the model column containing the texts which are displayed. The text column must be of type `G_TYPE_STRING`. If this property and the :markup-column property are both set to -1, no texts are displayed.
/// - Parameter tooltipColumn: The column of the icon view model which is being used for displaying tooltips on it's rows.
/// - Parameter onActivateCursorItem: Invoked when the widget emits the `activate-cursor-item` signal. Its return value is forwarded to GTK as the signal's result.
/// - Parameter onItemActivated: Invoked when the widget emits the `item-activated` signal. The closure receives the signal's arguments in order.
/// - Parameter onMoveCursor: Invoked when the widget emits the `move-cursor` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
/// - Parameter onSelectAll: Invoked when the widget emits the `select-all` signal.
/// - Parameter onSelectCursorItem: Invoked when the widget emits the `select-cursor-item` signal.
/// - Parameter onSelectionChanged: Invoked when the widget emits the `selection-changed` signal.
/// - Parameter onToggleCursorItem: Invoked when the widget emits the `toggle-cursor-item` signal.
/// - Parameter onUnselectAll: Invoked when the widget emits the `unselect-all` signal.
public init(area: Gtk.CellArea, activateOnSingleClick: Bool? = nil, columnSpacing: Int32? = nil, columns: Int32? = nil, itemOrientation: Gtk.Orientation? = nil, itemPadding: Int32? = nil, itemWidth: Int32? = nil, margin: Int32? = nil, markupColumn: Int32? = nil, pixbufColumn: Int32? = nil, reorderable: Bool? = nil, rowSpacing: Int32? = nil, selectionMode: Gtk.SelectionMode? = nil, spacing: Int32? = nil, textColumn: Int32? = nil, tooltipColumn: Int32? = nil, onActivateCursorItem: (() -> Bool)? = nil, onItemActivated: ((Gtk.TreePath) -> Void)? = nil, onMoveCursor: ((Gtk.MovementStep, Int32, Bool, Bool) -> Bool)? = nil, onSelectAll: (() -> Void)? = nil, onSelectCursorItem: (() -> Void)? = nil, onSelectionChanged: (() -> Void)? = nil, onToggleCursorItem: (() -> Void)? = nil, onUnselectAll: (() -> Void)? = nil) {
make = { _ in Gtk.IconView(area: area) }
configure.append { w, ctx in
if let activateOnSingleClick { w.setActivateOnSingleClick(single: activateOnSingleClick) }
if let columnSpacing { w.setColumnSpacing(columnSpacing: columnSpacing) }
if let columns { w.setColumns(columns: columns) }
if let itemOrientation { w.setItemOrientation(orientation: itemOrientation) }
if let itemPadding { w.setItemPadding(itemPadding: itemPadding) }
if let itemWidth { w.setItemWidth(itemWidth: itemWidth) }
if let margin { w.setMargin(margin: margin) }
if let markupColumn { w.setMarkupColumn(column: markupColumn) }
if let pixbufColumn { w.setPixbufColumn(column: pixbufColumn) }
if let reorderable { w.setReorderable(reorderable: reorderable) }
if let rowSpacing { w.setRowSpacing(rowSpacing: rowSpacing) }
if let selectionMode { w.setSelectionMode(mode: selectionMode) }
if let spacing { w.setSpacing(spacing: spacing) }
if let textColumn { w.setTextColumn(column: textColumn) }
if let tooltipColumn { w.setTooltipColumn(column: tooltipColumn) }
if let onActivateCursorItem { ctx.registry.add(w.connectActivateCursorItem { _ in onActivateCursorItem() }) }
if let onItemActivated { ctx.registry.add(w.connectItemActivated { _, a0 in onItemActivated(a0) }) }
if let onMoveCursor { ctx.registry.add(w.connectMoveCursor { _, a0, a1, a2, a3 in onMoveCursor(a0, a1, a2, a3) }) }
if let onSelectAll { ctx.registry.add(w.connectSelectAll { _ in onSelectAll() }) }
if let onSelectCursorItem { ctx.registry.add(w.connectSelectCursorItem { _ in onSelectCursorItem() }) }
if let onSelectionChanged { ctx.registry.add(w.connectSelectionChanged { _ in onSelectionChanged() }) }
if let onToggleCursorItem { ctx.registry.add(w.connectToggleCursorItem { _ in onToggleCursorItem() }) }
if let onUnselectAll { ctx.registry.add(w.connectUnselectAll { _ in onUnselectAll() }) }
}
}
// PorticoGen: generateInits(static) | source: Gtk.IconView.init(model:)
/// Creates a new `GtkIconView` widget with the model `model`.
///
/// Applied once at mount; use the `Binding` or closure overload for values that change.
/// Optional value parameters are applied only when non-`nil`; a `nil` argument leaves the widget's own default in place and cannot clear a nullable property - use the matching modifier for that.
///
/// - Parameter model: The model of the icon view.
/// - Parameter activateOnSingleClick: The activate-on-single-click property specifies whether the "item-activated" signal will be emitted after a single click.
/// - Parameter columnSpacing: The column-spacing property specifies the space which is inserted between the columns of the icon view.
/// - Parameter columns: The columns property contains the number of the columns in which the items should be displayed. If it is -1, the number of columns will be chosen automatically to fill the available area.
/// - Parameter itemOrientation: The item-orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other.
/// - Parameter itemPadding: The item-padding property specifies the padding around each of the icon view's item.
/// - Parameter itemWidth: The item-width property specifies the width to use for each item. If it is set to -1, the icon view will automatically determine a suitable item size.
/// - Parameter margin: The margin property specifies the space which is inserted at the edges of the icon view.
/// - Parameter markupColumn: The ::markup-column property contains the number of the model column containing markup information to be displayed. The markup column must be of type `G_TYPE_STRING`. If this property and the :text-column property are both set to column numbers, it overrides the text column. If both are set to -1, no texts are displayed.
/// - Parameter pixbufColumn: The ::pixbuf-column property contains the number of the model column containing the pixbufs which are displayed. The pixbuf column must be of type `GDK_TYPE_PIXBUF`. Setting this property to -1 turns off the display of pixbufs.
/// - Parameter reorderable: The reorderable property specifies if the items can be reordered by DND.
/// - Parameter rowSpacing: The row-spacing property specifies the space which is inserted between the rows of the icon view.
/// - Parameter selectionMode: The ::selection-mode property specifies the selection mode of icon view. If the mode is `GTK_SELECTION_MULTIPLE`, rubberband selection is enabled, for the other modes, only keyboard selection is possible.
/// - Parameter spacing: The spacing property specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.
/// - Parameter textColumn: The ::text-column property contains the number of the model column containing the texts which are displayed. The text column must be of type `G_TYPE_STRING`. If this property and the :markup-column property are both set to -1, no texts are displayed.
/// - Parameter tooltipColumn: The column of the icon view model which is being used for displaying tooltips on it's rows.
/// - Parameter onActivateCursorItem: Invoked when the widget emits the `activate-cursor-item` signal. Its return value is forwarded to GTK as the signal's result.
/// - Parameter onItemActivated: Invoked when the widget emits the `item-activated` signal. The closure receives the signal's arguments in order.
/// - Parameter onMoveCursor: Invoked when the widget emits the `move-cursor` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
/// - Parameter onSelectAll: Invoked when the widget emits the `select-all` signal.
/// - Parameter onSelectCursorItem: Invoked when the widget emits the `select-cursor-item` signal.
/// - Parameter onSelectionChanged: Invoked when the widget emits the `selection-changed` signal.
/// - Parameter onToggleCursorItem: Invoked when the widget emits the `toggle-cursor-item` signal.
/// - Parameter onUnselectAll: Invoked when the widget emits the `unselect-all` signal.
public init(model: Gtk.TreeModel, activateOnSingleClick: Bool? = nil, columnSpacing: Int32? = nil, columns: Int32? = nil, itemOrientation: Gtk.Orientation? = nil, itemPadding: Int32? = nil, itemWidth: Int32? = nil, margin: Int32? = nil, markupColumn: Int32? = nil, pixbufColumn: Int32? = nil, reorderable: Bool? = nil, rowSpacing: Int32? = nil, selectionMode: Gtk.SelectionMode? = nil, spacing: Int32? = nil, textColumn: Int32? = nil, tooltipColumn: Int32? = nil, onActivateCursorItem: (() -> Bool)? = nil, onItemActivated: ((Gtk.TreePath) -> Void)? = nil, onMoveCursor: ((Gtk.MovementStep, Int32, Bool, Bool) -> Bool)? = nil, onSelectAll: (() -> Void)? = nil, onSelectCursorItem: (() -> Void)? = nil, onSelectionChanged: (() -> Void)? = nil, onToggleCursorItem: (() -> Void)? = nil, onUnselectAll: (() -> Void)? = nil) {
make = { _ in Gtk.IconView(model: model) }
configure.append { w, ctx in
if let activateOnSingleClick { w.setActivateOnSingleClick(single: activateOnSingleClick) }
if let columnSpacing { w.setColumnSpacing(columnSpacing: columnSpacing) }
if let columns { w.setColumns(columns: columns) }
if let itemOrientation { w.setItemOrientation(orientation: itemOrientation) }
if let itemPadding { w.setItemPadding(itemPadding: itemPadding) }
if let itemWidth { w.setItemWidth(itemWidth: itemWidth) }
if let margin { w.setMargin(margin: margin) }
if let markupColumn { w.setMarkupColumn(column: markupColumn) }
if let pixbufColumn { w.setPixbufColumn(column: pixbufColumn) }
if let reorderable { w.setReorderable(reorderable: reorderable) }
if let rowSpacing { w.setRowSpacing(rowSpacing: rowSpacing) }
if let selectionMode { w.setSelectionMode(mode: selectionMode) }
if let spacing { w.setSpacing(spacing: spacing) }
if let textColumn { w.setTextColumn(column: textColumn) }
if let tooltipColumn { w.setTooltipColumn(column: tooltipColumn) }
if let onActivateCursorItem { ctx.registry.add(w.connectActivateCursorItem { _ in onActivateCursorItem() }) }
if let onItemActivated { ctx.registry.add(w.connectItemActivated { _, a0 in onItemActivated(a0) }) }
if let onMoveCursor { ctx.registry.add(w.connectMoveCursor { _, a0, a1, a2, a3 in onMoveCursor(a0, a1, a2, a3) }) }
if let onSelectAll { ctx.registry.add(w.connectSelectAll { _ in onSelectAll() }) }
if let onSelectCursorItem { ctx.registry.add(w.connectSelectCursorItem { _ in onSelectCursorItem() }) }
if let onSelectionChanged { ctx.registry.add(w.connectSelectionChanged { _ in onSelectionChanged() }) }
if let onToggleCursorItem { ctx.registry.add(w.connectToggleCursorItem { _ in onToggleCursorItem() }) }
if let onUnselectAll { ctx.registry.add(w.connectUnselectAll { _ in onUnselectAll() }) }
}
}
}
extension IconView: WidgetView {
public typealias Target = Gtk.IconView
@_spi(Portico) public func appending(
_ step: @escaping (Gtk.IconView, MountContext) -> Void
) -> Self {
var c = self
c.configure.append(step)
return c
}
}
@_spi(Portico) extension IconView: Mountable {
@_spi(Portico) public func mount(_ ctx: MountContext) -> Gtk.Widget {
let w = make(ctx)
for step in configure { step(w, ctx) }
return w
}
}
// PorticoGen: generateModifierExtension | source: Gtk.IconView
/// Modifiers for `Gtk.IconView`, available on every Portico view whose
/// backing widget is `Gtk.IconView` or one of its subclasses.
extension WidgetView where Target: Gtk.IconView {
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setActivateOnSingleClick(single:)
/// Causes the `GtkIconView`::item-activated signal to be emitted on
/// a single click instead of a double click.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter activateOnSingleClick: The activate-on-single-click property specifies whether the "item-activated" signal will be emitted after a single click.
/// - Returns: A copy of this view with the modifier applied.
public func activateOnSingleClick(_ activateOnSingleClick: Bool) -> Self {
appending { w, _ in
w.setActivateOnSingleClick(single: activateOnSingleClick)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setActivateOnSingleClick(single:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getActivateOnSingleClick()
/// Causes the `GtkIconView`::item-activated signal to be emitted on
/// a single click instead of a double click.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func activateOnSingleClick(_ activateOnSingleClick: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, activateOnSingleClick, registry: ctx.registry, notifyDetail: "activate-on-single-click",
read: { [w] in w.getActivateOnSingleClick() },
write: { [w] v in w.setActivateOnSingleClick(single: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setActivateOnSingleClick(single:)
/// Causes the `GtkIconView`::item-activated signal to be emitted on
/// a single click instead of a double click.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setActivateOnSingleClick(single:)`.
///
/// - Parameter activateOnSingleClick: The activate-on-single-click property specifies whether the "item-activated" signal will be emitted after a single click.
/// - Returns: A copy of this view with the modifier applied.
public func activateOnSingleClick(_ activateOnSingleClick: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setActivateOnSingleClick(single: activateOnSingleClick()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setColumnSpacing(columnSpacing:)
/// Sets the ::column-spacing property which specifies the space
/// which is inserted between the columns of the icon view.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter columnSpacing: The column-spacing property specifies the space which is inserted between the columns of the icon view.
/// - Returns: A copy of this view with the modifier applied.
public func columnSpacing(_ columnSpacing: Int32) -> Self {
appending { w, _ in
w.setColumnSpacing(columnSpacing: columnSpacing)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setColumnSpacing(columnSpacing:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getColumnSpacing()
/// Sets the ::column-spacing property which specifies the space
/// which is inserted between the columns of the icon view.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func columnSpacing(_ columnSpacing: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, columnSpacing, registry: ctx.registry, notifyDetail: "column-spacing",
read: { [w] in w.getColumnSpacing() },
write: { [w] v in w.setColumnSpacing(columnSpacing: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setColumnSpacing(columnSpacing:)
/// Sets the ::column-spacing property which specifies the space
/// which is inserted between the columns of the icon view.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setColumnSpacing(columnSpacing:)`.
///
/// - Parameter columnSpacing: The column-spacing property specifies the space which is inserted between the columns of the icon view.
/// - Returns: A copy of this view with the modifier applied.
public func columnSpacing(_ columnSpacing: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setColumnSpacing(columnSpacing: columnSpacing()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setColumns(columns:)
/// Sets the ::columns property which determines in how
/// many columns the icons are arranged. If `columns` is
/// -1, the number of columns will be chosen automatically
/// to fill the available area.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter columns: The columns property contains the number of the columns in which the items should be displayed. If it is -1, the number of columns will be chosen automatically to fill the available area.
/// - Returns: A copy of this view with the modifier applied.
public func columns(_ columns: Int32) -> Self {
appending { w, _ in
w.setColumns(columns: columns)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setColumns(columns:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getColumns()
/// Sets the ::columns property which determines in how
/// many columns the icons are arranged. If `columns` is
/// -1, the number of columns will be chosen automatically
/// to fill the available area.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func columns(_ columns: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, columns, registry: ctx.registry, notifyDetail: "columns",
read: { [w] in w.getColumns() },
write: { [w] v in w.setColumns(columns: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setColumns(columns:)
/// Sets the ::columns property which determines in how
/// many columns the icons are arranged. If `columns` is
/// -1, the number of columns will be chosen automatically
/// to fill the available area.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setColumns(columns:)`.
///
/// - Parameter columns: The columns property contains the number of the columns in which the items should be displayed. If it is -1, the number of columns will be chosen automatically to fill the available area.
/// - Returns: A copy of this view with the modifier applied.
public func columns(_ columns: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setColumns(columns: columns()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setItemOrientation(orientation:)
/// Sets the ::item-orientation property which determines whether the labels
/// are drawn beside the icons instead of below.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter itemOrientation: The item-orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other.
/// - Returns: A copy of this view with the modifier applied.
public func itemOrientation(_ itemOrientation: Gtk.Orientation) -> Self {
appending { w, _ in
w.setItemOrientation(orientation: itemOrientation)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setItemOrientation(orientation:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getItemOrientation()
/// Sets the ::item-orientation property which determines whether the labels
/// are drawn beside the icons instead of below.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Gtk.Orientation` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func itemOrientation(_ itemOrientation: Portico.Binding<Gtk.Orientation>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, itemOrientation, registry: ctx.registry, notifyDetail: "item-orientation",
read: { [w] in w.getItemOrientation() },
write: { [w] v in w.setItemOrientation(orientation: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setItemOrientation(orientation:)
/// Sets the ::item-orientation property which determines whether the labels
/// are drawn beside the icons instead of below.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setItemOrientation(orientation:)`.
///
/// - Parameter itemOrientation: The item-orientation property specifies how the cells (i.e. the icon and the text) of the item are positioned relative to each other.
/// - Returns: A copy of this view with the modifier applied.
public func itemOrientation(_ itemOrientation: @escaping () -> Gtk.Orientation) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setItemOrientation(orientation: itemOrientation()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setItemPadding(itemPadding:)
/// Sets the `GtkIconView`:item-padding property which specifies the padding
/// around each of the icon views items.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter itemPadding: The item-padding property specifies the padding around each of the icon view's item.
/// - Returns: A copy of this view with the modifier applied.
public func itemPadding(_ itemPadding: Int32) -> Self {
appending { w, _ in
w.setItemPadding(itemPadding: itemPadding)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setItemPadding(itemPadding:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getItemPadding()
/// Sets the `GtkIconView`:item-padding property which specifies the padding
/// around each of the icon views items.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func itemPadding(_ itemPadding: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, itemPadding, registry: ctx.registry, notifyDetail: "item-padding",
read: { [w] in w.getItemPadding() },
write: { [w] v in w.setItemPadding(itemPadding: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setItemPadding(itemPadding:)
/// Sets the `GtkIconView`:item-padding property which specifies the padding
/// around each of the icon views items.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setItemPadding(itemPadding:)`.
///
/// - Parameter itemPadding: The item-padding property specifies the padding around each of the icon view's item.
/// - Returns: A copy of this view with the modifier applied.
public func itemPadding(_ itemPadding: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setItemPadding(itemPadding: itemPadding()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setItemWidth(itemWidth:)
/// Sets the ::item-width property which specifies the width
/// to use for each item. If it is set to -1, the icon view will
/// automatically determine a suitable item size.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter itemWidth: The item-width property specifies the width to use for each item. If it is set to -1, the icon view will automatically determine a suitable item size.
/// - Returns: A copy of this view with the modifier applied.
public func itemWidth(_ itemWidth: Int32) -> Self {
appending { w, _ in
w.setItemWidth(itemWidth: itemWidth)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setItemWidth(itemWidth:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getItemWidth()
/// Sets the ::item-width property which specifies the width
/// to use for each item. If it is set to -1, the icon view will
/// automatically determine a suitable item size.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func itemWidth(_ itemWidth: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, itemWidth, registry: ctx.registry, notifyDetail: "item-width",
read: { [w] in w.getItemWidth() },
write: { [w] v in w.setItemWidth(itemWidth: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setItemWidth(itemWidth:)
/// Sets the ::item-width property which specifies the width
/// to use for each item. If it is set to -1, the icon view will
/// automatically determine a suitable item size.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setItemWidth(itemWidth:)`.
///
/// - Parameter itemWidth: The item-width property specifies the width to use for each item. If it is set to -1, the icon view will automatically determine a suitable item size.
/// - Returns: A copy of this view with the modifier applied.
public func itemWidth(_ itemWidth: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setItemWidth(itemWidth: itemWidth()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setMargin(margin:)
/// Sets the ::margin property which specifies the space
/// which is inserted at the top, bottom, left and right
/// of the icon view.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter margin: The margin property specifies the space which is inserted at the edges of the icon view.
/// - Returns: A copy of this view with the modifier applied.
public func margin(_ margin: Int32) -> Self {
appending { w, _ in
w.setMargin(margin: margin)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setMargin(margin:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getMargin()
/// Sets the ::margin property which specifies the space
/// which is inserted at the top, bottom, left and right
/// of the icon view.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func margin(_ margin: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, margin, registry: ctx.registry, notifyDetail: "margin",
read: { [w] in w.getMargin() },
write: { [w] v in w.setMargin(margin: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setMargin(margin:)
/// Sets the ::margin property which specifies the space
/// which is inserted at the top, bottom, left and right
/// of the icon view.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setMargin(margin:)`.
///
/// - Parameter margin: The margin property specifies the space which is inserted at the edges of the icon view.
/// - Returns: A copy of this view with the modifier applied.
public func margin(_ margin: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setMargin(margin: margin()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setMarkupColumn(column:)
/// Sets the column with markup information for `icon_view` to be
/// `column`. The markup column must be of type `G_TYPE_STRING`.
/// If the markup column is set to something, it overrides
/// the text column set by gtk_icon_view_set_text_column().
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter markupColumn: The ::markup-column property contains the number of the model column containing markup information to be displayed. The markup column must be of type `G_TYPE_STRING`. If this property and the :text-column property are both set to column numbers, it overrides the text column. If both are set to -1, no texts are displayed.
/// - Returns: A copy of this view with the modifier applied.
public func markupColumn(_ markupColumn: Int32) -> Self {
appending { w, _ in
w.setMarkupColumn(column: markupColumn)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setMarkupColumn(column:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getMarkupColumn()
/// Sets the column with markup information for `icon_view` to be
/// `column`. The markup column must be of type `G_TYPE_STRING`.
/// If the markup column is set to something, it overrides
/// the text column set by gtk_icon_view_set_text_column().
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func markupColumn(_ markupColumn: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, markupColumn, registry: ctx.registry, notifyDetail: "markup-column",
read: { [w] in w.getMarkupColumn() },
write: { [w] v in w.setMarkupColumn(column: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setMarkupColumn(column:)
/// Sets the column with markup information for `icon_view` to be
/// `column`. The markup column must be of type `G_TYPE_STRING`.
/// If the markup column is set to something, it overrides
/// the text column set by gtk_icon_view_set_text_column().
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setMarkupColumn(column:)`.
///
/// - Parameter markupColumn: The ::markup-column property contains the number of the model column containing markup information to be displayed. The markup column must be of type `G_TYPE_STRING`. If this property and the :text-column property are both set to column numbers, it overrides the text column. If both are set to -1, no texts are displayed.
/// - Returns: A copy of this view with the modifier applied.
public func markupColumn(_ markupColumn: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setMarkupColumn(column: markupColumn()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setModel(model:)
/// Sets the model for a `GtkIconView`.
/// If the `icon_view` already has a model set, it will remove
/// it before setting the new model. If `model` is `nil`, then
/// it will unset the old model.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter model: The model of the icon view.
/// - Returns: A copy of this view with the modifier applied.
public func model(_ model: Gtk.TreeModel?) -> Self {
appending { w, _ in
w.setModel(model: model)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setModel(model:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getModel()
/// Sets the model for a `GtkIconView`.
/// If the `icon_view` already has a model set, it will remove
/// it before setting the new model. If `model` is `nil`, then
/// it will unset the old model.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Gtk.TreeModel?` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func model(_ model: Portico.Binding<Gtk.TreeModel?>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, model, registry: ctx.registry, notifyDetail: "model",
read: { [w] in w.getModel() },
write: { [w] v in w.setModel(model: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(lifted,twoWay) | source: Gtk.IconView.setModel(model:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getModel()
/// Sets the model for a `GtkIconView`.
/// If the `icon_view` already has a model set, it will remove
/// it before setting the new model. If `model` is `nil`, then
/// it will unset the old model.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// `Binding` is invariant, so a `Binding<Gtk.TreeModel>` is not accepted by the nullable overload; this one takes it and promotes each value. Pass a `Binding<Gtk.TreeModel?>` to be able to clear the property.
/// When `Gtk.TreeModel` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
/// A `nil` widget value is never written back into the binding.
///
/// - Returns: A copy of this view with the modifier applied.
public func model(_ model: Portico.Binding<Gtk.TreeModel>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, model, registry: ctx.registry, notifyDetail: "model",
read: { [w] in w.getModel() },
write: { [w] v in w.setModel(model: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setModel(model:)
/// Sets the model for a `GtkIconView`.
/// If the `icon_view` already has a model set, it will remove
/// it before setting the new model. If `model` is `nil`, then
/// it will unset the old model.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setModel(model:)`.
///
/// - Parameter model: The model of the icon view.
/// - Returns: A copy of this view with the modifier applied.
public func model(_ model: @escaping () -> Gtk.TreeModel?) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setModel(model: model()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setPixbufColumn(column:)
/// Sets the column with pixbufs for `icon_view` to be `column`. The pixbuf
/// column must be of type `GDK_TYPE_PIXBUF`
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter pixbufColumn: The ::pixbuf-column property contains the number of the model column containing the pixbufs which are displayed. The pixbuf column must be of type `GDK_TYPE_PIXBUF`. Setting this property to -1 turns off the display of pixbufs.
/// - Returns: A copy of this view with the modifier applied.
public func pixbufColumn(_ pixbufColumn: Int32) -> Self {
appending { w, _ in
w.setPixbufColumn(column: pixbufColumn)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setPixbufColumn(column:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getPixbufColumn()
/// Sets the column with pixbufs for `icon_view` to be `column`. The pixbuf
/// column must be of type `GDK_TYPE_PIXBUF`
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func pixbufColumn(_ pixbufColumn: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, pixbufColumn, registry: ctx.registry, notifyDetail: "pixbuf-column",
read: { [w] in w.getPixbufColumn() },
write: { [w] v in w.setPixbufColumn(column: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setPixbufColumn(column:)
/// Sets the column with pixbufs for `icon_view` to be `column`. The pixbuf
/// column must be of type `GDK_TYPE_PIXBUF`
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setPixbufColumn(column:)`.
///
/// - Parameter pixbufColumn: The ::pixbuf-column property contains the number of the model column containing the pixbufs which are displayed. The pixbuf column must be of type `GDK_TYPE_PIXBUF`. Setting this property to -1 turns off the display of pixbufs.
/// - Returns: A copy of this view with the modifier applied.
public func pixbufColumn(_ pixbufColumn: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setPixbufColumn(column: pixbufColumn()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setReorderable(reorderable:)
/// This function is a convenience function to allow you to reorder models that
/// support the `GtkTreeDragSourceIface` and the `GtkTreeDragDestIface`. Both
/// `GtkTreeStore` and `GtkListStore` support these. If `reorderable` is `true`, then
/// the user can reorder the model by dragging and dropping rows. The
/// developer can listen to these changes by connecting to the model's
/// row_inserted and row_deleted signals. The reordering is implemented by setting up
/// the icon view as a drag source and destination. Therefore, drag and
/// drop can not be used in a reorderable view for any other purpose.
///
/// This function does not give you any degree of control over the order -- any
/// reordering is allowed. If more control is needed, you should probably
/// handle drag and drop manually.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter reorderable: The reorderable property specifies if the items can be reordered by DND.
/// - Returns: A copy of this view with the modifier applied.
public func reorderable(_ reorderable: Bool) -> Self {
appending { w, _ in
w.setReorderable(reorderable: reorderable)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setReorderable(reorderable:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getReorderable()
/// This function is a convenience function to allow you to reorder models that
/// support the `GtkTreeDragSourceIface` and the `GtkTreeDragDestIface`. Both
/// `GtkTreeStore` and `GtkListStore` support these. If `reorderable` is `true`, then
/// the user can reorder the model by dragging and dropping rows. The
/// developer can listen to these changes by connecting to the model's
/// row_inserted and row_deleted signals. The reordering is implemented by setting up
/// the icon view as a drag source and destination. Therefore, drag and
/// drop can not be used in a reorderable view for any other purpose.
///
/// This function does not give you any degree of control over the order -- any
/// reordering is allowed. If more control is needed, you should probably
/// handle drag and drop manually.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Bool` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func reorderable(_ reorderable: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, reorderable, registry: ctx.registry, notifyDetail: "reorderable",
read: { [w] in w.getReorderable() },
write: { [w] v in w.setReorderable(reorderable: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setReorderable(reorderable:)
/// This function is a convenience function to allow you to reorder models that
/// support the `GtkTreeDragSourceIface` and the `GtkTreeDragDestIface`. Both
/// `GtkTreeStore` and `GtkListStore` support these. If `reorderable` is `true`, then
/// the user can reorder the model by dragging and dropping rows. The
/// developer can listen to these changes by connecting to the model's
/// row_inserted and row_deleted signals. The reordering is implemented by setting up
/// the icon view as a drag source and destination. Therefore, drag and
/// drop can not be used in a reorderable view for any other purpose.
///
/// This function does not give you any degree of control over the order -- any
/// reordering is allowed. If more control is needed, you should probably
/// handle drag and drop manually.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setReorderable(reorderable:)`.
///
/// - Parameter reorderable: The reorderable property specifies if the items can be reordered by DND.
/// - Returns: A copy of this view with the modifier applied.
public func reorderable(_ reorderable: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setReorderable(reorderable: reorderable()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setRowSpacing(rowSpacing:)
/// Sets the ::row-spacing property which specifies the space
/// which is inserted between the rows of the icon view.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter rowSpacing: The row-spacing property specifies the space which is inserted between the rows of the icon view.
/// - Returns: A copy of this view with the modifier applied.
public func rowSpacing(_ rowSpacing: Int32) -> Self {
appending { w, _ in
w.setRowSpacing(rowSpacing: rowSpacing)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setRowSpacing(rowSpacing:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getRowSpacing()
/// Sets the ::row-spacing property which specifies the space
/// which is inserted between the rows of the icon view.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func rowSpacing(_ rowSpacing: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, rowSpacing, registry: ctx.registry, notifyDetail: "row-spacing",
read: { [w] in w.getRowSpacing() },
write: { [w] v in w.setRowSpacing(rowSpacing: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setRowSpacing(rowSpacing:)
/// Sets the ::row-spacing property which specifies the space
/// which is inserted between the rows of the icon view.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setRowSpacing(rowSpacing:)`.
///
/// - Parameter rowSpacing: The row-spacing property specifies the space which is inserted between the rows of the icon view.
/// - Returns: A copy of this view with the modifier applied.
public func rowSpacing(_ rowSpacing: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setRowSpacing(rowSpacing: rowSpacing()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setSelectionMode(mode:)
/// Sets the selection mode of the `icon_view`.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter selectionMode: The ::selection-mode property specifies the selection mode of icon view. If the mode is `GTK_SELECTION_MULTIPLE`, rubberband selection is enabled, for the other modes, only keyboard selection is possible.
/// - Returns: A copy of this view with the modifier applied.
public func selectionMode(_ selectionMode: Gtk.SelectionMode) -> Self {
appending { w, _ in
w.setSelectionMode(mode: selectionMode)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setSelectionMode(mode:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getSelectionMode()
/// Sets the selection mode of the `icon_view`.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Gtk.SelectionMode` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func selectionMode(_ selectionMode: Portico.Binding<Gtk.SelectionMode>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, selectionMode, registry: ctx.registry, notifyDetail: "selection-mode",
read: { [w] in w.getSelectionMode() },
write: { [w] v in w.setSelectionMode(mode: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setSelectionMode(mode:)
/// Sets the selection mode of the `icon_view`.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setSelectionMode(mode:)`.
///
/// - Parameter selectionMode: The ::selection-mode property specifies the selection mode of icon view. If the mode is `GTK_SELECTION_MULTIPLE`, rubberband selection is enabled, for the other modes, only keyboard selection is possible.
/// - Returns: A copy of this view with the modifier applied.
public func selectionMode(_ selectionMode: @escaping () -> Gtk.SelectionMode) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setSelectionMode(mode: selectionMode()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setSpacing(spacing:)
/// Sets the ::spacing property which specifies the space
/// which is inserted between the cells (i.e. the icon and
/// the text) of an item.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter spacing: The spacing property specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.
/// - Returns: A copy of this view with the modifier applied.
public func spacing(_ spacing: Int32) -> Self {
appending { w, _ in
w.setSpacing(spacing: spacing)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setSpacing(spacing:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getSpacing()
/// Sets the ::spacing property which specifies the space
/// which is inserted between the cells (i.e. the icon and
/// the text) of an item.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func spacing(_ spacing: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, spacing, registry: ctx.registry, notifyDetail: "spacing",
read: { [w] in w.getSpacing() },
write: { [w] v in w.setSpacing(spacing: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setSpacing(spacing:)
/// Sets the ::spacing property which specifies the space
/// which is inserted between the cells (i.e. the icon and
/// the text) of an item.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setSpacing(spacing:)`.
///
/// - Parameter spacing: The spacing property specifies the space which is inserted between the cells (i.e. the icon and the text) of an item.
/// - Returns: A copy of this view with the modifier applied.
public func spacing(_ spacing: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setSpacing(spacing: spacing()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setTextColumn(column:)
/// Sets the column with text for `icon_view` to be `column`. The text
/// column must be of type `G_TYPE_STRING`.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter textColumn: The ::text-column property contains the number of the model column containing the texts which are displayed. The text column must be of type `G_TYPE_STRING`. If this property and the :markup-column property are both set to -1, no texts are displayed.
/// - Returns: A copy of this view with the modifier applied.
public func textColumn(_ textColumn: Int32) -> Self {
appending { w, _ in
w.setTextColumn(column: textColumn)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setTextColumn(column:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getTextColumn()
/// Sets the column with text for `icon_view` to be `column`. The text
/// column must be of type `G_TYPE_STRING`.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func textColumn(_ textColumn: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, textColumn, registry: ctx.registry, notifyDetail: "text-column",
read: { [w] in w.getTextColumn() },
write: { [w] v in w.setTextColumn(column: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setTextColumn(column:)
/// Sets the column with text for `icon_view` to be `column`. The text
/// column must be of type `G_TYPE_STRING`.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setTextColumn(column:)`.
///
/// - Parameter textColumn: The ::text-column property contains the number of the model column containing the texts which are displayed. The text column must be of type `G_TYPE_STRING`. If this property and the :markup-column property are both set to -1, no texts are displayed.
/// - Returns: A copy of this view with the modifier applied.
public func textColumn(_ textColumn: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setTextColumn(column: textColumn()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.IconView.setTooltipColumn(column:)
/// If you only plan to have simple (text-only) tooltips on full items, you
/// can use this function to have `GtkIconView` handle these automatically
/// for you. `column` should be set to the column in `icon_view`s model
/// containing the tooltip texts, or -1 to disable this feature.
///
/// When enabled, `GtkWidget:has-tooltip` will be set to `true` and
/// `icon_view` will connect a `GtkWidget::query-tooltip` signal handler.
///
/// Note that the signal handler sets the text with gtk_tooltip_set_markup(),
/// so &, <, etc have to be escaped in the text.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter tooltipColumn: The column of the icon view model which is being used for displaying tooltips on it's rows.
/// - Returns: A copy of this view with the modifier applied.
public func tooltipColumn(_ tooltipColumn: Int32) -> Self {
appending { w, _ in
w.setTooltipColumn(column: tooltipColumn)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.IconView.setTooltipColumn(column:), GObject.Object.connectNotify(detail:_:), Gtk.IconView.getTooltipColumn()
/// If you only plan to have simple (text-only) tooltips on full items, you
/// can use this function to have `GtkIconView` handle these automatically
/// for you. `column` should be set to the column in `icon_view`s model
/// containing the tooltip texts, or -1 to disable this feature.
///
/// When enabled, `GtkWidget:has-tooltip` will be set to `true` and
/// `icon_view` will connect a `GtkWidget::query-tooltip` signal handler.
///
/// Note that the signal handler sets the text with gtk_tooltip_set_markup(),
/// so &, <, etc have to be escaped in the text.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Int32` conforms to `Equatable` this binds in both directions: the widget's `notify` signal writes its current value back into the binding, so changes made in the UI propagate to the bound state. Each direction compares before writing, which terminates the echo after one hop. A value type that is not `Equatable` binds one way only, because the echo cannot be broken.
///
/// - Returns: A copy of this view with the modifier applied.
public func tooltipColumn(_ tooltipColumn: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, tooltipColumn, registry: ctx.registry, notifyDetail: "tooltip-column",
read: { [w] in w.getTooltipColumn() },
write: { [w] v in w.setTooltipColumn(column: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.IconView.setTooltipColumn(column:)
/// If you only plan to have simple (text-only) tooltips on full items, you
/// can use this function to have `GtkIconView` handle these automatically
/// for you. `column` should be set to the column in `icon_view`s model
/// containing the tooltip texts, or -1 to disable this feature.
///
/// When enabled, `GtkWidget:has-tooltip` will be set to `true` and
/// `icon_view` will connect a `GtkWidget::query-tooltip` signal handler.
///
/// Note that the signal handler sets the text with gtk_tooltip_set_markup(),
/// so &, <, etc have to be escaped in the text.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.IconView.setTooltipColumn(column:)`.
///
/// - Parameter tooltipColumn: The column of the icon view model which is being used for displaying tooltips on it's rows.
/// - Returns: A copy of this view with the modifier applied.
public func tooltipColumn(_ tooltipColumn: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setTooltipColumn(column: tooltipColumn()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.IconView.connectActivateCursorItem(_:)
/// A [keybinding signal][class`Gtk`.SignalAction]
/// which gets emitted when the user activates the currently
/// focused item.
///
/// Applications should not connect to it, but may emit it with
/// g_signal_emit_by_name() if they need to control activation
/// programmatically.
///
/// The default bindings for this signal are Space, Return and Enter.
///
/// - Parameter handler: Invoked when the widget emits the `activate-cursor-item` signal. Its return value is forwarded to GTK as the signal's result.
/// - Returns: A copy of this view with the modifier applied.
public func onActivateCursorItem(_ handler: @escaping () -> Bool) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectActivateCursorItem { _ in handler() })
}
}
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.IconView.connectItemActivated(_:)
/// The ::item-activated signal is emitted when the method
/// gtk_icon_view_item_activated() is called, when the user double
/// clicks an item with the "activate-on-single-click" property set
/// to `false`, or when the user single clicks an item when the
/// "activate-on-single-click" property set to `true`. It is also
/// emitted when a non-editable item is selected and one of the keys:
/// Space, Return or Enter is pressed.
///
/// - Parameter handler: Invoked when the widget emits the `item-activated` signal. The closure receives the signal's arguments in order.
/// - Returns: A copy of this view with the modifier applied.
public func onItemActivated(_ handler: @escaping (Gtk.TreePath) -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectItemActivated { _, a0 in handler(a0) })
}
}
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.IconView.connectMoveCursor(_:)
/// The ::move-cursor signal is a
/// [keybinding signal][class`Gtk`.SignalAction]
/// which gets emitted when the user initiates a cursor movement.
///
/// Applications should not connect to it, but may emit it with
/// g_signal_emit_by_name() if they need to control the cursor
/// programmatically.
///
/// The default bindings for this signal include
/// - Arrow keys which move by individual steps
/// - Home/End keys which move to the first/last item
/// - PageUp/PageDown which move by "pages"
/// All of these will extend the selection when combined with
/// the Shift modifier.
///
/// - Parameter handler: Invoked when the widget emits the `move-cursor` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
/// - Returns: A copy of this view with the modifier applied.
public func onMoveCursor(_ handler: @escaping (Gtk.MovementStep, Int32, Bool, Bool) -> Bool) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectMoveCursor { _, a0, a1, a2, a3 in handler(a0, a1, a2, a3) })
}
}
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.IconView.connectSelectAll(_:)
/// A [keybinding signal][class`Gtk`.SignalAction]
/// which gets emitted when the user selects all items.
///
/// Applications should not connect to it, but may emit it with
/// g_signal_emit_by_name() if they need to control selection
/// programmatically.
///
/// The default binding for this signal is Ctrl-a.
///
/// - Parameter handler: Invoked when the widget emits the `select-all` signal.
/// - Returns: A copy of this view with the modifier applied.
public func onSelectAll(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectSelectAll { _ in handler() })
}
}
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.IconView.connectSelectCursorItem(_:)
/// A [keybinding signal][class`Gtk`.SignalAction]
/// which gets emitted when the user selects the item that is currently
/// focused.
///
/// Applications should not connect to it, but may emit it with
/// g_signal_emit_by_name() if they need to control selection
/// programmatically.
///
/// There is no default binding for this signal.
///
/// - Parameter handler: Invoked when the widget emits the `select-cursor-item` signal.
/// - Returns: A copy of this view with the modifier applied.
public func onSelectCursorItem(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectSelectCursorItem { _ in handler() })
}
}
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.IconView.connectSelectionChanged(_:)
/// The ::selection-changed signal is emitted when the selection
/// (i.e. the set of selected items) changes.
///
/// - Parameter handler: Invoked when the widget emits the `selection-changed` signal.
/// - Returns: A copy of this view with the modifier applied.
public func onSelectionChanged(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectSelectionChanged { _ in handler() })
}
}
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.IconView.connectToggleCursorItem(_:)
/// A [keybinding signal][class`Gtk`.SignalAction]
/// which gets emitted when the user toggles whether the currently
/// focused item is selected or not. The exact effect of this
/// depend on the selection mode.
///
/// Applications should not connect to it, but may emit it with
/// g_signal_emit_by_name() if they need to control selection
/// programmatically.
///
/// There is no default binding for this signal is Ctrl-Space.
///
/// - Parameter handler: Invoked when the widget emits the `toggle-cursor-item` signal.
/// - Returns: A copy of this view with the modifier applied.
public func onToggleCursorItem(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectToggleCursorItem { _ in handler() })
}
}
// PorticoGen: generateModifierExtension -> generateSignalModifier | source: Gtk.IconView.connectUnselectAll(_:)
/// A [keybinding signal][class`Gtk`.SignalAction]
/// which gets emitted when the user unselects all items.
///
/// Applications should not connect to it, but may emit it with
/// g_signal_emit_by_name() if they need to control selection
/// programmatically.
///
/// The default binding for this signal is Ctrl-Shift-a.
///
/// - Parameter handler: Invoked when the widget emits the `unselect-all` signal.
/// - Returns: A copy of this view with the modifier applied.
public func onUnselectAll(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectUnselectAll { _ in handler() })
}
}
}