portico/Sources/Portico/Generated/TextView.swift

621 lines
22 KiB
Swift

// Generated by PorticoGen. DO NOT EDIT see Sources/PorticoGen to make changes.
import Adw
import Gtk
import Gio
import Gdk
/// A TextView widget backed by `Gtk.TextView`.
@MainActor public struct TextView: View {
private let make: (MountContext) -> Gtk.TextView
private var configure: [(Gtk.TextView, MountContext) -> Void] = []
public var body: Never { fatalError() }
public init() {
make = { _ in Gtk.TextView() }
}
public init(buffer: Gtk.TextBuffer) {
make = { _ in Gtk.TextView(buffer: buffer) }
}
}
extension TextView: WidgetView {
public typealias Target = Gtk.TextView
@_spi(Portico) public func appending(
_ step: @escaping (Gtk.TextView, MountContext) -> Void
) -> Self {
var c = self
c.configure.append(step)
return c
}
}
@_spi(Portico) extension TextView: Mountable {
@_spi(Portico) public func mount(_ ctx: MountContext) -> Gtk.Widget {
let w = make(ctx)
for step in configure { step(w, ctx) }
return w
}
}
/// Modifiers for `Gtk.TextView`, available on every Portico view whose
/// backing widget is `Gtk.TextView` or one of its subclasses.
extension WidgetView where Target: Gtk.TextView {
/// Sets acceptsTab (static).
public func acceptsTab(_ acceptsTab: Bool) -> Self {
appending { w, _ in
w.setAcceptsTab(acceptsTab: acceptsTab)
}
}
/// Sets acceptsTab (reactive, binding).
public func acceptsTab(_ acceptsTab: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
w.setAcceptsTab(acceptsTab: acceptsTab.wrappedValue)
ctx.registry.add(acceptsTab.subscribe { [w] v in w.setAcceptsTab(acceptsTab: v) })
}
}
/// Sets acceptsTab (reactive, tracked closure).
public func acceptsTab(_ acceptsTab: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setAcceptsTab(acceptsTab: acceptsTab()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets bottomMargin (static).
public func bottomMargin(_ bottomMargin: Int32) -> Self {
appending { w, _ in
w.setBottomMargin(bottomMargin: bottomMargin)
}
}
/// Sets bottomMargin (reactive, binding).
public func bottomMargin(_ bottomMargin: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
w.setBottomMargin(bottomMargin: bottomMargin.wrappedValue)
ctx.registry.add(bottomMargin.subscribe { [w] v in w.setBottomMargin(bottomMargin: v) })
}
}
/// Sets bottomMargin (reactive, tracked closure).
public func bottomMargin(_ bottomMargin: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setBottomMargin(bottomMargin: bottomMargin()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets cursorVisible (static).
public func cursorVisible(_ cursorVisible: Bool) -> Self {
appending { w, _ in
w.setCursorVisible(setting: cursorVisible)
}
}
/// Sets cursorVisible (reactive, binding).
public func cursorVisible(_ cursorVisible: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
w.setCursorVisible(setting: cursorVisible.wrappedValue)
ctx.registry.add(cursorVisible.subscribe { [w] v in w.setCursorVisible(setting: v) })
}
}
/// Sets cursorVisible (reactive, tracked closure).
public func cursorVisible(_ cursorVisible: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setCursorVisible(setting: cursorVisible()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets editable (static).
public func editable(_ editable: Bool) -> Self {
appending { w, _ in
w.setEditable(setting: editable)
}
}
/// Sets editable (reactive, binding).
public func editable(_ editable: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
w.setEditable(setting: editable.wrappedValue)
ctx.registry.add(editable.subscribe { [w] v in w.setEditable(setting: v) })
}
}
/// Sets editable (reactive, tracked closure).
public func editable(_ editable: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setEditable(setting: editable()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets extraMenu (static).
public func extraMenu(_ extraMenu: Gtk.MenuModel?) -> Self {
appending { w, _ in
w.setExtraMenu(model: extraMenu)
}
}
/// Sets extraMenu (reactive, binding).
public func extraMenu(_ extraMenu: Portico.Binding<Gtk.MenuModel?>) -> Self {
appending { w, ctx in
w.setExtraMenu(model: extraMenu.wrappedValue)
ctx.registry.add(extraMenu.subscribe { [w] v in w.setExtraMenu(model: v) })
}
}
/// Sets extraMenu from a non-optional binding (reactive, binding).
///
/// `Binding` is invariant, so a `Binding<Gtk.MenuModel>` is not accepted by the
/// nullable overload; this one takes it and promotes each value. Pass a
/// `Binding<Gtk.MenuModel?>` to be able to clear the property.
public func extraMenu(_ extraMenu: Portico.Binding<Gtk.MenuModel>) -> Self {
appending { w, ctx in
w.setExtraMenu(model: extraMenu.wrappedValue)
ctx.registry.add(extraMenu.subscribe { [w] v in w.setExtraMenu(model: v) })
}
}
/// Sets extraMenu (reactive, tracked closure).
public func extraMenu(_ extraMenu: @escaping () -> Gtk.MenuModel?) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setExtraMenu(model: extraMenu()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets indent (static).
public func indent(_ indent: Int32) -> Self {
appending { w, _ in
w.setIndent(indent: indent)
}
}
/// Sets indent (reactive, binding).
public func indent(_ indent: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
w.setIndent(indent: indent.wrappedValue)
ctx.registry.add(indent.subscribe { [w] v in w.setIndent(indent: v) })
}
}
/// Sets indent (reactive, tracked closure).
public func indent(_ indent: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setIndent(indent: indent()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets inputHints (static).
public func inputHints(_ inputHints: Gtk.InputHints) -> Self {
appending { w, _ in
w.setInputHints(hints: inputHints)
}
}
/// Sets inputHints (reactive, binding).
public func inputHints(_ inputHints: Portico.Binding<Gtk.InputHints>) -> Self {
appending { w, ctx in
w.setInputHints(hints: inputHints.wrappedValue)
ctx.registry.add(inputHints.subscribe { [w] v in w.setInputHints(hints: v) })
}
}
/// Sets inputHints (reactive, tracked closure).
public func inputHints(_ inputHints: @escaping () -> Gtk.InputHints) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setInputHints(hints: inputHints()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets inputPurpose (static).
public func inputPurpose(_ inputPurpose: Gtk.InputPurpose) -> Self {
appending { w, _ in
w.setInputPurpose(purpose: inputPurpose)
}
}
/// Sets inputPurpose (reactive, binding).
public func inputPurpose(_ inputPurpose: Portico.Binding<Gtk.InputPurpose>) -> Self {
appending { w, ctx in
w.setInputPurpose(purpose: inputPurpose.wrappedValue)
ctx.registry.add(inputPurpose.subscribe { [w] v in w.setInputPurpose(purpose: v) })
}
}
/// Sets inputPurpose (reactive, tracked closure).
public func inputPurpose(_ inputPurpose: @escaping () -> Gtk.InputPurpose) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setInputPurpose(purpose: inputPurpose()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets justification (static).
public func justification(_ justification: Gtk.Justification) -> Self {
appending { w, _ in
w.setJustification(justification: justification)
}
}
/// Sets justification (reactive, binding).
public func justification(_ justification: Portico.Binding<Gtk.Justification>) -> Self {
appending { w, ctx in
w.setJustification(justification: justification.wrappedValue)
ctx.registry.add(justification.subscribe { [w] v in w.setJustification(justification: v) })
}
}
/// Sets justification (reactive, tracked closure).
public func justification(_ justification: @escaping () -> Gtk.Justification) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setJustification(justification: justification()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets leftMargin (static).
public func leftMargin(_ leftMargin: Int32) -> Self {
appending { w, _ in
w.setLeftMargin(leftMargin: leftMargin)
}
}
/// Sets leftMargin (reactive, binding).
public func leftMargin(_ leftMargin: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
w.setLeftMargin(leftMargin: leftMargin.wrappedValue)
ctx.registry.add(leftMargin.subscribe { [w] v in w.setLeftMargin(leftMargin: v) })
}
}
/// Sets leftMargin (reactive, tracked closure).
public func leftMargin(_ leftMargin: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setLeftMargin(leftMargin: leftMargin()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets monospace (static).
public func monospace(_ monospace: Bool) -> Self {
appending { w, _ in
w.setMonospace(monospace: monospace)
}
}
/// Sets monospace (reactive, binding).
public func monospace(_ monospace: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
w.setMonospace(monospace: monospace.wrappedValue)
ctx.registry.add(monospace.subscribe { [w] v in w.setMonospace(monospace: v) })
}
}
/// Sets monospace (reactive, tracked closure).
public func monospace(_ monospace: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setMonospace(monospace: monospace()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets overwrite (static).
public func overwrite(_ overwrite: Bool) -> Self {
appending { w, _ in
w.setOverwrite(overwrite: overwrite)
}
}
/// Sets overwrite (reactive, binding).
public func overwrite(_ overwrite: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
w.setOverwrite(overwrite: overwrite.wrappedValue)
ctx.registry.add(overwrite.subscribe { [w] v in w.setOverwrite(overwrite: v) })
}
}
/// Sets overwrite (reactive, tracked closure).
public func overwrite(_ overwrite: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setOverwrite(overwrite: overwrite()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets pixelsAboveLines (static).
public func pixelsAboveLines(_ pixelsAboveLines: Int32) -> Self {
appending { w, _ in
w.setPixelsAboveLines(pixelsAboveLines: pixelsAboveLines)
}
}
/// Sets pixelsAboveLines (reactive, binding).
public func pixelsAboveLines(_ pixelsAboveLines: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
w.setPixelsAboveLines(pixelsAboveLines: pixelsAboveLines.wrappedValue)
ctx.registry.add(pixelsAboveLines.subscribe { [w] v in w.setPixelsAboveLines(pixelsAboveLines: v) })
}
}
/// Sets pixelsAboveLines (reactive, tracked closure).
public func pixelsAboveLines(_ pixelsAboveLines: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setPixelsAboveLines(pixelsAboveLines: pixelsAboveLines()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets pixelsBelowLines (static).
public func pixelsBelowLines(_ pixelsBelowLines: Int32) -> Self {
appending { w, _ in
w.setPixelsBelowLines(pixelsBelowLines: pixelsBelowLines)
}
}
/// Sets pixelsBelowLines (reactive, binding).
public func pixelsBelowLines(_ pixelsBelowLines: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
w.setPixelsBelowLines(pixelsBelowLines: pixelsBelowLines.wrappedValue)
ctx.registry.add(pixelsBelowLines.subscribe { [w] v in w.setPixelsBelowLines(pixelsBelowLines: v) })
}
}
/// Sets pixelsBelowLines (reactive, tracked closure).
public func pixelsBelowLines(_ pixelsBelowLines: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setPixelsBelowLines(pixelsBelowLines: pixelsBelowLines()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets pixelsInsideWrap (static).
public func pixelsInsideWrap(_ pixelsInsideWrap: Int32) -> Self {
appending { w, _ in
w.setPixelsInsideWrap(pixelsInsideWrap: pixelsInsideWrap)
}
}
/// Sets pixelsInsideWrap (reactive, binding).
public func pixelsInsideWrap(_ pixelsInsideWrap: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
w.setPixelsInsideWrap(pixelsInsideWrap: pixelsInsideWrap.wrappedValue)
ctx.registry.add(pixelsInsideWrap.subscribe { [w] v in w.setPixelsInsideWrap(pixelsInsideWrap: v) })
}
}
/// Sets pixelsInsideWrap (reactive, tracked closure).
public func pixelsInsideWrap(_ pixelsInsideWrap: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setPixelsInsideWrap(pixelsInsideWrap: pixelsInsideWrap()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets rightMargin (static).
public func rightMargin(_ rightMargin: Int32) -> Self {
appending { w, _ in
w.setRightMargin(rightMargin: rightMargin)
}
}
/// Sets rightMargin (reactive, binding).
public func rightMargin(_ rightMargin: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
w.setRightMargin(rightMargin: rightMargin.wrappedValue)
ctx.registry.add(rightMargin.subscribe { [w] v in w.setRightMargin(rightMargin: v) })
}
}
/// Sets rightMargin (reactive, tracked closure).
public func rightMargin(_ rightMargin: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setRightMargin(rightMargin: rightMargin()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets tabs (static).
public func tabs(_ tabs: Gtk.TabArray) -> Self {
appending { w, _ in
w.setTabs(tabs: tabs)
}
}
/// Sets tabs (reactive, binding).
public func tabs(_ tabs: Portico.Binding<Gtk.TabArray>) -> Self {
appending { w, ctx in
w.setTabs(tabs: tabs.wrappedValue)
ctx.registry.add(tabs.subscribe { [w] v in w.setTabs(tabs: v) })
}
}
/// Sets tabs (reactive, tracked closure).
public func tabs(_ tabs: @escaping () -> Gtk.TabArray) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setTabs(tabs: tabs()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets topMargin (static).
public func topMargin(_ topMargin: Int32) -> Self {
appending { w, _ in
w.setTopMargin(topMargin: topMargin)
}
}
/// Sets topMargin (reactive, binding).
public func topMargin(_ topMargin: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
w.setTopMargin(topMargin: topMargin.wrappedValue)
ctx.registry.add(topMargin.subscribe { [w] v in w.setTopMargin(topMargin: v) })
}
}
/// Sets topMargin (reactive, tracked closure).
public func topMargin(_ topMargin: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setTopMargin(topMargin: topMargin()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Sets wrapMode (static).
public func wrapMode(_ wrapMode: Gtk.WrapMode) -> Self {
appending { w, _ in
w.setWrapMode(wrapMode: wrapMode)
}
}
/// Sets wrapMode (reactive, binding).
public func wrapMode(_ wrapMode: Portico.Binding<Gtk.WrapMode>) -> Self {
appending { w, ctx in
w.setWrapMode(wrapMode: wrapMode.wrappedValue)
ctx.registry.add(wrapMode.subscribe { [w] v in w.setWrapMode(wrapMode: v) })
}
}
/// Sets wrapMode (reactive, tracked closure).
public func wrapMode(_ wrapMode: @escaping () -> Gtk.WrapMode) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setWrapMode(wrapMode: wrapMode()) }
tracker.run()
ctx.registry.add(tracker)
}
}
/// Connects the `Backspace` signal.
public func onBackspace(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectBackspace { _ in handler() })
}
}
/// Connects the `CopyClipboard` signal.
public func onCopyClipboard(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectCopyClipboard { _ in handler() })
}
}
/// Connects the `CutClipboard` signal.
public func onCutClipboard(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectCutClipboard { _ in handler() })
}
}
/// Connects the `DeleteFromCursor` signal.
public func onDeleteFromCursor(_ handler: @escaping (Gtk.DeleteType, Int32) -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectDeleteFromCursor { _, a0, a1 in handler(a0, a1) })
}
}
/// Connects the `ExtendSelection` signal.
public func onExtendSelection(_ handler: @escaping (Gtk.TextExtendSelection, Gtk.TextIter, Gtk.TextIter, Gtk.TextIter) -> Bool) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectExtendSelection { _, a0, a1, a2, a3 in handler(a0, a1, a2, a3) })
}
}
/// Connects the `InsertAtCursor` signal.
public func onInsertAtCursor(_ handler: @escaping (String) -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectInsertAtCursor { _, a0 in handler(a0) })
}
}
/// Connects the `InsertEmoji` signal.
public func onInsertEmoji(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectInsertEmoji { _ in handler() })
}
}
/// Connects the `MoveCursor` signal.
public func onMoveCursor(_ handler: @escaping (Gtk.MovementStep, Int32, Bool) -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectMoveCursor { _, a0, a1, a2 in handler(a0, a1, a2) })
}
}
/// Connects the `MoveViewport` signal.
public func onMoveViewport(_ handler: @escaping (Gtk.ScrollStep, Int32) -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectMoveViewport { _, a0, a1 in handler(a0, a1) })
}
}
/// Connects the `PasteClipboard` signal.
public func onPasteClipboard(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectPasteClipboard { _ in handler() })
}
}
/// Connects the `PreeditChanged` signal.
public func onPreeditChanged(_ handler: @escaping (String) -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectPreeditChanged { _, a0 in handler(a0) })
}
}
/// Connects the `SelectAll` signal.
public func onSelectAll(_ handler: @escaping (Bool) -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectSelectAll { _, a0 in handler(a0) })
}
}
/// Connects the `SetAnchor` signal.
public func onSetAnchor(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectSetAnchor { _ in handler() })
}
}
/// Connects the `ToggleCursorVisible` signal.
public func onToggleCursorVisible(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectToggleCursorVisible { _ in handler() })
}
}
/// Connects the `ToggleOverwrite` signal.
public func onToggleOverwrite(_ handler: @escaping () -> Void) -> Self {
appending { w, ctx in
ctx.registry.add(w.connectToggleOverwrite { _ in handler() })
}
}
}