Enhance support for signals

This commit is contained in:
david-swift 2024-01-29 22:28:44 +01:00
parent db8d667238
commit 8d05d22dc6
39 changed files with 90 additions and 78 deletions

View File

@ -41,6 +41,10 @@ The app icon.
The app's website.
### `issues`
The link for opening issues.
### `path`
The path to the app data file.
@ -74,6 +78,12 @@ Set the app's website.
- Parameter url: The app's website.
- Returns: The window.
### `issues(_:)`
Set the app's website.
- Parameter url: The URL to the issue tracker.
- Returns: The window.
### `createWindow(app:)`
Get the storage for the window.

View File

@ -2,7 +2,7 @@
// ActionRow.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -145,7 +145,7 @@ public struct ActionRow: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let activated {
storage.connectSignal(name: "activated") {
storage.connectSignal(name: "activated", argCount: 0) {
activated()
}
}

View File

@ -2,7 +2,7 @@
// Avatar.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// Banner.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -86,7 +86,7 @@ public struct Banner: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let buttonClicked {
storage.connectSignal(name: "button-clicked") {
storage.connectSignal(name: "button-clicked", argCount: 0) {
buttonClicked()
}
}

View File

@ -2,7 +2,7 @@
// Bin.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// Box.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// Button.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -108,12 +108,12 @@ public struct Button: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let activate {
storage.connectSignal(name: "activate") {
storage.connectSignal(name: "activate", argCount: 0) {
activate()
}
}
if let clicked {
storage.connectSignal(name: "clicked") {
storage.connectSignal(name: "clicked", argCount: 0) {
clicked()
}
}

View File

@ -2,7 +2,7 @@
// ButtonContent.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// Carousel.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -95,7 +95,7 @@ public struct Carousel<Element>: Widget where Element: Identifiable {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let pageChanged {
storage.connectSignal(name: "page-changed") {
storage.connectSignal(name: "page-changed", argCount: 1) {
pageChanged()
}
}

View File

@ -2,7 +2,7 @@
// CenterBox.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// CheckButton.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -140,12 +140,12 @@ public struct CheckButton: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let activate {
storage.connectSignal(name: "activate") {
storage.connectSignal(name: "activate", argCount: 0) {
activate()
}
}
if let toggled {
storage.connectSignal(name: "toggled") {
storage.connectSignal(name: "toggled", argCount: 0) {
toggled()
}
}

View File

@ -2,7 +2,7 @@
// Clamp.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// ComboRow.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -172,7 +172,7 @@ public struct ComboRow: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let activated {
storage.connectSignal(name: "activated") {
storage.connectSignal(name: "activated", argCount: 0) {
activated()
}
}

View File

@ -2,7 +2,7 @@
// EntryRow.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -131,12 +131,12 @@ public struct EntryRow: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let apply {
storage.connectSignal(name: "apply") {
storage.connectSignal(name: "apply", argCount: 0) {
apply()
}
}
if let entryActivated {
storage.connectSignal(name: "entry-activated") {
storage.connectSignal(name: "entry-activated", argCount: 0) {
entryActivated()
}
}

View File

@ -2,7 +2,7 @@
// ExpanderRow.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// HeaderBar.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// Label.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -297,7 +297,7 @@ public struct Label: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let copyClipboard {
storage.connectSignal(name: "copy-clipboard") {
storage.connectSignal(name: "copy-clipboard", argCount: 0) {
copyClipboard()
}
}

View File

@ -2,7 +2,7 @@
// LevelBar.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -162,7 +162,7 @@ public struct LevelBar: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let offsetChanged {
storage.connectSignal(name: "offset-changed") {
storage.connectSignal(name: "offset-changed", argCount: 1) {
offsetChanged()
}
}

View File

@ -2,7 +2,7 @@
// LinkButton.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -111,12 +111,12 @@ public struct LinkButton: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let activate {
storage.connectSignal(name: "activate") {
storage.connectSignal(name: "activate", argCount: 0) {
activate()
}
}
if let clicked {
storage.connectSignal(name: "clicked") {
storage.connectSignal(name: "clicked", argCount: 0) {
clicked()
}
}

View File

@ -2,7 +2,7 @@
// ListBox.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -143,42 +143,42 @@ public struct ListBox<Element>: Widget where Element: Identifiable {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let activateCursorRow {
storage.connectSignal(name: "activate-cursor-row") {
storage.connectSignal(name: "activate-cursor-row", argCount: 0) {
activateCursorRow()
}
}
if let moveCursor {
storage.connectSignal(name: "move-cursor") {
storage.connectSignal(name: "move-cursor", argCount: 4) {
moveCursor()
}
}
if let rowActivated {
storage.connectSignal(name: "row-activated") {
storage.connectSignal(name: "row-activated", argCount: 1) {
rowActivated()
}
}
if let rowSelected {
storage.connectSignal(name: "row-selected") {
storage.connectSignal(name: "row-selected", argCount: 1) {
rowSelected()
}
}
if let selectAll {
storage.connectSignal(name: "select-all") {
storage.connectSignal(name: "select-all", argCount: 0) {
selectAll()
}
}
if let selectedRowsChanged {
storage.connectSignal(name: "selected-rows-changed") {
storage.connectSignal(name: "selected-rows-changed", argCount: 0) {
selectedRowsChanged()
}
}
if let toggleCursorRow {
storage.connectSignal(name: "toggle-cursor-row") {
storage.connectSignal(name: "toggle-cursor-row", argCount: 0) {
toggleCursorRow()
}
}
if let unselectAll {
storage.connectSignal(name: "unselect-all") {
storage.connectSignal(name: "unselect-all", argCount: 0) {
unselectAll()
}
}

View File

@ -2,7 +2,7 @@
// Menu.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -151,7 +151,7 @@ public struct Menu: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let activate {
storage.connectSignal(name: "activate") {
storage.connectSignal(name: "activate", argCount: 0) {
activate()
}
}

View File

@ -2,7 +2,7 @@
// Overlay.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -106,7 +106,7 @@ public struct Overlay: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let getChildPosition {
storage.connectSignal(name: "get-child-position") {
storage.connectSignal(name: "get-child-position", argCount: 2) {
getChildPosition()
}
}

View File

@ -2,7 +2,7 @@
// OverlaySplitView.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// PasswordEntryRow.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -116,12 +116,12 @@ public struct PasswordEntryRow: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let apply {
storage.connectSignal(name: "apply") {
storage.connectSignal(name: "apply", argCount: 0) {
apply()
}
}
if let entryActivated {
storage.connectSignal(name: "entry-activated") {
storage.connectSignal(name: "entry-activated", argCount: 0) {
entryActivated()
}
}

View File

@ -2,7 +2,7 @@
// PreferencesGroup.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// PreferencesPage.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// PreferencesRow.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// ProgressBar.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// ScrolledWindow.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -190,22 +190,22 @@ public struct ScrolledWindow: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let edgeOvershot {
storage.connectSignal(name: "edge-overshot") {
storage.connectSignal(name: "edge-overshot", argCount: 1) {
edgeOvershot()
}
}
if let edgeReached {
storage.connectSignal(name: "edge-reached") {
storage.connectSignal(name: "edge-reached", argCount: 1) {
edgeReached()
}
}
if let moveFocusOut {
storage.connectSignal(name: "move-focus-out") {
storage.connectSignal(name: "move-focus-out", argCount: 1) {
moveFocusOut()
}
}
if let scrollChild {
storage.connectSignal(name: "scroll-child") {
storage.connectSignal(name: "scroll-child", argCount: 2) {
scrollChild()
}
}

View File

@ -2,7 +2,7 @@
// SpinRow.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -164,22 +164,22 @@ public struct SpinRow: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let input {
storage.connectSignal(name: "input") {
storage.connectSignal(name: "input", argCount: 1) {
input()
}
}
if let output {
storage.connectSignal(name: "output") {
storage.connectSignal(name: "output", argCount: 0) {
output()
}
}
if let wrapped {
storage.connectSignal(name: "wrapped") {
storage.connectSignal(name: "wrapped", argCount: 0) {
wrapped()
}
}
if let activated {
storage.connectSignal(name: "activated") {
storage.connectSignal(name: "activated", argCount: 0) {
activated()
}
}

View File

@ -2,7 +2,7 @@
// Spinner.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// SplitButton.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -136,12 +136,12 @@ public struct SplitButton: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let activate {
storage.connectSignal(name: "activate") {
storage.connectSignal(name: "activate", argCount: 0) {
activate()
}
}
if let clicked {
storage.connectSignal(name: "clicked") {
storage.connectSignal(name: "clicked", argCount: 0) {
clicked()
}
}

View File

@ -2,7 +2,7 @@
// StatusPage.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// SwitchRow.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -139,7 +139,7 @@ public struct SwitchRow: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let activated {
storage.connectSignal(name: "activated") {
storage.connectSignal(name: "activated", argCount: 0) {
activated()
}
}

View File

@ -2,7 +2,7 @@
// ToastOverlay.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// ToggleButton.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw
@ -160,17 +160,17 @@ public struct ToggleButton: Widget {
/// - updateProperties: Whether to update the view's properties.
public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) {
if let toggled {
storage.connectSignal(name: "toggled") {
storage.connectSignal(name: "toggled", argCount: 0) {
toggled()
}
}
if let activate {
storage.connectSignal(name: "activate") {
storage.connectSignal(name: "activate", argCount: 0) {
activate()
}
}
if let clicked {
storage.connectSignal(name: "clicked") {
storage.connectSignal(name: "clicked", argCount: 0) {
clicked()
}
}

View File

@ -2,7 +2,7 @@
// ToolbarView.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -2,7 +2,7 @@
// WindowTitle.swift
// Adwaita
//
// Created by auto-generation on 27.01.24.
// Created by auto-generation on 29.01.24.
//
import CAdw

View File

@ -12,6 +12,8 @@ struct Signal: Decodable {
var name: String
/// The signal's documentation.
var doc: String?
/// The signal's parameters.
var parameters: Parameters?
/// Generate the signal's property.
/// - Parameters:
@ -56,7 +58,7 @@ struct Signal: Decodable {
return """
if let \(name) {
storage.connectSignal(name: "\(self.name)") {
storage.connectSignal(name: "\(self.name)", argCount: \(parameters?.parameters.count ?? 0)) {
\(name)()
}
}