portico/Sources/Portico/Generated/PrintUnixDialog.swift

562 lines
37 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.PrintUnixDialog
/// A print dialog for platforms which dont provide a native
/// print dialog, like Unix.
///
/// <picture>
/// <source srcset="printdialog-dark.png" media="(prefers-color-scheme: dark)">
/// <img alt="An example GtkPrintUnixDialog" src="printdialog.png">
/// </picture>
///
/// It can be used very much like any other GTK dialog, at the cost of
/// the portability offered by the high-level printing API with
/// [class`Gtk`.PrintOperation].
///
/// In order to print something with `GtkPrintUnixDialog`, you need to
/// use [method`Gtk`.PrintUnixDialog.get_selected_printer] to obtain a
/// [class`Gtk`.Printer] object and use it to construct a [class`Gtk`.PrintJob]
/// using [ctor`Gtk`.PrintJob.new].
///
/// `GtkPrintUnixDialog` uses the following response values:
///
/// - `GTK_RESPONSE_OK`: for the Print button
/// - `GTK_RESPONSE_APPLY`: for the Preview button
/// - `GTK_RESPONSE_CANCEL`: for the Cancel button
///
/// # GtkPrintUnixDialog as GtkBuildable
///
/// The `GtkPrintUnixDialog` implementation of the `GtkBuildable` interface
/// exposes its `notebook` internal children with the name notebook.
///
/// An example of a `GtkPrintUnixDialog` UI definition fragment:
///
/// ```xml
/// <object class="GtkPrintUnixDialog" id="dialog1">
/// <child internal-child="notebook">
/// <object class="GtkNotebook" id="notebook">
/// <child>
/// <object type="GtkNotebookPage">
/// <property name="tab_expand">False</property>
/// <property name="tab_fill">False</property>
/// <property name="tab">
/// <object class="GtkLabel" id="tablabel">
/// <property name="label">Tab label</property>
/// </object>
/// </property>
/// <property name="child">
/// <object class="GtkLabel" id="tabcontent">
/// <property name="label">Content on notebook tab</property>
/// </object>
/// </property>
/// </object>
/// </child>
/// </object>
/// </child>
/// </object>
/// ```
///
/// # CSS nodes
///
/// `GtkPrintUnixDialog` has a single CSS node with name window. The style classes
/// dialog and print are added.
///
/// A Portico view that mounts a `Gtk.PrintUnixDialog`.
@MainActor public struct PrintUnixDialog: View {
private let make: (MountContext) -> Gtk.PrintUnixDialog
private var configure: [(Gtk.PrintUnixDialog, MountContext) -> Void] = []
public var body: Never { fatalError() }
// PorticoGen: generateInits(static) | source: Gtk.PrintUnixDialog.init(title:parent:)
/// Creates a new `GtkPrintUnixDialog`.
///
/// Applied once at mount; use the `Binding`, closure, or `InterpolatedText` overload for values that change.
/// A string literal containing interpolation selects the `InterpolatedText` overload instead, which updates live.
/// Each closure is evaluated once; children are added in order and slot closures mount their first view.
/// An empty closure adds no children and leaves slots unset.
/// 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 title: The `title` value forwarded to `Gtk.PrintUnixDialog`.
/// - Parameter parent: The `parent` value forwarded to `Gtk.PrintUnixDialog`.
/// - Parameter currentPage: The current page in the document.
/// - Parameter embedPageSetup: `true` if the page setup controls are embedded.
/// - Parameter hasSelection: Whether the application has a selection.
/// - Parameter manualCapabilities: Capabilities the application can handle.
/// - Parameter pageSetup: The `GtkPageSetup` object to use.
/// - Parameter supportSelection: Whether the dialog supports selection.
/// - Parameter application: The `GtkApplication` associated with the window.
/// - Parameter decorated: Whether the window should have a frame (also known as *decorations*).
/// - Parameter deletable: Whether the window frame should have a close button.
/// - Parameter destroyWithParent: If this window should be destroyed when the parent is destroyed.
/// - Parameter display: The display that will display this window.
/// - Parameter focusVisible: Whether 'focus rectangles' are currently visible in this window.
/// - Parameter gravity: The gravity to use when resizing the window programmatically.
/// - Parameter handleMenubarAccel: Whether the window frame should handle <kbd>F10</kbd> for activating menubars.
/// - Parameter hideOnClose: If this window should be hidden instead of destroyed when the user clicks the close button.
/// - Parameter iconName: Specifies the name of the themed icon to use as the window icon.
/// - Parameter mnemonicsVisible: Whether mnemonics are currently visible in this window.
/// - Parameter modal: If true, the window is modal.
/// - Parameter resizable: If true, users can resize the window.
/// - Parameter startupId: A write-only property for setting window's startup notification identifier.
/// - Parameter transientFor: The transient parent of the window.
/// - Parameter child: A `ViewBuilder` closure whose first view is mounted into the `child` slot.
/// - Parameter defaultWidget: A `ViewBuilder` closure whose first view is mounted into the `defaultWidget` slot.
/// - Parameter focusWidget: A `ViewBuilder` closure whose first view is mounted into the `focusWidget` slot.
/// - Parameter titlebar: A `ViewBuilder` closure whose first view is mounted into the `titlebar` slot.
/// - Parameter onClose: Invoked when the widget emits the `close` signal.
/// - Parameter onResponse: Invoked when the widget emits the `response` signal. The closure receives the signal's arguments in order.
/// - Parameter onActivateDefault: Invoked when the widget emits the `activate-default` signal.
/// - Parameter onActivateFocus: Invoked when the widget emits the `activate-focus` signal.
/// - Parameter onCloseRequest: Invoked when the widget emits the `close-request` signal. Its return value is forwarded to GTK as the signal's result.
/// - Parameter onEnableDebugging: Invoked when the widget emits the `enable-debugging` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
/// - Parameter onKeysChanged: Invoked when the widget emits the `keys-changed` signal.
@_disfavoredOverload
public init<S: StringProtocol>(title: S?, parent: Gtk.Window?, currentPage: Int32? = nil, embedPageSetup: Bool? = nil, hasSelection: Bool? = nil, manualCapabilities: Gtk.PrintCapabilities? = nil, pageSetup: Gtk.PageSetup? = nil, supportSelection: Bool? = nil, application: Gtk.Application? = nil, decorated: Bool? = nil, deletable: Bool? = nil, destroyWithParent: Bool? = nil, display: Gtk.Display? = nil, focusVisible: Bool? = nil, gravity: Gtk.WindowGravity? = nil, handleMenubarAccel: Bool? = nil, hideOnClose: Bool? = nil, iconName: String? = nil, mnemonicsVisible: Bool? = nil, modal: Bool? = nil, resizable: Bool? = nil, startupId: String? = nil, transientFor: Gtk.Window? = nil, @ViewBuilder child: @escaping () -> [AnyView] = { [] }, @ViewBuilder defaultWidget: @escaping () -> [AnyView] = { [] }, @ViewBuilder focusWidget: @escaping () -> [AnyView] = { [] }, @ViewBuilder titlebar: @escaping () -> [AnyView] = { [] }, onClose: (() -> Void)? = nil, onResponse: ((Int32) -> Void)? = nil, onActivateDefault: (() -> Void)? = nil, onActivateFocus: (() -> Void)? = nil, onCloseRequest: (() -> Bool)? = nil, onEnableDebugging: ((Bool) -> Bool)? = nil, onKeysChanged: (() -> Void)? = nil) {
make = { _ in Gtk.PrintUnixDialog(title: title.map { String($0) }, parent: parent) }
configure.append { w, ctx in
if let currentPage { w.setCurrentPage(currentPage: currentPage) }
if let embedPageSetup { w.setEmbedPageSetup(embed: embedPageSetup) }
if let hasSelection { w.setHasSelection(hasSelection: hasSelection) }
if let manualCapabilities { w.setManualCapabilities(capabilities: manualCapabilities) }
if let pageSetup { w.setPageSetup(pageSetup: pageSetup) }
if let supportSelection { w.setSupportSelection(supportSelection: supportSelection) }
if let application { w.setApplication(application: application) }
if let decorated { w.setDecorated(setting: decorated) }
if let deletable { w.setDeletable(setting: deletable) }
if let destroyWithParent { w.setDestroyWithParent(setting: destroyWithParent) }
if let display { w.setDisplay(display: display) }
if let focusVisible { w.setFocusVisible(setting: focusVisible) }
if let gravity { w.setGravity(gravity: gravity) }
if let handleMenubarAccel { w.setHandleMenubarAccel(handleMenubarAccel: handleMenubarAccel) }
if let hideOnClose { w.setHideOnClose(setting: hideOnClose) }
if let iconName { w.setIconName(name: iconName) }
if let mnemonicsVisible { w.setMnemonicsVisible(setting: mnemonicsVisible) }
if let modal { w.setModal(modal: modal) }
if let resizable { w.setResizable(resizable: resizable) }
if let startupId { w.setStartupId(startupId: startupId) }
if let transientFor { w.setTransientFor(parent: transientFor) }
if let v = Portico.mountSlotChild(child, ctx, onUpdate: { v in w.setChild(child: v) }) { w.setChild(child: v) }
if let v = Portico.mountSlotChild(defaultWidget, ctx, onUpdate: { v in w.setDefaultWidget(defaultWidget: v) }) { w.setDefaultWidget(defaultWidget: v) }
if let v = Portico.mountSlotChild(focusWidget, ctx, onUpdate: { v in w.setFocus(focus: v) }) { w.setFocus(focus: v) }
if let v = Portico.mountSlotChild(titlebar, ctx, onUpdate: { v in w.setTitlebar(titlebar: v) }) { w.setTitlebar(titlebar: v) }
if let onClose { ctx.registry.add(w.connectClose { _ in onClose() }) }
if let onResponse { ctx.registry.add(w.connectResponse { _, a0 in onResponse(a0) }) }
if let onActivateDefault { ctx.registry.add(w.connectActivateDefault { _ in onActivateDefault() }) }
if let onActivateFocus { ctx.registry.add(w.connectActivateFocus { _ in onActivateFocus() }) }
if let onCloseRequest { ctx.registry.add(w.connectCloseRequest { _ in onCloseRequest() }) }
if let onEnableDebugging { ctx.registry.add(w.connectEnableDebugging { _, a0 in onEnableDebugging(a0) }) }
if let onKeysChanged { ctx.registry.add(w.connectKeysChanged { _ in onKeysChanged() }) }
}
}
// PorticoGen: generateInits(interpolation) | source: Gtk.PrintUnixDialog.init(title:parent:), Gtk.PrintUnixDialog.setTitle(title:)
/// Creates a new `GtkPrintUnixDialog`.
///
/// Interpolated segments are captured unevaluated and re-read inside a `DependencyTracker`, so any `@State` they read pushes a new value through `Gtk.PrintUnixDialog.setTitle(title:)`. A literal with no interpolation is applied once, with no subscription.
/// Each closure is evaluated once; children are added in order and slot closures mount their first view.
/// An empty closure adds no children and leaves slots unset.
/// 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 title: The `title` value forwarded to `Gtk.PrintUnixDialog`.
/// - Parameter parent: The `parent` value forwarded to `Gtk.PrintUnixDialog`.
/// - Parameter currentPage: The current page in the document.
/// - Parameter embedPageSetup: `true` if the page setup controls are embedded.
/// - Parameter hasSelection: Whether the application has a selection.
/// - Parameter manualCapabilities: Capabilities the application can handle.
/// - Parameter pageSetup: The `GtkPageSetup` object to use.
/// - Parameter supportSelection: Whether the dialog supports selection.
/// - Parameter application: The `GtkApplication` associated with the window.
/// - Parameter decorated: Whether the window should have a frame (also known as *decorations*).
/// - Parameter deletable: Whether the window frame should have a close button.
/// - Parameter destroyWithParent: If this window should be destroyed when the parent is destroyed.
/// - Parameter display: The display that will display this window.
/// - Parameter focusVisible: Whether 'focus rectangles' are currently visible in this window.
/// - Parameter gravity: The gravity to use when resizing the window programmatically.
/// - Parameter handleMenubarAccel: Whether the window frame should handle <kbd>F10</kbd> for activating menubars.
/// - Parameter hideOnClose: If this window should be hidden instead of destroyed when the user clicks the close button.
/// - Parameter iconName: Specifies the name of the themed icon to use as the window icon.
/// - Parameter mnemonicsVisible: Whether mnemonics are currently visible in this window.
/// - Parameter modal: If true, the window is modal.
/// - Parameter resizable: If true, users can resize the window.
/// - Parameter startupId: A write-only property for setting window's startup notification identifier.
/// - Parameter transientFor: The transient parent of the window.
/// - Parameter child: A `ViewBuilder` closure whose first view is mounted into the `child` slot.
/// - Parameter defaultWidget: A `ViewBuilder` closure whose first view is mounted into the `defaultWidget` slot.
/// - Parameter focusWidget: A `ViewBuilder` closure whose first view is mounted into the `focusWidget` slot.
/// - Parameter titlebar: A `ViewBuilder` closure whose first view is mounted into the `titlebar` slot.
/// - Parameter onClose: Invoked when the widget emits the `close` signal.
/// - Parameter onResponse: Invoked when the widget emits the `response` signal. The closure receives the signal's arguments in order.
/// - Parameter onActivateDefault: Invoked when the widget emits the `activate-default` signal.
/// - Parameter onActivateFocus: Invoked when the widget emits the `activate-focus` signal.
/// - Parameter onCloseRequest: Invoked when the widget emits the `close-request` signal. Its return value is forwarded to GTK as the signal's result.
/// - Parameter onEnableDebugging: Invoked when the widget emits the `enable-debugging` signal. The closure receives the signal's arguments in order. Its return value is forwarded to GTK as the signal's result.
/// - Parameter onKeysChanged: Invoked when the widget emits the `keys-changed` signal.
public init(title: Portico.InterpolatedText?, parent: Gtk.Window?, currentPage: Int32? = nil, embedPageSetup: Bool? = nil, hasSelection: Bool? = nil, manualCapabilities: Gtk.PrintCapabilities? = nil, pageSetup: Gtk.PageSetup? = nil, supportSelection: Bool? = nil, application: Gtk.Application? = nil, decorated: Bool? = nil, deletable: Bool? = nil, destroyWithParent: Bool? = nil, display: Gtk.Display? = nil, focusVisible: Bool? = nil, gravity: Gtk.WindowGravity? = nil, handleMenubarAccel: Bool? = nil, hideOnClose: Bool? = nil, iconName: String? = nil, mnemonicsVisible: Bool? = nil, modal: Bool? = nil, resizable: Bool? = nil, startupId: String? = nil, transientFor: Gtk.Window? = nil, @ViewBuilder child: @escaping () -> [AnyView] = { [] }, @ViewBuilder defaultWidget: @escaping () -> [AnyView] = { [] }, @ViewBuilder focusWidget: @escaping () -> [AnyView] = { [] }, @ViewBuilder titlebar: @escaping () -> [AnyView] = { [] }, onClose: (() -> Void)? = nil, onResponse: ((Int32) -> Void)? = nil, onActivateDefault: (() -> Void)? = nil, onActivateFocus: (() -> Void)? = nil, onCloseRequest: (() -> Bool)? = nil, onEnableDebugging: ((Bool) -> Bool)? = nil, onKeysChanged: (() -> Void)? = nil) {
make = { _ in Gtk.PrintUnixDialog(title: title?.untrackedText, parent: parent) }
configure.append { w, ctx in
Portico.bindOptionalInterpolation(title, registry: ctx.registry) { [w] v in w.setTitle(title: v) }
if let currentPage { w.setCurrentPage(currentPage: currentPage) }
if let embedPageSetup { w.setEmbedPageSetup(embed: embedPageSetup) }
if let hasSelection { w.setHasSelection(hasSelection: hasSelection) }
if let manualCapabilities { w.setManualCapabilities(capabilities: manualCapabilities) }
if let pageSetup { w.setPageSetup(pageSetup: pageSetup) }
if let supportSelection { w.setSupportSelection(supportSelection: supportSelection) }
if let application { w.setApplication(application: application) }
if let decorated { w.setDecorated(setting: decorated) }
if let deletable { w.setDeletable(setting: deletable) }
if let destroyWithParent { w.setDestroyWithParent(setting: destroyWithParent) }
if let display { w.setDisplay(display: display) }
if let focusVisible { w.setFocusVisible(setting: focusVisible) }
if let gravity { w.setGravity(gravity: gravity) }
if let handleMenubarAccel { w.setHandleMenubarAccel(handleMenubarAccel: handleMenubarAccel) }
if let hideOnClose { w.setHideOnClose(setting: hideOnClose) }
if let iconName { w.setIconName(name: iconName) }
if let mnemonicsVisible { w.setMnemonicsVisible(setting: mnemonicsVisible) }
if let modal { w.setModal(modal: modal) }
if let resizable { w.setResizable(resizable: resizable) }
if let startupId { w.setStartupId(startupId: startupId) }
if let transientFor { w.setTransientFor(parent: transientFor) }
if let v = Portico.mountSlotChild(child, ctx, onUpdate: { v in w.setChild(child: v) }) { w.setChild(child: v) }
if let v = Portico.mountSlotChild(defaultWidget, ctx, onUpdate: { v in w.setDefaultWidget(defaultWidget: v) }) { w.setDefaultWidget(defaultWidget: v) }
if let v = Portico.mountSlotChild(focusWidget, ctx, onUpdate: { v in w.setFocus(focus: v) }) { w.setFocus(focus: v) }
if let v = Portico.mountSlotChild(titlebar, ctx, onUpdate: { v in w.setTitlebar(titlebar: v) }) { w.setTitlebar(titlebar: v) }
if let onClose { ctx.registry.add(w.connectClose { _ in onClose() }) }
if let onResponse { ctx.registry.add(w.connectResponse { _, a0 in onResponse(a0) }) }
if let onActivateDefault { ctx.registry.add(w.connectActivateDefault { _ in onActivateDefault() }) }
if let onActivateFocus { ctx.registry.add(w.connectActivateFocus { _ in onActivateFocus() }) }
if let onCloseRequest { ctx.registry.add(w.connectCloseRequest { _ in onCloseRequest() }) }
if let onEnableDebugging { ctx.registry.add(w.connectEnableDebugging { _, a0 in onEnableDebugging(a0) }) }
if let onKeysChanged { ctx.registry.add(w.connectKeysChanged { _ in onKeysChanged() }) }
}
}
}
extension PrintUnixDialog: WidgetView {
public typealias Target = Gtk.PrintUnixDialog
@_spi(Portico) public func appending(
_ step: @escaping (Gtk.PrintUnixDialog, MountContext) -> Void
) -> Self {
var c = self
c.configure.append(step)
return c
}
}
@_spi(Portico) extension PrintUnixDialog: 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.PrintUnixDialog
/// Modifiers for `Gtk.PrintUnixDialog`, available on every Portico view whose
/// backing widget is `Gtk.PrintUnixDialog` or one of its subclasses.
extension WidgetView where Target: Gtk.PrintUnixDialog {
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.PrintUnixDialog.setCurrentPage(currentPage:)
/// Sets the current page number.
///
/// If `current_page` is not -1, this enables the current page choice
/// for the range of pages to print.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter currentPage: The current page in the document.
/// - Returns: A copy of this view with the modifier applied.
public func currentPage(_ currentPage: Int32) -> Self {
appending { w, _ in
w.setCurrentPage(currentPage: currentPage)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.PrintUnixDialog.setCurrentPage(currentPage:), GObject.Object.connectNotify(detail:_:), Gtk.PrintUnixDialog.getCurrentPage()
/// Sets the current page number.
///
/// If `current_page` is not -1, this enables the current page choice
/// for the range of pages to print.
///
/// 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 currentPage(_ currentPage: Portico.Binding<Int32>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, currentPage, registry: ctx.registry, notifyDetail: "current-page",
read: { [w] in w.getCurrentPage() },
write: { [w] v in w.setCurrentPage(currentPage: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.PrintUnixDialog.setCurrentPage(currentPage:)
/// Sets the current page number.
///
/// If `current_page` is not -1, this enables the current page choice
/// for the range of pages to print.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.PrintUnixDialog.setCurrentPage(currentPage:)`.
///
/// - Parameter currentPage: The current page in the document.
/// - Returns: A copy of this view with the modifier applied.
public func currentPage(_ currentPage: @escaping () -> Int32) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setCurrentPage(currentPage: currentPage()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.PrintUnixDialog.setEmbedPageSetup(embed:)
/// Embed page size combo box and orientation combo box into page setup page.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter embedPageSetup: `true` if the page setup controls are embedded.
/// - Returns: A copy of this view with the modifier applied.
public func embedPageSetup(_ embedPageSetup: Bool) -> Self {
appending { w, _ in
w.setEmbedPageSetup(embed: embedPageSetup)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.PrintUnixDialog.setEmbedPageSetup(embed:), GObject.Object.connectNotify(detail:_:), Gtk.PrintUnixDialog.getEmbedPageSetup()
/// Embed page size combo box and orientation combo box into page setup page.
///
/// 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 embedPageSetup(_ embedPageSetup: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, embedPageSetup, registry: ctx.registry, notifyDetail: "embed-page-setup",
read: { [w] in w.getEmbedPageSetup() },
write: { [w] v in w.setEmbedPageSetup(embed: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.PrintUnixDialog.setEmbedPageSetup(embed:)
/// Embed page size combo box and orientation combo box into page setup page.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.PrintUnixDialog.setEmbedPageSetup(embed:)`.
///
/// - Parameter embedPageSetup: `true` if the page setup controls are embedded.
/// - Returns: A copy of this view with the modifier applied.
public func embedPageSetup(_ embedPageSetup: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setEmbedPageSetup(embed: embedPageSetup()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.PrintUnixDialog.setHasSelection(hasSelection:)
/// Sets whether a selection exists.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter hasSelection: Whether the application has a selection.
/// - Returns: A copy of this view with the modifier applied.
public func hasSelection(_ hasSelection: Bool) -> Self {
appending { w, _ in
w.setHasSelection(hasSelection: hasSelection)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.PrintUnixDialog.setHasSelection(hasSelection:), GObject.Object.connectNotify(detail:_:), Gtk.PrintUnixDialog.getHasSelection()
/// Sets whether a selection exists.
///
/// 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 hasSelection(_ hasSelection: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, hasSelection, registry: ctx.registry, notifyDetail: "has-selection",
read: { [w] in w.getHasSelection() },
write: { [w] v in w.setHasSelection(hasSelection: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.PrintUnixDialog.setHasSelection(hasSelection:)
/// Sets whether a selection exists.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.PrintUnixDialog.setHasSelection(hasSelection:)`.
///
/// - Parameter hasSelection: Whether the application has a selection.
/// - Returns: A copy of this view with the modifier applied.
public func hasSelection(_ hasSelection: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setHasSelection(hasSelection: hasSelection()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.PrintUnixDialog.setManualCapabilities(capabilities:)
/// This lets you specify the printing capabilities your application
/// supports.
///
/// For instance, if you can handle scaling the output then you pass
/// `GTK_PRINT_CAPABILITY_SCALE`. If you dont pass that, then the dialog
/// will only let you select the scale if the printing system automatically
/// handles scaling.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter manualCapabilities: Capabilities the application can handle.
/// - Returns: A copy of this view with the modifier applied.
public func manualCapabilities(_ manualCapabilities: Gtk.PrintCapabilities) -> Self {
appending { w, _ in
w.setManualCapabilities(capabilities: manualCapabilities)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.PrintUnixDialog.setManualCapabilities(capabilities:), GObject.Object.connectNotify(detail:_:), Gtk.PrintUnixDialog.getManualCapabilities()
/// This lets you specify the printing capabilities your application
/// supports.
///
/// For instance, if you can handle scaling the output then you pass
/// `GTK_PRINT_CAPABILITY_SCALE`. If you dont pass that, then the dialog
/// will only let you select the scale if the printing system automatically
/// handles scaling.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Gtk.PrintCapabilities` 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 manualCapabilities(_ manualCapabilities: Portico.Binding<Gtk.PrintCapabilities>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, manualCapabilities, registry: ctx.registry, notifyDetail: "manual-capabilities",
read: { [w] in w.getManualCapabilities() },
write: { [w] v in w.setManualCapabilities(capabilities: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.PrintUnixDialog.setManualCapabilities(capabilities:)
/// This lets you specify the printing capabilities your application
/// supports.
///
/// For instance, if you can handle scaling the output then you pass
/// `GTK_PRINT_CAPABILITY_SCALE`. If you dont pass that, then the dialog
/// will only let you select the scale if the printing system automatically
/// handles scaling.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.PrintUnixDialog.setManualCapabilities(capabilities:)`.
///
/// - Parameter manualCapabilities: Capabilities the application can handle.
/// - Returns: A copy of this view with the modifier applied.
public func manualCapabilities(_ manualCapabilities: @escaping () -> Gtk.PrintCapabilities) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setManualCapabilities(capabilities: manualCapabilities()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.PrintUnixDialog.setPageSetup(pageSetup:)
/// Sets the page setup of the `GtkPrintUnixDialog`.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter pageSetup: The `GtkPageSetup` object to use.
/// - Returns: A copy of this view with the modifier applied.
public func pageSetup(_ pageSetup: Gtk.PageSetup) -> Self {
appending { w, _ in
w.setPageSetup(pageSetup: pageSetup)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.PrintUnixDialog.setPageSetup(pageSetup:), GObject.Object.connectNotify(detail:_:), Gtk.PrintUnixDialog.getPageSetup()
/// Sets the page setup of the `GtkPrintUnixDialog`.
///
/// Applied at mount and re-applied on every change the binding publishes.
/// When `Gtk.PageSetup` 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 pageSetup(_ pageSetup: Portico.Binding<Gtk.PageSetup>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, pageSetup, registry: ctx.registry, notifyDetail: "page-setup",
read: { [w] in w.getPageSetup() },
write: { [w] v in w.setPageSetup(pageSetup: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.PrintUnixDialog.setPageSetup(pageSetup:)
/// Sets the page setup of the `GtkPrintUnixDialog`.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.PrintUnixDialog.setPageSetup(pageSetup:)`.
///
/// - Parameter pageSetup: The `GtkPageSetup` object to use.
/// - Returns: A copy of this view with the modifier applied.
public func pageSetup(_ pageSetup: @escaping () -> Gtk.PageSetup) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setPageSetup(pageSetup: pageSetup()) }
tracker.run()
ctx.registry.add(tracker)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(static) | source: Gtk.PrintUnixDialog.setSupportSelection(supportSelection:)
/// Sets whether the print dialog allows user to print a selection.
///
/// Applied once at mount; use the `Binding` or closure overload for a value that changes.
///
/// - Parameter supportSelection: Whether the dialog supports selection.
/// - Returns: A copy of this view with the modifier applied.
public func supportSelection(_ supportSelection: Bool) -> Self {
appending { w, _ in
w.setSupportSelection(supportSelection: supportSelection)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers -> bindingModifier(twoWay) | source: Gtk.PrintUnixDialog.setSupportSelection(supportSelection:), GObject.Object.connectNotify(detail:_:), Gtk.PrintUnixDialog.getSupportSelection()
/// Sets whether the print dialog allows user to print a selection.
///
/// 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 supportSelection(_ supportSelection: Portico.Binding<Bool>) -> Self {
appending { w, ctx in
Portico.bindProperty(
w, supportSelection, registry: ctx.registry, notifyDetail: "support-selection",
read: { [w] in w.getSupportSelection() },
write: { [w] v in w.setSupportSelection(supportSelection: v) }
)
}
}
// PorticoGen: generateModifierExtension -> generatePropertyModifiers(closure) | source: Gtk.PrintUnixDialog.setSupportSelection(supportSelection:)
/// Sets whether the print dialog allows user to print a selection.
///
/// The closure runs inside a `DependencyTracker`, so any `@State` it reads re-runs it and pushes the new value through `Gtk.PrintUnixDialog.setSupportSelection(supportSelection:)`.
///
/// - Parameter supportSelection: Whether the dialog supports selection.
/// - Returns: A copy of this view with the modifier applied.
public func supportSelection(_ supportSelection: @escaping () -> Bool) -> Self {
appending { w, ctx in
let tracker = DependencyTracker { [w] in w.setSupportSelection(supportSelection: supportSelection()) }
tracker.run()
ctx.registry.add(tracker)
}
}
}