From 7fb949deb799789bc59e114f7b6e09efe375bc98 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 28 Apr 2026 02:34:08 +0800 Subject: [PATCH 1/4] Fix SPM lock issue --- AG/generate_swiftinterface.sh | 19 ++++++++++++++++--- GF/generate_swiftinterface.sh | 19 ++++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/AG/generate_swiftinterface.sh b/AG/generate_swiftinterface.sh index d08b9d5..6279506 100755 --- a/AG/generate_swiftinterface.sh +++ b/AG/generate_swiftinterface.sh @@ -17,6 +17,18 @@ VERSION=${DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE:-2024} FRAMEWORK_ROOT="${SCRIPT_DIR}/${VERSION}" SHIMS_DIR="${SCRIPT_DIR}/DeviceSwiftShims" TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface" +SWIFTPM_SCRATCH_PATH=$(mktemp -d) +TMPDIR_WORK="" + +cleanup() { + if [ -n "${SWIFTPM_SCRATCH_PATH}" ]; then + rm -rf "${SWIFTPM_SCRATCH_PATH}" + fi + if [ -n "${TMPDIR_WORK}" ]; then + rm -rf "${TMPDIR_WORK}" + fi +} +trap cleanup EXIT # Verify Swift compiler version matches the expected version for this framework EXPECTED_SWIFT_VERSION="6.1" # 2024 -> 6.1, 2025 -> 6.2 @@ -28,18 +40,19 @@ if [ "${SWIFT_VERSION}" != "${EXPECTED_SWIFT_VERSION}" ]; then fi # Build package dependencies via SPM -swift build --package-path "${PACKAGE_DIR}" --target _AttributeGraphDeviceSwiftShims 2>/dev/null +# The command plugin already holds the package build lock. Use a separate +# scratch path for this nested build so update-xcframeworks does not deadlock. +swift build --package-path "${PACKAGE_DIR}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --target _AttributeGraphDeviceSwiftShims 2>/dev/null if [ $? -ne 0 ]; then echo "Error: failed to build package dependencies" exit 1 fi # Locate the SPM modules directory for import search paths -BUILD_BIN_PATH=$(swift build --package-path "${PACKAGE_DIR}" --show-bin-path 2>/dev/null) +BUILD_BIN_PATH=$(swift build --package-path "${PACKAGE_DIR}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --show-bin-path 2>/dev/null) MODULES_DIR="${BUILD_BIN_PATH}/Modules" TMPDIR_WORK=$(mktemp -d) -trap "rm -rf ${TMPDIR_WORK}" EXIT GENERATED="${TMPDIR_WORK}/generated.swiftinterface" diff --git a/GF/generate_swiftinterface.sh b/GF/generate_swiftinterface.sh index 1eff1a4..bef229f 100755 --- a/GF/generate_swiftinterface.sh +++ b/GF/generate_swiftinterface.sh @@ -17,6 +17,18 @@ VERSION=${DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE:-2025} FRAMEWORK_ROOT="${SCRIPT_DIR}/${VERSION}" SHIMS_DIR="${SCRIPT_DIR}/DeviceSwiftShims" TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/Gestures.swiftmodule/template.swiftinterface" +SWIFTPM_SCRATCH_PATH=$(mktemp -d) +TMPDIR_WORK="" + +cleanup() { + if [ -n "${SWIFTPM_SCRATCH_PATH}" ]; then + rm -rf "${SWIFTPM_SCRATCH_PATH}" + fi + if [ -n "${TMPDIR_WORK}" ]; then + rm -rf "${TMPDIR_WORK}" + fi +} +trap cleanup EXIT # Verify Swift compiler version matches the expected version for this framework EXPECTED_SWIFT_VERSION="6.2" # 2024 -> 6.1, 2025 -> 6.2 @@ -28,18 +40,19 @@ if [ "${SWIFT_VERSION}" != "${EXPECTED_SWIFT_VERSION}" ]; then fi # Build package dependencies (OrderedCollections etc.) via SPM -swift build --package-path "${PACKAGE_DIR}" --target _GesturesDeviceSwiftShims 2>/dev/null +# The command plugin already holds the package build lock. Use a separate +# scratch path for this nested build so update-xcframeworks does not deadlock. +swift build --package-path "${PACKAGE_DIR}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --target _GesturesDeviceSwiftShims 2>/dev/null if [ $? -ne 0 ]; then echo "Error: failed to build package dependencies" exit 1 fi # Locate the SPM modules directory for import search paths -BUILD_BIN_PATH=$(swift build --package-path "${PACKAGE_DIR}" --show-bin-path 2>/dev/null) +BUILD_BIN_PATH=$(swift build --package-path "${PACKAGE_DIR}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --show-bin-path 2>/dev/null) MODULES_DIR="${BUILD_BIN_PATH}/Modules" TMPDIR_WORK=$(mktemp -d) -trap "rm -rf ${TMPDIR_WORK}" EXIT GENERATED="${TMPDIR_WORK}/generated.swiftinterface" From c6d2789c153cb97d134f7b72eab620f8f50c55a2 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 28 Apr 2026 02:34:16 +0800 Subject: [PATCH 2/4] Update AG interface --- .../arm64-apple-ios-simulator.swiftinterface | 570 +++++++++--------- .../x86_64-apple-ios-simulator.swiftinterface | 570 +++++++++--------- .../arm64-apple-macos.swiftinterface | 570 +++++++++--------- .../arm64e-apple-macos.swiftinterface | 570 +++++++++--------- .../x86_64-apple-macos.swiftinterface | 570 +++++++++--------- 5 files changed, 1425 insertions(+), 1425 deletions(-) diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface index 1d97ea2..651c221 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface @@ -7,19 +7,19 @@ public import Swift public import _Concurrency public import _StringProcessing public import _SwiftConcurrencyShims -extension AnyAttribute { +extension AttributeGraph.AnyAttribute { public init(_ attribute: AttributeGraph.Attribute) public func unsafeCast(to _: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { + public static var current: AttributeGraph.AnyAttribute? { get } - public func unsafeOffset(at offset: Swift.Int) -> AnyAttribute - public func setFlags(_ newFlags: AnyAttribute.Flags, mask: AnyAttribute.Flags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Swift.Int) + public func unsafeOffset(at offset: Swift.Int) -> AttributeGraph.AnyAttribute + public func setFlags(_ newFlags: AttributeGraph.AnyAttribute.Flags, mask: AttributeGraph.AnyAttribute.Flags) + public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor public func mutateBody(as type: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Swift.Void) - public func breadthFirstSearch(options _: SearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public func breadthFirstSearch(options _: AttributeGraph.SearchOptions = [], _: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool public var _bodyType: any Any.Type { get } @@ -29,24 +29,69 @@ extension AnyAttribute { public var valueType: any Any.Type { get } - public var indirectDependency: AnyAttribute? { + public var indirectDependency: AttributeGraph.AnyAttribute? { get nonmutating set } } -extension AnyAttribute : Swift.CustomStringConvertible { +extension AttributeGraph.AnyAttribute : Swift.CustomStringConvertible { @inlinable public var description: Swift.String { get { "#\(rawValue)" } } } -public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void +public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void +@frozen public struct PointerOffset { + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) +} +extension AttributeGraph.PointerOffset { + public static func + (lhs: AttributeGraph.PointerOffset, rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset +} +extension AttributeGraph.PointerOffset { + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset +} +extension AttributeGraph.PointerOffset where Base == Member { + public init() +} +extension Swift.UnsafePointer { + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + (lhs: Swift.UnsafePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer +} +extension Swift.UnsafeMutablePointer { + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + (lhs: Swift.UnsafeMutablePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer +} +@frozen public struct External { + public init() +} +extension AttributeGraph.External : AttributeGraph._AttributeBody { + public static var comparisonMode: AttributeGraph.ComparisonMode { + get + } + public static var flags: AttributeGraph.External.Flags { + get + } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) +} +extension AttributeGraph.External : Swift.CustomStringConvertible { + public var description: Swift.String { + get + } +} @frozen @propertyWrapper @dynamicMemberLookup public struct Attribute { - public var identifier: AnyAttribute - public init(identifier: AnyAttribute) + public var identifier: AttributeGraph.AnyAttribute + public init(identifier: AttributeGraph.AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) public init(value: Value) public init(type _: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: _AttributeType.Flags = [], update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) where Body : AttributeGraph._AttributeBody + public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AttributeGraph._AttributeType.Flags = [], update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) where Body : AttributeGraph._AttributeBody public var wrappedValue: Value { unsafeAddress nonmutating set @@ -69,22 +114,22 @@ public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, An public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: SearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var graph: Graph { + public func breadthFirstSearch(options: AttributeGraph.SearchOptions = [], _ body: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var graph: AttributeGraph.Graph { get } - public var subgraph: Subgraph { + public var subgraph: AttributeGraph.Subgraph { get } public var value: Value { unsafeAddress nonmutating set } - public var valueState: ValueState { + public var valueState: AttributeGraph.ValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool) + public func valueAndFlags(options: AttributeGraph.AGValueOptions = []) -> (value: Value, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) public func setValue(_ value: Value) -> Swift.Bool public var hasValue: Swift.Bool { get @@ -93,9 +138,9 @@ public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, An public func prefetchValue() public func invalidateValue() public func validate() - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Swift.Int) - public typealias Flags = AnyAttribute.Flags + public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public typealias Flags = AttributeGraph.AnyAttribute.Flags public var flags: AttributeGraph.Attribute.Flags { get nonmutating set @@ -119,62 +164,29 @@ extension AttributeGraph.Attribute { public init(_ rule: R) where Value == R.Value, R : AttributeGraph.StatefulRule } @_silgen_name("AGGraphCreateAttribute") -@inline(__always) @inlinable internal func AGGraphCreateAttribute(index: Swift.Int, body: Swift.UnsafeRawPointer, value: Swift.UnsafeRawPointer?) -> AnyAttribute +@inline(__always) @inlinable internal func AGGraphCreateAttribute(index: Swift.Int, body: Swift.UnsafeRawPointer, value: Swift.UnsafeRawPointer?) -> AttributeGraph.AnyAttribute @_silgen_name("AGGraphGetValue") -@inline(__always) @inlinable internal func AGGraphGetValue(_ attribute: AnyAttribute, options: AGValueOptions = [], type: Value.Type = Value.self) -> AGValue +@inline(__always) @inlinable internal func AGGraphGetValue(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue @_silgen_name("AGGraphSetValue") -@inline(__always) @inlinable internal func AGGraphSetValue(_ attribute: AnyAttribute, valuePointer: Swift.UnsafePointer) -> Swift.Bool -@frozen public struct External { - public init() +@inline(__always) @inlinable internal func AGGraphSetValue(_ attribute: AttributeGraph.AnyAttribute, valuePointer: Swift.UnsafePointer) -> Swift.Bool +public protocol AttributeBodyVisitor { + func visit(body: Swift.UnsafePointer) where Body : AttributeGraph._AttributeBody } -extension AttributeGraph.External : AttributeGraph._AttributeBody { - public static var comparisonMode: ComparisonMode { - get - } - public static var flags: AttributeGraph.External.Flags { - get - } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) +public protocol ObservedAttribute : AttributeGraph._AttributeBody { + mutating func destroy() } -extension AttributeGraph.External : Swift.CustomStringConvertible { - public var description: Swift.String { +extension AttributeGraph.ObservedAttribute { + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } -@frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) -} -extension AttributeGraph.PointerOffset { - public static func + (lhs: AttributeGraph.PointerOffset, rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset where Base == Member { - public init() -} -extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (lhs: Swift.UnsafePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer -} -extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (lhs: Swift.UnsafeMutablePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer -} public protocol _AttributeBody { static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) static var _hasDestroySelf: Swift.Bool { get } static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - static var comparisonMode: ComparisonMode { get } - typealias Flags = _AttributeType.Flags + static var comparisonMode: AttributeGraph.ComparisonMode { get } + typealias Flags = AttributeGraph._AttributeType.Flags static var flags: Self.Flags { get } } extension AttributeGraph._AttributeBody { @@ -183,85 +195,148 @@ extension AttributeGraph._AttributeBody { get } public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - public static var comparisonMode: ComparisonMode { + public static var comparisonMode: AttributeGraph.ComparisonMode { get } public static var flags: Self.Flags { get } } -public protocol AttributeBodyVisitor { - func visit(body: Swift.UnsafePointer) where Body : AttributeGraph._AttributeBody -} -public protocol ObservedAttribute : AttributeGraph._AttributeBody { - mutating func destroy() -} -extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { +@frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { + internal var base: AttributeGraph.AnyWeakAttribute + public init(base: AttributeGraph.AnyWeakAttribute) + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { + public var projectedValue: AttributeGraph.Attribute? { get - nonmutating set + set + _modify } - public var dependency: AnyAttribute? { + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get - nonmutating set } - public var value: Value { + public var attribute: AttributeGraph.Attribute? { get - nonmutating set - nonmutating _modify + set } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool) - public var wrappedValue: Value { + public var value: Value? { get - nonmutating set - nonmutating _modify } - public var projectedValue: AttributeGraph.Attribute { + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? +} +extension AttributeGraph.WeakAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.WeakAttribute, b: AttributeGraph.WeakAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { +} +extension AttributeGraph.WeakAttribute : Swift.CustomStringConvertible { + public var description: Swift.String { get } } -extension AttributeGraph.IndirectAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.IndirectAttribute, b: AttributeGraph.IndirectAttribute) -> Swift.Bool +extension AttributeGraph.AnyWeakAttribute { + public init(_ attribute: AttributeGraph.AnyAttribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public func unsafeCast(to _: Value.Type) -> AttributeGraph.WeakAttribute + public var attribute: AttributeGraph.AnyAttribute? { + get + set + } +} +extension AttributeGraph.AnyWeakAttribute : Swift.Hashable { + public static func == (lhs: AttributeGraph.AnyWeakAttribute, rhs: AttributeGraph.AnyWeakAttribute) -> Swift.Bool public func hash(into hasher: inout Swift.Hasher) public var hashValue: Swift.Int { get } } -@frozen public struct AnyOptionalAttribute { - public var identifier: AnyAttribute - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public static var current: AttributeGraph.AnyOptionalAttribute { +extension AttributeGraph.AnyWeakAttribute : Swift.CustomStringConvertible { + @_alwaysEmitIntoClient public var description: Swift.String { + get { attribute?.description ?? "nil" } + } +} +public protocol Rule : AttributeGraph._AttributeBody { + associatedtype Value + static var initialValue: Self.Value? { get } + var value: Self.Value { get } +} +extension AttributeGraph.Rule { + public static var initialValue: Self.Value? { + get + } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) + public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) +} +extension AttributeGraph.Rule { + public var attribute: AttributeGraph.Attribute { get } - public var attribute: AnyAttribute? { + public var context: AttributeGraph.RuleContext { get - set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to _: Value.Type) -> AttributeGraph.OptionalAttribute } -extension AttributeGraph.AnyOptionalAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.AnyOptionalAttribute, b: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { +extension AttributeGraph.Rule where Self : Swift.Hashable { + public func cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value + public func cachedValueIfExists(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value? + public static func _cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?, hashValue: Swift.Int, bodyPtr: Swift.UnsafeRawPointer, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.UnsafePointer +} +@frozen public struct Map : AttributeGraph.Rule, Swift.CustomStringConvertible { + public var arg: AttributeGraph.Attribute + public let body: (Source) -> Value + public init(_ arg: AttributeGraph.Attribute, _ body: @escaping (Source) -> Value) + public var value: Value { + get + } + public static var flags: AttributeGraph.Map.Flags { + get + } + public var description: Swift.String { get } } -extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { +public protocol StatefulRule : AttributeGraph._AttributeBody { + associatedtype Value + static var initialValue: Self.Value? { get } + mutating func updateValue() +} +extension AttributeGraph.StatefulRule { + public static var initialValue: Self.Value? { + get + } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) + public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) +} +extension AttributeGraph.StatefulRule { + public var attribute: AttributeGraph.Attribute { + get + } + public var context: AttributeGraph.RuleContext { + get + } + public var value: Self.Value { + unsafeAddress + nonmutating set + } + public var hasValue: Swift.Bool { + get + } +} +@frozen public struct Focus : AttributeGraph.Rule, Swift.CustomStringConvertible { + public var root: AttributeGraph.Attribute + public var keyPath: Swift.KeyPath + public init(root: AttributeGraph.Attribute, keyPath: Swift.KeyPath) + public var value: Value { + get + } + public static var flags: AttributeGraph.Focus.Flags { + get + } public var description: Swift.String { get } @@ -280,7 +355,7 @@ extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? public var wrappedValue: Value? { get @@ -306,89 +381,73 @@ extension AttributeGraph.OptionalAttribute : Swift.CustomStringConvertible { get } } -@frozen public struct Focus : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var root: AttributeGraph.Attribute - public var keyPath: Swift.KeyPath - public init(root: AttributeGraph.Attribute, keyPath: Swift.KeyPath) - public var value: Value { - get - } - public static var flags: AttributeGraph.Focus.Flags { +@frozen public struct AnyOptionalAttribute { + public var identifier: AttributeGraph.AnyAttribute + public init() + public init(_ attribute: AttributeGraph.AnyAttribute) + public init(_ attribute: AttributeGraph.AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var description: Swift.String { + public var attribute: AttributeGraph.AnyAttribute? { get + set } + public func map(_ body: (AttributeGraph.AnyAttribute) -> Value) -> Value? + public func unsafeCast(to _: Value.Type) -> AttributeGraph.OptionalAttribute } -@frozen public struct Map : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var arg: AttributeGraph.Attribute - public let body: (Source) -> Value - public init(_ arg: AttributeGraph.Attribute, _ body: @escaping (Source) -> Value) - public var value: Value { - get - } - public static var flags: AttributeGraph.Map.Flags { +extension AttributeGraph.AnyOptionalAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.AnyOptionalAttribute, b: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } +} +extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { public var description: Swift.String { get } } -public protocol Rule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - var value: Self.Value { get } -} -extension AttributeGraph.Rule { - public static var initialValue: Self.Value? { +@frozen @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { + public let identifier: AttributeGraph.AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { get + nonmutating set } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { + public var dependency: AttributeGraph.AnyAttribute? { get + nonmutating set } - public var context: AttributeGraph.RuleContext { + public var value: Value { get + nonmutating set + nonmutating _modify } -} -extension AttributeGraph.Rule where Self : Swift.Hashable { - public func cachedValue(options: AGCachedValueOptions = [], owner: AnyAttribute?) -> Self.Value - public func cachedValueIfExists(options: AGCachedValueOptions = [], owner: AnyAttribute?) -> Self.Value? - public static func _cachedValue(options: AGCachedValueOptions = [], owner: AnyAttribute?, hashValue: Swift.Int, bodyPtr: Swift.UnsafeRawPointer, update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) -> Swift.UnsafePointer -} -public protocol StatefulRule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - mutating func updateValue() -} -extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) + public var wrappedValue: Value { get + nonmutating set + nonmutating _modify } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { + public var projectedValue: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public var value: Self.Value { - unsafeAddress - nonmutating set - } - public var hasValue: Swift.Bool { +} +extension AttributeGraph.IndirectAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.IndirectAttribute, b: AttributeGraph.IndirectAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } } @frozen public struct AnyRuleContext : Swift.Equatable { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) + public var attribute: AttributeGraph.AnyAttribute + public init(attribute: AttributeGraph.AnyAttribute) public init(_ context: AttributeGraph.RuleContext) public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress @@ -399,8 +458,8 @@ extension AttributeGraph.StatefulRule { public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) public func update(body: () -> Swift.Void) public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext public static func == (a: AttributeGraph.AnyRuleContext, b: AttributeGraph.AnyRuleContext) -> Swift.Bool @@ -424,86 +483,41 @@ extension AttributeGraph.StatefulRule { public var hasValue: Swift.Bool { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) public func update(body: () -> Swift.Void) public static func == (a: AttributeGraph.RuleContext, b: AttributeGraph.RuleContext) -> Swift.Bool } @_silgen_name("AGGraphGetInputValue") -@inline(__always) @inlinable internal func AGGraphGetInputValue(_ attribute: AnyAttribute, input: AnyAttribute, options: AGValueOptions = [], type: Value.Type = Value.self) -> AGValue +@inline(__always) @inlinable internal func AGGraphGetInputValue(_ attribute: AttributeGraph.AnyAttribute, input: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue @_silgen_name("AGGraphWithUpdate") -@inline(__always) @inlinable internal func AGGraphWithUpdate(_ attribute: AnyAttribute, body: () -> Swift.Void) -extension AnyWeakAttribute { - public init(_ attribute: AnyAttribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public func unsafeCast(to _: Value.Type) -> AttributeGraph.WeakAttribute - public var attribute: AnyAttribute? { - get - set - } -} -extension AnyWeakAttribute : Swift.Hashable { - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension AnyWeakAttribute : Swift.CustomStringConvertible { - @_alwaysEmitIntoClient public var description: Swift.String { - get { attribute?.description ?? "nil" } - } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - internal var base: AnyWeakAttribute - public init(base: AnyWeakAttribute) - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { - get - } - public var projectedValue: AttributeGraph.Attribute? { - get - set - _modify - } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { - get - } - public var attribute: AttributeGraph.Attribute? { - get - set - } - public var value: Value? { - get - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? +@inline(__always) @inlinable internal func AGGraphWithUpdate(_ attribute: AttributeGraph.AnyAttribute, body: () -> Swift.Void) +extension AttributeGraph.Subgraph { + public typealias Flags = AttributeGraph.AnyAttribute.Flags + public typealias ChildFlags = AttributeGraph.AnyAttribute.Flags } -extension AttributeGraph.WeakAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.WeakAttribute, b: AttributeGraph.WeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } +extension AttributeGraph.Subgraph { + public func addObserver(_ observer: @escaping () -> Swift.Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AttributeGraph.Subgraph.Flags, _ callback: (AttributeGraph.AnyAttribute) -> Swift.Void) } -extension AttributeGraph.WeakAttribute : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } +extension AttributeGraph.Subgraph { + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) } -extension Graph { - public static func typeIndex(ctx: GraphContext, body: any AttributeGraph._AttributeBody.Type, valueType: Metadata, flags: _AttributeType.Flags, update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) -> Swift.Int +extension AttributeGraph.Graph { + public static func typeIndex(ctx: AttributeGraph.GraphContext, body: any AttributeGraph._AttributeBody.Type, valueType: AttributeGraph.Metadata, flags: AttributeGraph._AttributeType.Flags, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.Int } -extension Graph { +extension AttributeGraph.Graph { public static func withoutUpdate(_ body: () -> V) -> V public func withoutSubgraphInvalidation(_ body: () -> V) -> V public func withDeadline(_: Swift.UInt64, _: () -> V) -> V - public func onInvalidation(_ callback: @escaping (AnyAttribute) -> Swift.Void) + public func onInvalidation(_ callback: @escaping (AttributeGraph.AnyAttribute) -> Swift.Void) public func onUpdate(_ callback: @escaping () -> Swift.Void) public func withMainThreadHandler(_: (() -> Swift.Void) -> Swift.Void, do: () -> Swift.Void) } -extension Graph { +extension AttributeGraph.Graph { @_transparent public func startProfiling() { __AGGraphStartProfiling(self) } @@ -517,46 +531,27 @@ extension Graph { public static func stopProfiling() public static func resetProfile() } -extension Graph { +extension AttributeGraph.Graph { @_transparent public var mainUpdates: Swift.Int { @_transparent get { numericCast(counter(for: .mainThreadUpdates)) } } } -extension Graph { +extension AttributeGraph.Graph { @_silgen_name("AGGraphGetOutputValue") @inline(__always) @inlinable public static func outputValue() -> Swift.UnsafePointer? @_silgen_name("AGGraphSetOutputValue") @inline(__always) @inlinable public static func setOutputValue(_ value: Swift.UnsafePointer) } -extension Graph { - @_transparent public static func anyInputsChanged(excluding excludedInputs: [AnyAttribute]) -> Swift.Bool { +extension AttributeGraph.Graph { + @_transparent public static func anyInputsChanged(excluding excludedInputs: [AttributeGraph.AnyAttribute]) -> Swift.Bool { return __AGGraphAnyInputsChanged(excludedInputs, excludedInputs.count) } } -extension Graph { +extension AttributeGraph.Graph { public func archiveJSON(name: Swift.String?) } -extension Subgraph { - public typealias Flags = AnyAttribute.Flags - public typealias ChildFlags = AnyAttribute.Flags -} -extension Subgraph { - public func addObserver(_ observer: @escaping () -> Swift.Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: Subgraph.Flags, _ callback: (AnyAttribute) -> Swift.Void) -} -extension Subgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) -} -public func compareValues(_ lhs: Value, _ rhs: Value, mode: ComparisonMode = .equatableAlways) -> Swift.Bool -public func compareValues(_ lhs: Value, _ rhs: Value, options: ComparisonOptions) -> Swift.Bool -extension ComparisonOptions { - public init(mode: ComparisonMode) -} public func forEachField(of type: any Any.Type, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Void) -extension Metadata : Swift.Hashable, Swift.CustomStringConvertible { +extension AttributeGraph.Metadata : Swift.Hashable, Swift.CustomStringConvertible { public init(_ type: any Any.Type) public var type: any Any.Type { get @@ -564,16 +559,12 @@ extension Metadata : Swift.Hashable, Swift.CustomStringConvertible { public var description: Swift.String { get } - public func forEachField(options: Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool + public func forEachField(options: AttributeGraph.Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool } -extension Signature : Swift.Equatable { - public static func == (lhs: Signature, rhs: Signature) -> Swift.Bool +extension AttributeGraph.Signature : Swift.Equatable { + public static func == (lhs: AttributeGraph.Signature, rhs: AttributeGraph.Signature) -> Swift.Bool } -@discardableResult -public func withUnsafePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeRawPointer) -> ()) -> Swift.Bool -@discardableResult -public func withUnsafeMutablePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeMutableRawPointer) -> ()) -> Swift.Bool -extension TupleType { +extension AttributeGraph.TupleType { @_transparent public init(_ types: [any Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } @@ -597,16 +588,16 @@ extension TupleType { @_transparent public func offset(at index: Swift.Int, as type: T.Type) -> Swift.Int { elementOffset(at: index, type: Metadata(type)) } - @_transparent public func setElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, from srcValue: Swift.UnsafePointer, options: TupleType.CopyOptions) { + @_transparent public func setElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, from srcValue: Swift.UnsafePointer, options: AttributeGraph.TupleType.CopyOptions) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - @_transparent public func getElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, to dstValue: Swift.UnsafeMutablePointer, options: TupleType.CopyOptions) { + @_transparent public func getElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, to dstValue: Swift.UnsafeMutablePointer, options: AttributeGraph.TupleType.CopyOptions) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Swift.Void) -extension UnsafeTuple { +public func withUnsafeTuple(of type: AttributeGraph.TupleType, count: Swift.Int, _ body: (AttributeGraph.UnsafeMutableTuple) -> Swift.Void) +extension AttributeGraph.UnsafeTuple { @_transparent public var count: Swift.Int { @_transparent get { type.count } } @@ -633,8 +624,8 @@ extension UnsafeTuple { @_transparent unsafeAddress { address(of: index, as: T.self) } } } -extension UnsafeMutableTuple { - @_transparent public init(with tupleType: TupleType) { +extension AttributeGraph.UnsafeMutableTuple { + @_transparent public init(with tupleType: AttributeGraph.TupleType) { self.init( type: tupleType, value: UnsafeMutableRawPointer.allocate( @@ -688,21 +679,30 @@ extension UnsafeMutableTuple { @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } } } -extension AttributeGraph.Attribute : Swift.Sendable {} -extension AttributeGraph.Attribute : Swift.BitwiseCopyable {} -extension AttributeGraph.External : Swift.Sendable {} -extension AttributeGraph.External : Swift.BitwiseCopyable {} +@discardableResult +public func withUnsafePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeRawPointer) -> ()) -> Swift.Bool +@discardableResult +public func withUnsafeMutablePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeMutableRawPointer) -> ()) -> Swift.Bool +public func compareValues(_ lhs: Value, _ rhs: Value, mode: AttributeGraph.ComparisonMode = .equatableAlways) -> Swift.Bool +public func compareValues(_ lhs: Value, _ rhs: Value, options: AttributeGraph.ComparisonOptions) -> Swift.Bool +extension AttributeGraph.ComparisonOptions { + public init(mode: AttributeGraph.ComparisonMode) +} extension AttributeGraph.PointerOffset : Swift.Sendable {} extension AttributeGraph.PointerOffset : Swift.BitwiseCopyable {} -extension AttributeGraph.IndirectAttribute : Swift.Sendable {} -extension AttributeGraph.IndirectAttribute : Swift.BitwiseCopyable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.Sendable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.External : Swift.Sendable {} +extension AttributeGraph.External : Swift.BitwiseCopyable {} +extension AttributeGraph.Attribute : Swift.Sendable {} +extension AttributeGraph.Attribute : Swift.BitwiseCopyable {} +extension AttributeGraph.WeakAttribute : Swift.Sendable {} +extension AttributeGraph.WeakAttribute : Swift.BitwiseCopyable {} extension AttributeGraph.OptionalAttribute : Swift.Sendable {} extension AttributeGraph.OptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.AnyOptionalAttribute : Swift.Sendable {} +extension AttributeGraph.AnyOptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.IndirectAttribute : Swift.Sendable {} +extension AttributeGraph.IndirectAttribute : Swift.BitwiseCopyable {} extension AttributeGraph.AnyRuleContext : Swift.Sendable {} extension AttributeGraph.AnyRuleContext : Swift.BitwiseCopyable {} extension AttributeGraph.RuleContext : Swift.Sendable {} extension AttributeGraph.RuleContext : Swift.BitwiseCopyable {} -extension AttributeGraph.WeakAttribute : Swift.Sendable {} -extension AttributeGraph.WeakAttribute : Swift.BitwiseCopyable {} diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface index 9de0ac6..ab589ac 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface @@ -7,19 +7,19 @@ public import Swift public import _Concurrency public import _StringProcessing public import _SwiftConcurrencyShims -extension AnyAttribute { +extension AttributeGraph.AnyAttribute { public init(_ attribute: AttributeGraph.Attribute) public func unsafeCast(to _: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { + public static var current: AttributeGraph.AnyAttribute? { get } - public func unsafeOffset(at offset: Swift.Int) -> AnyAttribute - public func setFlags(_ newFlags: AnyAttribute.Flags, mask: AnyAttribute.Flags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Swift.Int) + public func unsafeOffset(at offset: Swift.Int) -> AttributeGraph.AnyAttribute + public func setFlags(_ newFlags: AttributeGraph.AnyAttribute.Flags, mask: AttributeGraph.AnyAttribute.Flags) + public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor public func mutateBody(as type: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Swift.Void) - public func breadthFirstSearch(options _: SearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public func breadthFirstSearch(options _: AttributeGraph.SearchOptions = [], _: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool public var _bodyType: any Any.Type { get } @@ -29,24 +29,69 @@ extension AnyAttribute { public var valueType: any Any.Type { get } - public var indirectDependency: AnyAttribute? { + public var indirectDependency: AttributeGraph.AnyAttribute? { get nonmutating set } } -extension AnyAttribute : Swift.CustomStringConvertible { +extension AttributeGraph.AnyAttribute : Swift.CustomStringConvertible { @inlinable public var description: Swift.String { get { "#\(rawValue)" } } } -public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void +public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void +@frozen public struct PointerOffset { + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) +} +extension AttributeGraph.PointerOffset { + public static func + (lhs: AttributeGraph.PointerOffset, rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset +} +extension AttributeGraph.PointerOffset { + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset +} +extension AttributeGraph.PointerOffset where Base == Member { + public init() +} +extension Swift.UnsafePointer { + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + (lhs: Swift.UnsafePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer +} +extension Swift.UnsafeMutablePointer { + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + (lhs: Swift.UnsafeMutablePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer +} +@frozen public struct External { + public init() +} +extension AttributeGraph.External : AttributeGraph._AttributeBody { + public static var comparisonMode: AttributeGraph.ComparisonMode { + get + } + public static var flags: AttributeGraph.External.Flags { + get + } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) +} +extension AttributeGraph.External : Swift.CustomStringConvertible { + public var description: Swift.String { + get + } +} @frozen @propertyWrapper @dynamicMemberLookup public struct Attribute { - public var identifier: AnyAttribute - public init(identifier: AnyAttribute) + public var identifier: AttributeGraph.AnyAttribute + public init(identifier: AttributeGraph.AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) public init(value: Value) public init(type _: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: _AttributeType.Flags = [], update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) where Body : AttributeGraph._AttributeBody + public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AttributeGraph._AttributeType.Flags = [], update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) where Body : AttributeGraph._AttributeBody public var wrappedValue: Value { unsafeAddress nonmutating set @@ -69,22 +114,22 @@ public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, An public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: SearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var graph: Graph { + public func breadthFirstSearch(options: AttributeGraph.SearchOptions = [], _ body: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var graph: AttributeGraph.Graph { get } - public var subgraph: Subgraph { + public var subgraph: AttributeGraph.Subgraph { get } public var value: Value { unsafeAddress nonmutating set } - public var valueState: ValueState { + public var valueState: AttributeGraph.ValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool) + public func valueAndFlags(options: AttributeGraph.AGValueOptions = []) -> (value: Value, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) public func setValue(_ value: Value) -> Swift.Bool public var hasValue: Swift.Bool { get @@ -93,9 +138,9 @@ public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, An public func prefetchValue() public func invalidateValue() public func validate() - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Swift.Int) - public typealias Flags = AnyAttribute.Flags + public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public typealias Flags = AttributeGraph.AnyAttribute.Flags public var flags: AttributeGraph.Attribute.Flags { get nonmutating set @@ -119,62 +164,29 @@ extension AttributeGraph.Attribute { public init(_ rule: R) where Value == R.Value, R : AttributeGraph.StatefulRule } @_silgen_name("AGGraphCreateAttribute") -@inline(__always) @inlinable internal func AGGraphCreateAttribute(index: Swift.Int, body: Swift.UnsafeRawPointer, value: Swift.UnsafeRawPointer?) -> AnyAttribute +@inline(__always) @inlinable internal func AGGraphCreateAttribute(index: Swift.Int, body: Swift.UnsafeRawPointer, value: Swift.UnsafeRawPointer?) -> AttributeGraph.AnyAttribute @_silgen_name("AGGraphGetValue") -@inline(__always) @inlinable internal func AGGraphGetValue(_ attribute: AnyAttribute, options: AGValueOptions = [], type: Value.Type = Value.self) -> AGValue +@inline(__always) @inlinable internal func AGGraphGetValue(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue @_silgen_name("AGGraphSetValue") -@inline(__always) @inlinable internal func AGGraphSetValue(_ attribute: AnyAttribute, valuePointer: Swift.UnsafePointer) -> Swift.Bool -@frozen public struct External { - public init() +@inline(__always) @inlinable internal func AGGraphSetValue(_ attribute: AttributeGraph.AnyAttribute, valuePointer: Swift.UnsafePointer) -> Swift.Bool +public protocol AttributeBodyVisitor { + func visit(body: Swift.UnsafePointer) where Body : AttributeGraph._AttributeBody } -extension AttributeGraph.External : AttributeGraph._AttributeBody { - public static var comparisonMode: ComparisonMode { - get - } - public static var flags: AttributeGraph.External.Flags { - get - } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) +public protocol ObservedAttribute : AttributeGraph._AttributeBody { + mutating func destroy() } -extension AttributeGraph.External : Swift.CustomStringConvertible { - public var description: Swift.String { +extension AttributeGraph.ObservedAttribute { + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } -@frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) -} -extension AttributeGraph.PointerOffset { - public static func + (lhs: AttributeGraph.PointerOffset, rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset where Base == Member { - public init() -} -extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (lhs: Swift.UnsafePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer -} -extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (lhs: Swift.UnsafeMutablePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer -} public protocol _AttributeBody { static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) static var _hasDestroySelf: Swift.Bool { get } static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - static var comparisonMode: ComparisonMode { get } - typealias Flags = _AttributeType.Flags + static var comparisonMode: AttributeGraph.ComparisonMode { get } + typealias Flags = AttributeGraph._AttributeType.Flags static var flags: Self.Flags { get } } extension AttributeGraph._AttributeBody { @@ -183,85 +195,148 @@ extension AttributeGraph._AttributeBody { get } public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - public static var comparisonMode: ComparisonMode { + public static var comparisonMode: AttributeGraph.ComparisonMode { get } public static var flags: Self.Flags { get } } -public protocol AttributeBodyVisitor { - func visit(body: Swift.UnsafePointer) where Body : AttributeGraph._AttributeBody -} -public protocol ObservedAttribute : AttributeGraph._AttributeBody { - mutating func destroy() -} -extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { +@frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { + internal var base: AttributeGraph.AnyWeakAttribute + public init(base: AttributeGraph.AnyWeakAttribute) + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { + public var projectedValue: AttributeGraph.Attribute? { get - nonmutating set + set + _modify } - public var dependency: AnyAttribute? { + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get - nonmutating set } - public var value: Value { + public var attribute: AttributeGraph.Attribute? { get - nonmutating set - nonmutating _modify + set } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool) - public var wrappedValue: Value { + public var value: Value? { get - nonmutating set - nonmutating _modify } - public var projectedValue: AttributeGraph.Attribute { + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? +} +extension AttributeGraph.WeakAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.WeakAttribute, b: AttributeGraph.WeakAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { +} +extension AttributeGraph.WeakAttribute : Swift.CustomStringConvertible { + public var description: Swift.String { get } } -extension AttributeGraph.IndirectAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.IndirectAttribute, b: AttributeGraph.IndirectAttribute) -> Swift.Bool +extension AttributeGraph.AnyWeakAttribute { + public init(_ attribute: AttributeGraph.AnyAttribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public func unsafeCast(to _: Value.Type) -> AttributeGraph.WeakAttribute + public var attribute: AttributeGraph.AnyAttribute? { + get + set + } +} +extension AttributeGraph.AnyWeakAttribute : Swift.Hashable { + public static func == (lhs: AttributeGraph.AnyWeakAttribute, rhs: AttributeGraph.AnyWeakAttribute) -> Swift.Bool public func hash(into hasher: inout Swift.Hasher) public var hashValue: Swift.Int { get } } -@frozen public struct AnyOptionalAttribute { - public var identifier: AnyAttribute - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public static var current: AttributeGraph.AnyOptionalAttribute { +extension AttributeGraph.AnyWeakAttribute : Swift.CustomStringConvertible { + @_alwaysEmitIntoClient public var description: Swift.String { + get { attribute?.description ?? "nil" } + } +} +public protocol Rule : AttributeGraph._AttributeBody { + associatedtype Value + static var initialValue: Self.Value? { get } + var value: Self.Value { get } +} +extension AttributeGraph.Rule { + public static var initialValue: Self.Value? { + get + } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) + public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) +} +extension AttributeGraph.Rule { + public var attribute: AttributeGraph.Attribute { get } - public var attribute: AnyAttribute? { + public var context: AttributeGraph.RuleContext { get - set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to _: Value.Type) -> AttributeGraph.OptionalAttribute } -extension AttributeGraph.AnyOptionalAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.AnyOptionalAttribute, b: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { +extension AttributeGraph.Rule where Self : Swift.Hashable { + public func cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value + public func cachedValueIfExists(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value? + public static func _cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?, hashValue: Swift.Int, bodyPtr: Swift.UnsafeRawPointer, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.UnsafePointer +} +@frozen public struct Map : AttributeGraph.Rule, Swift.CustomStringConvertible { + public var arg: AttributeGraph.Attribute + public let body: (Source) -> Value + public init(_ arg: AttributeGraph.Attribute, _ body: @escaping (Source) -> Value) + public var value: Value { + get + } + public static var flags: AttributeGraph.Map.Flags { + get + } + public var description: Swift.String { get } } -extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { +public protocol StatefulRule : AttributeGraph._AttributeBody { + associatedtype Value + static var initialValue: Self.Value? { get } + mutating func updateValue() +} +extension AttributeGraph.StatefulRule { + public static var initialValue: Self.Value? { + get + } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) + public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) +} +extension AttributeGraph.StatefulRule { + public var attribute: AttributeGraph.Attribute { + get + } + public var context: AttributeGraph.RuleContext { + get + } + public var value: Self.Value { + unsafeAddress + nonmutating set + } + public var hasValue: Swift.Bool { + get + } +} +@frozen public struct Focus : AttributeGraph.Rule, Swift.CustomStringConvertible { + public var root: AttributeGraph.Attribute + public var keyPath: Swift.KeyPath + public init(root: AttributeGraph.Attribute, keyPath: Swift.KeyPath) + public var value: Value { + get + } + public static var flags: AttributeGraph.Focus.Flags { + get + } public var description: Swift.String { get } @@ -280,7 +355,7 @@ extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? public var wrappedValue: Value? { get @@ -306,89 +381,73 @@ extension AttributeGraph.OptionalAttribute : Swift.CustomStringConvertible { get } } -@frozen public struct Focus : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var root: AttributeGraph.Attribute - public var keyPath: Swift.KeyPath - public init(root: AttributeGraph.Attribute, keyPath: Swift.KeyPath) - public var value: Value { - get - } - public static var flags: AttributeGraph.Focus.Flags { +@frozen public struct AnyOptionalAttribute { + public var identifier: AttributeGraph.AnyAttribute + public init() + public init(_ attribute: AttributeGraph.AnyAttribute) + public init(_ attribute: AttributeGraph.AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var description: Swift.String { + public var attribute: AttributeGraph.AnyAttribute? { get + set } + public func map(_ body: (AttributeGraph.AnyAttribute) -> Value) -> Value? + public func unsafeCast(to _: Value.Type) -> AttributeGraph.OptionalAttribute } -@frozen public struct Map : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var arg: AttributeGraph.Attribute - public let body: (Source) -> Value - public init(_ arg: AttributeGraph.Attribute, _ body: @escaping (Source) -> Value) - public var value: Value { - get - } - public static var flags: AttributeGraph.Map.Flags { +extension AttributeGraph.AnyOptionalAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.AnyOptionalAttribute, b: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } +} +extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { public var description: Swift.String { get } } -public protocol Rule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - var value: Self.Value { get } -} -extension AttributeGraph.Rule { - public static var initialValue: Self.Value? { +@frozen @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { + public let identifier: AttributeGraph.AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { get + nonmutating set } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { + public var dependency: AttributeGraph.AnyAttribute? { get + nonmutating set } - public var context: AttributeGraph.RuleContext { + public var value: Value { get + nonmutating set + nonmutating _modify } -} -extension AttributeGraph.Rule where Self : Swift.Hashable { - public func cachedValue(options: AGCachedValueOptions = [], owner: AnyAttribute?) -> Self.Value - public func cachedValueIfExists(options: AGCachedValueOptions = [], owner: AnyAttribute?) -> Self.Value? - public static func _cachedValue(options: AGCachedValueOptions = [], owner: AnyAttribute?, hashValue: Swift.Int, bodyPtr: Swift.UnsafeRawPointer, update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) -> Swift.UnsafePointer -} -public protocol StatefulRule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - mutating func updateValue() -} -extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) + public var wrappedValue: Value { get + nonmutating set + nonmutating _modify } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { + public var projectedValue: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public var value: Self.Value { - unsafeAddress - nonmutating set - } - public var hasValue: Swift.Bool { +} +extension AttributeGraph.IndirectAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.IndirectAttribute, b: AttributeGraph.IndirectAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } } @frozen public struct AnyRuleContext : Swift.Equatable { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) + public var attribute: AttributeGraph.AnyAttribute + public init(attribute: AttributeGraph.AnyAttribute) public init(_ context: AttributeGraph.RuleContext) public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress @@ -399,8 +458,8 @@ extension AttributeGraph.StatefulRule { public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) public func update(body: () -> Swift.Void) public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext public static func == (a: AttributeGraph.AnyRuleContext, b: AttributeGraph.AnyRuleContext) -> Swift.Bool @@ -424,86 +483,41 @@ extension AttributeGraph.StatefulRule { public var hasValue: Swift.Bool { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) public func update(body: () -> Swift.Void) public static func == (a: AttributeGraph.RuleContext, b: AttributeGraph.RuleContext) -> Swift.Bool } @_silgen_name("AGGraphGetInputValue") -@inline(__always) @inlinable internal func AGGraphGetInputValue(_ attribute: AnyAttribute, input: AnyAttribute, options: AGValueOptions = [], type: Value.Type = Value.self) -> AGValue +@inline(__always) @inlinable internal func AGGraphGetInputValue(_ attribute: AttributeGraph.AnyAttribute, input: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue @_silgen_name("AGGraphWithUpdate") -@inline(__always) @inlinable internal func AGGraphWithUpdate(_ attribute: AnyAttribute, body: () -> Swift.Void) -extension AnyWeakAttribute { - public init(_ attribute: AnyAttribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public func unsafeCast(to _: Value.Type) -> AttributeGraph.WeakAttribute - public var attribute: AnyAttribute? { - get - set - } -} -extension AnyWeakAttribute : Swift.Hashable { - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension AnyWeakAttribute : Swift.CustomStringConvertible { - @_alwaysEmitIntoClient public var description: Swift.String { - get { attribute?.description ?? "nil" } - } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - internal var base: AnyWeakAttribute - public init(base: AnyWeakAttribute) - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { - get - } - public var projectedValue: AttributeGraph.Attribute? { - get - set - _modify - } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { - get - } - public var attribute: AttributeGraph.Attribute? { - get - set - } - public var value: Value? { - get - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? +@inline(__always) @inlinable internal func AGGraphWithUpdate(_ attribute: AttributeGraph.AnyAttribute, body: () -> Swift.Void) +extension AttributeGraph.Subgraph { + public typealias Flags = AttributeGraph.AnyAttribute.Flags + public typealias ChildFlags = AttributeGraph.AnyAttribute.Flags } -extension AttributeGraph.WeakAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.WeakAttribute, b: AttributeGraph.WeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } +extension AttributeGraph.Subgraph { + public func addObserver(_ observer: @escaping () -> Swift.Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AttributeGraph.Subgraph.Flags, _ callback: (AttributeGraph.AnyAttribute) -> Swift.Void) } -extension AttributeGraph.WeakAttribute : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } +extension AttributeGraph.Subgraph { + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) } -extension Graph { - public static func typeIndex(ctx: GraphContext, body: any AttributeGraph._AttributeBody.Type, valueType: Metadata, flags: _AttributeType.Flags, update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) -> Swift.Int +extension AttributeGraph.Graph { + public static func typeIndex(ctx: AttributeGraph.GraphContext, body: any AttributeGraph._AttributeBody.Type, valueType: AttributeGraph.Metadata, flags: AttributeGraph._AttributeType.Flags, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.Int } -extension Graph { +extension AttributeGraph.Graph { public static func withoutUpdate(_ body: () -> V) -> V public func withoutSubgraphInvalidation(_ body: () -> V) -> V public func withDeadline(_: Swift.UInt64, _: () -> V) -> V - public func onInvalidation(_ callback: @escaping (AnyAttribute) -> Swift.Void) + public func onInvalidation(_ callback: @escaping (AttributeGraph.AnyAttribute) -> Swift.Void) public func onUpdate(_ callback: @escaping () -> Swift.Void) public func withMainThreadHandler(_: (() -> Swift.Void) -> Swift.Void, do: () -> Swift.Void) } -extension Graph { +extension AttributeGraph.Graph { @_transparent public func startProfiling() { __AGGraphStartProfiling(self) } @@ -517,46 +531,27 @@ extension Graph { public static func stopProfiling() public static func resetProfile() } -extension Graph { +extension AttributeGraph.Graph { @_transparent public var mainUpdates: Swift.Int { @_transparent get { numericCast(counter(for: .mainThreadUpdates)) } } } -extension Graph { +extension AttributeGraph.Graph { @_silgen_name("AGGraphGetOutputValue") @inline(__always) @inlinable public static func outputValue() -> Swift.UnsafePointer? @_silgen_name("AGGraphSetOutputValue") @inline(__always) @inlinable public static func setOutputValue(_ value: Swift.UnsafePointer) } -extension Graph { - @_transparent public static func anyInputsChanged(excluding excludedInputs: [AnyAttribute]) -> Swift.Bool { +extension AttributeGraph.Graph { + @_transparent public static func anyInputsChanged(excluding excludedInputs: [AttributeGraph.AnyAttribute]) -> Swift.Bool { return __AGGraphAnyInputsChanged(excludedInputs, excludedInputs.count) } } -extension Graph { +extension AttributeGraph.Graph { public func archiveJSON(name: Swift.String?) } -extension Subgraph { - public typealias Flags = AnyAttribute.Flags - public typealias ChildFlags = AnyAttribute.Flags -} -extension Subgraph { - public func addObserver(_ observer: @escaping () -> Swift.Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: Subgraph.Flags, _ callback: (AnyAttribute) -> Swift.Void) -} -extension Subgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) -} -public func compareValues(_ lhs: Value, _ rhs: Value, mode: ComparisonMode = .equatableAlways) -> Swift.Bool -public func compareValues(_ lhs: Value, _ rhs: Value, options: ComparisonOptions) -> Swift.Bool -extension ComparisonOptions { - public init(mode: ComparisonMode) -} public func forEachField(of type: any Any.Type, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Void) -extension Metadata : Swift.Hashable, Swift.CustomStringConvertible { +extension AttributeGraph.Metadata : Swift.Hashable, Swift.CustomStringConvertible { public init(_ type: any Any.Type) public var type: any Any.Type { get @@ -564,16 +559,12 @@ extension Metadata : Swift.Hashable, Swift.CustomStringConvertible { public var description: Swift.String { get } - public func forEachField(options: Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool + public func forEachField(options: AttributeGraph.Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool } -extension Signature : Swift.Equatable { - public static func == (lhs: Signature, rhs: Signature) -> Swift.Bool +extension AttributeGraph.Signature : Swift.Equatable { + public static func == (lhs: AttributeGraph.Signature, rhs: AttributeGraph.Signature) -> Swift.Bool } -@discardableResult -public func withUnsafePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeRawPointer) -> ()) -> Swift.Bool -@discardableResult -public func withUnsafeMutablePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeMutableRawPointer) -> ()) -> Swift.Bool -extension TupleType { +extension AttributeGraph.TupleType { @_transparent public init(_ types: [any Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } @@ -597,16 +588,16 @@ extension TupleType { @_transparent public func offset(at index: Swift.Int, as type: T.Type) -> Swift.Int { elementOffset(at: index, type: Metadata(type)) } - @_transparent public func setElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, from srcValue: Swift.UnsafePointer, options: TupleType.CopyOptions) { + @_transparent public func setElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, from srcValue: Swift.UnsafePointer, options: AttributeGraph.TupleType.CopyOptions) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - @_transparent public func getElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, to dstValue: Swift.UnsafeMutablePointer, options: TupleType.CopyOptions) { + @_transparent public func getElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, to dstValue: Swift.UnsafeMutablePointer, options: AttributeGraph.TupleType.CopyOptions) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Swift.Void) -extension UnsafeTuple { +public func withUnsafeTuple(of type: AttributeGraph.TupleType, count: Swift.Int, _ body: (AttributeGraph.UnsafeMutableTuple) -> Swift.Void) +extension AttributeGraph.UnsafeTuple { @_transparent public var count: Swift.Int { @_transparent get { type.count } } @@ -633,8 +624,8 @@ extension UnsafeTuple { @_transparent unsafeAddress { address(of: index, as: T.self) } } } -extension UnsafeMutableTuple { - @_transparent public init(with tupleType: TupleType) { +extension AttributeGraph.UnsafeMutableTuple { + @_transparent public init(with tupleType: AttributeGraph.TupleType) { self.init( type: tupleType, value: UnsafeMutableRawPointer.allocate( @@ -688,21 +679,30 @@ extension UnsafeMutableTuple { @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } } } -extension AttributeGraph.Attribute : Swift.Sendable {} -extension AttributeGraph.Attribute : Swift.BitwiseCopyable {} -extension AttributeGraph.External : Swift.Sendable {} -extension AttributeGraph.External : Swift.BitwiseCopyable {} +@discardableResult +public func withUnsafePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeRawPointer) -> ()) -> Swift.Bool +@discardableResult +public func withUnsafeMutablePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeMutableRawPointer) -> ()) -> Swift.Bool +public func compareValues(_ lhs: Value, _ rhs: Value, mode: AttributeGraph.ComparisonMode = .equatableAlways) -> Swift.Bool +public func compareValues(_ lhs: Value, _ rhs: Value, options: AttributeGraph.ComparisonOptions) -> Swift.Bool +extension AttributeGraph.ComparisonOptions { + public init(mode: AttributeGraph.ComparisonMode) +} extension AttributeGraph.PointerOffset : Swift.Sendable {} extension AttributeGraph.PointerOffset : Swift.BitwiseCopyable {} -extension AttributeGraph.IndirectAttribute : Swift.Sendable {} -extension AttributeGraph.IndirectAttribute : Swift.BitwiseCopyable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.Sendable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.External : Swift.Sendable {} +extension AttributeGraph.External : Swift.BitwiseCopyable {} +extension AttributeGraph.Attribute : Swift.Sendable {} +extension AttributeGraph.Attribute : Swift.BitwiseCopyable {} +extension AttributeGraph.WeakAttribute : Swift.Sendable {} +extension AttributeGraph.WeakAttribute : Swift.BitwiseCopyable {} extension AttributeGraph.OptionalAttribute : Swift.Sendable {} extension AttributeGraph.OptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.AnyOptionalAttribute : Swift.Sendable {} +extension AttributeGraph.AnyOptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.IndirectAttribute : Swift.Sendable {} +extension AttributeGraph.IndirectAttribute : Swift.BitwiseCopyable {} extension AttributeGraph.AnyRuleContext : Swift.Sendable {} extension AttributeGraph.AnyRuleContext : Swift.BitwiseCopyable {} extension AttributeGraph.RuleContext : Swift.Sendable {} extension AttributeGraph.RuleContext : Swift.BitwiseCopyable {} -extension AttributeGraph.WeakAttribute : Swift.Sendable {} -extension AttributeGraph.WeakAttribute : Swift.BitwiseCopyable {} diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface index 0fbaf95..6578eb7 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface @@ -7,19 +7,19 @@ public import Swift public import _Concurrency public import _StringProcessing public import _SwiftConcurrencyShims -extension AnyAttribute { +extension AttributeGraph.AnyAttribute { public init(_ attribute: AttributeGraph.Attribute) public func unsafeCast(to _: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { + public static var current: AttributeGraph.AnyAttribute? { get } - public func unsafeOffset(at offset: Swift.Int) -> AnyAttribute - public func setFlags(_ newFlags: AnyAttribute.Flags, mask: AnyAttribute.Flags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Swift.Int) + public func unsafeOffset(at offset: Swift.Int) -> AttributeGraph.AnyAttribute + public func setFlags(_ newFlags: AttributeGraph.AnyAttribute.Flags, mask: AttributeGraph.AnyAttribute.Flags) + public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor public func mutateBody(as type: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Swift.Void) - public func breadthFirstSearch(options _: SearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public func breadthFirstSearch(options _: AttributeGraph.SearchOptions = [], _: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool public var _bodyType: any Any.Type { get } @@ -29,24 +29,69 @@ extension AnyAttribute { public var valueType: any Any.Type { get } - public var indirectDependency: AnyAttribute? { + public var indirectDependency: AttributeGraph.AnyAttribute? { get nonmutating set } } -extension AnyAttribute : Swift.CustomStringConvertible { +extension AttributeGraph.AnyAttribute : Swift.CustomStringConvertible { @inlinable public var description: Swift.String { get { "#\(rawValue)" } } } -public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void +public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void +@frozen public struct PointerOffset { + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) +} +extension AttributeGraph.PointerOffset { + public static func + (lhs: AttributeGraph.PointerOffset, rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset +} +extension AttributeGraph.PointerOffset { + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset +} +extension AttributeGraph.PointerOffset where Base == Member { + public init() +} +extension Swift.UnsafePointer { + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + (lhs: Swift.UnsafePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer +} +extension Swift.UnsafeMutablePointer { + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + (lhs: Swift.UnsafeMutablePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer +} +@frozen public struct External { + public init() +} +extension AttributeGraph.External : AttributeGraph._AttributeBody { + public static var comparisonMode: AttributeGraph.ComparisonMode { + get + } + public static var flags: AttributeGraph.External.Flags { + get + } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) +} +extension AttributeGraph.External : Swift.CustomStringConvertible { + public var description: Swift.String { + get + } +} @frozen @propertyWrapper @dynamicMemberLookup public struct Attribute { - public var identifier: AnyAttribute - public init(identifier: AnyAttribute) + public var identifier: AttributeGraph.AnyAttribute + public init(identifier: AttributeGraph.AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) public init(value: Value) public init(type _: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: _AttributeType.Flags = [], update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) where Body : AttributeGraph._AttributeBody + public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AttributeGraph._AttributeType.Flags = [], update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) where Body : AttributeGraph._AttributeBody public var wrappedValue: Value { unsafeAddress nonmutating set @@ -69,22 +114,22 @@ public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, An public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: SearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var graph: Graph { + public func breadthFirstSearch(options: AttributeGraph.SearchOptions = [], _ body: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var graph: AttributeGraph.Graph { get } - public var subgraph: Subgraph { + public var subgraph: AttributeGraph.Subgraph { get } public var value: Value { unsafeAddress nonmutating set } - public var valueState: ValueState { + public var valueState: AttributeGraph.ValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool) + public func valueAndFlags(options: AttributeGraph.AGValueOptions = []) -> (value: Value, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) public func setValue(_ value: Value) -> Swift.Bool public var hasValue: Swift.Bool { get @@ -93,9 +138,9 @@ public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, An public func prefetchValue() public func invalidateValue() public func validate() - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Swift.Int) - public typealias Flags = AnyAttribute.Flags + public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public typealias Flags = AttributeGraph.AnyAttribute.Flags public var flags: AttributeGraph.Attribute.Flags { get nonmutating set @@ -119,62 +164,29 @@ extension AttributeGraph.Attribute { public init(_ rule: R) where Value == R.Value, R : AttributeGraph.StatefulRule } @_silgen_name("AGGraphCreateAttribute") -@inline(__always) @inlinable internal func AGGraphCreateAttribute(index: Swift.Int, body: Swift.UnsafeRawPointer, value: Swift.UnsafeRawPointer?) -> AnyAttribute +@inline(__always) @inlinable internal func AGGraphCreateAttribute(index: Swift.Int, body: Swift.UnsafeRawPointer, value: Swift.UnsafeRawPointer?) -> AttributeGraph.AnyAttribute @_silgen_name("AGGraphGetValue") -@inline(__always) @inlinable internal func AGGraphGetValue(_ attribute: AnyAttribute, options: AGValueOptions = [], type: Value.Type = Value.self) -> AGValue +@inline(__always) @inlinable internal func AGGraphGetValue(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue @_silgen_name("AGGraphSetValue") -@inline(__always) @inlinable internal func AGGraphSetValue(_ attribute: AnyAttribute, valuePointer: Swift.UnsafePointer) -> Swift.Bool -@frozen public struct External { - public init() +@inline(__always) @inlinable internal func AGGraphSetValue(_ attribute: AttributeGraph.AnyAttribute, valuePointer: Swift.UnsafePointer) -> Swift.Bool +public protocol AttributeBodyVisitor { + func visit(body: Swift.UnsafePointer) where Body : AttributeGraph._AttributeBody } -extension AttributeGraph.External : AttributeGraph._AttributeBody { - public static var comparisonMode: ComparisonMode { - get - } - public static var flags: AttributeGraph.External.Flags { - get - } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) +public protocol ObservedAttribute : AttributeGraph._AttributeBody { + mutating func destroy() } -extension AttributeGraph.External : Swift.CustomStringConvertible { - public var description: Swift.String { +extension AttributeGraph.ObservedAttribute { + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } -@frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) -} -extension AttributeGraph.PointerOffset { - public static func + (lhs: AttributeGraph.PointerOffset, rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset where Base == Member { - public init() -} -extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (lhs: Swift.UnsafePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer -} -extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (lhs: Swift.UnsafeMutablePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer -} public protocol _AttributeBody { static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) static var _hasDestroySelf: Swift.Bool { get } static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - static var comparisonMode: ComparisonMode { get } - typealias Flags = _AttributeType.Flags + static var comparisonMode: AttributeGraph.ComparisonMode { get } + typealias Flags = AttributeGraph._AttributeType.Flags static var flags: Self.Flags { get } } extension AttributeGraph._AttributeBody { @@ -183,85 +195,148 @@ extension AttributeGraph._AttributeBody { get } public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - public static var comparisonMode: ComparisonMode { + public static var comparisonMode: AttributeGraph.ComparisonMode { get } public static var flags: Self.Flags { get } } -public protocol AttributeBodyVisitor { - func visit(body: Swift.UnsafePointer) where Body : AttributeGraph._AttributeBody -} -public protocol ObservedAttribute : AttributeGraph._AttributeBody { - mutating func destroy() -} -extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { +@frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { + internal var base: AttributeGraph.AnyWeakAttribute + public init(base: AttributeGraph.AnyWeakAttribute) + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { + public var projectedValue: AttributeGraph.Attribute? { get - nonmutating set + set + _modify } - public var dependency: AnyAttribute? { + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get - nonmutating set } - public var value: Value { + public var attribute: AttributeGraph.Attribute? { get - nonmutating set - nonmutating _modify + set } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool) - public var wrappedValue: Value { + public var value: Value? { get - nonmutating set - nonmutating _modify } - public var projectedValue: AttributeGraph.Attribute { + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? +} +extension AttributeGraph.WeakAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.WeakAttribute, b: AttributeGraph.WeakAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { +} +extension AttributeGraph.WeakAttribute : Swift.CustomStringConvertible { + public var description: Swift.String { get } } -extension AttributeGraph.IndirectAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.IndirectAttribute, b: AttributeGraph.IndirectAttribute) -> Swift.Bool +extension AttributeGraph.AnyWeakAttribute { + public init(_ attribute: AttributeGraph.AnyAttribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public func unsafeCast(to _: Value.Type) -> AttributeGraph.WeakAttribute + public var attribute: AttributeGraph.AnyAttribute? { + get + set + } +} +extension AttributeGraph.AnyWeakAttribute : Swift.Hashable { + public static func == (lhs: AttributeGraph.AnyWeakAttribute, rhs: AttributeGraph.AnyWeakAttribute) -> Swift.Bool public func hash(into hasher: inout Swift.Hasher) public var hashValue: Swift.Int { get } } -@frozen public struct AnyOptionalAttribute { - public var identifier: AnyAttribute - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public static var current: AttributeGraph.AnyOptionalAttribute { +extension AttributeGraph.AnyWeakAttribute : Swift.CustomStringConvertible { + @_alwaysEmitIntoClient public var description: Swift.String { + get { attribute?.description ?? "nil" } + } +} +public protocol Rule : AttributeGraph._AttributeBody { + associatedtype Value + static var initialValue: Self.Value? { get } + var value: Self.Value { get } +} +extension AttributeGraph.Rule { + public static var initialValue: Self.Value? { + get + } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) + public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) +} +extension AttributeGraph.Rule { + public var attribute: AttributeGraph.Attribute { get } - public var attribute: AnyAttribute? { + public var context: AttributeGraph.RuleContext { get - set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to _: Value.Type) -> AttributeGraph.OptionalAttribute } -extension AttributeGraph.AnyOptionalAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.AnyOptionalAttribute, b: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { +extension AttributeGraph.Rule where Self : Swift.Hashable { + public func cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value + public func cachedValueIfExists(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value? + public static func _cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?, hashValue: Swift.Int, bodyPtr: Swift.UnsafeRawPointer, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.UnsafePointer +} +@frozen public struct Map : AttributeGraph.Rule, Swift.CustomStringConvertible { + public var arg: AttributeGraph.Attribute + public let body: (Source) -> Value + public init(_ arg: AttributeGraph.Attribute, _ body: @escaping (Source) -> Value) + public var value: Value { + get + } + public static var flags: AttributeGraph.Map.Flags { + get + } + public var description: Swift.String { get } } -extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { +public protocol StatefulRule : AttributeGraph._AttributeBody { + associatedtype Value + static var initialValue: Self.Value? { get } + mutating func updateValue() +} +extension AttributeGraph.StatefulRule { + public static var initialValue: Self.Value? { + get + } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) + public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) +} +extension AttributeGraph.StatefulRule { + public var attribute: AttributeGraph.Attribute { + get + } + public var context: AttributeGraph.RuleContext { + get + } + public var value: Self.Value { + unsafeAddress + nonmutating set + } + public var hasValue: Swift.Bool { + get + } +} +@frozen public struct Focus : AttributeGraph.Rule, Swift.CustomStringConvertible { + public var root: AttributeGraph.Attribute + public var keyPath: Swift.KeyPath + public init(root: AttributeGraph.Attribute, keyPath: Swift.KeyPath) + public var value: Value { + get + } + public static var flags: AttributeGraph.Focus.Flags { + get + } public var description: Swift.String { get } @@ -280,7 +355,7 @@ extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? public var wrappedValue: Value? { get @@ -306,89 +381,73 @@ extension AttributeGraph.OptionalAttribute : Swift.CustomStringConvertible { get } } -@frozen public struct Focus : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var root: AttributeGraph.Attribute - public var keyPath: Swift.KeyPath - public init(root: AttributeGraph.Attribute, keyPath: Swift.KeyPath) - public var value: Value { - get - } - public static var flags: AttributeGraph.Focus.Flags { +@frozen public struct AnyOptionalAttribute { + public var identifier: AttributeGraph.AnyAttribute + public init() + public init(_ attribute: AttributeGraph.AnyAttribute) + public init(_ attribute: AttributeGraph.AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var description: Swift.String { + public var attribute: AttributeGraph.AnyAttribute? { get + set } + public func map(_ body: (AttributeGraph.AnyAttribute) -> Value) -> Value? + public func unsafeCast(to _: Value.Type) -> AttributeGraph.OptionalAttribute } -@frozen public struct Map : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var arg: AttributeGraph.Attribute - public let body: (Source) -> Value - public init(_ arg: AttributeGraph.Attribute, _ body: @escaping (Source) -> Value) - public var value: Value { - get - } - public static var flags: AttributeGraph.Map.Flags { +extension AttributeGraph.AnyOptionalAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.AnyOptionalAttribute, b: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } +} +extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { public var description: Swift.String { get } } -public protocol Rule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - var value: Self.Value { get } -} -extension AttributeGraph.Rule { - public static var initialValue: Self.Value? { +@frozen @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { + public let identifier: AttributeGraph.AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { get + nonmutating set } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { + public var dependency: AttributeGraph.AnyAttribute? { get + nonmutating set } - public var context: AttributeGraph.RuleContext { + public var value: Value { get + nonmutating set + nonmutating _modify } -} -extension AttributeGraph.Rule where Self : Swift.Hashable { - public func cachedValue(options: AGCachedValueOptions = [], owner: AnyAttribute?) -> Self.Value - public func cachedValueIfExists(options: AGCachedValueOptions = [], owner: AnyAttribute?) -> Self.Value? - public static func _cachedValue(options: AGCachedValueOptions = [], owner: AnyAttribute?, hashValue: Swift.Int, bodyPtr: Swift.UnsafeRawPointer, update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) -> Swift.UnsafePointer -} -public protocol StatefulRule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - mutating func updateValue() -} -extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) + public var wrappedValue: Value { get + nonmutating set + nonmutating _modify } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { + public var projectedValue: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public var value: Self.Value { - unsafeAddress - nonmutating set - } - public var hasValue: Swift.Bool { +} +extension AttributeGraph.IndirectAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.IndirectAttribute, b: AttributeGraph.IndirectAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } } @frozen public struct AnyRuleContext : Swift.Equatable { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) + public var attribute: AttributeGraph.AnyAttribute + public init(attribute: AttributeGraph.AnyAttribute) public init(_ context: AttributeGraph.RuleContext) public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress @@ -399,8 +458,8 @@ extension AttributeGraph.StatefulRule { public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) public func update(body: () -> Swift.Void) public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext public static func == (a: AttributeGraph.AnyRuleContext, b: AttributeGraph.AnyRuleContext) -> Swift.Bool @@ -424,86 +483,41 @@ extension AttributeGraph.StatefulRule { public var hasValue: Swift.Bool { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) public func update(body: () -> Swift.Void) public static func == (a: AttributeGraph.RuleContext, b: AttributeGraph.RuleContext) -> Swift.Bool } @_silgen_name("AGGraphGetInputValue") -@inline(__always) @inlinable internal func AGGraphGetInputValue(_ attribute: AnyAttribute, input: AnyAttribute, options: AGValueOptions = [], type: Value.Type = Value.self) -> AGValue +@inline(__always) @inlinable internal func AGGraphGetInputValue(_ attribute: AttributeGraph.AnyAttribute, input: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue @_silgen_name("AGGraphWithUpdate") -@inline(__always) @inlinable internal func AGGraphWithUpdate(_ attribute: AnyAttribute, body: () -> Swift.Void) -extension AnyWeakAttribute { - public init(_ attribute: AnyAttribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public func unsafeCast(to _: Value.Type) -> AttributeGraph.WeakAttribute - public var attribute: AnyAttribute? { - get - set - } -} -extension AnyWeakAttribute : Swift.Hashable { - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension AnyWeakAttribute : Swift.CustomStringConvertible { - @_alwaysEmitIntoClient public var description: Swift.String { - get { attribute?.description ?? "nil" } - } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - internal var base: AnyWeakAttribute - public init(base: AnyWeakAttribute) - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { - get - } - public var projectedValue: AttributeGraph.Attribute? { - get - set - _modify - } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { - get - } - public var attribute: AttributeGraph.Attribute? { - get - set - } - public var value: Value? { - get - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? +@inline(__always) @inlinable internal func AGGraphWithUpdate(_ attribute: AttributeGraph.AnyAttribute, body: () -> Swift.Void) +extension AttributeGraph.Subgraph { + public typealias Flags = AttributeGraph.AnyAttribute.Flags + public typealias ChildFlags = AttributeGraph.AnyAttribute.Flags } -extension AttributeGraph.WeakAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.WeakAttribute, b: AttributeGraph.WeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } +extension AttributeGraph.Subgraph { + public func addObserver(_ observer: @escaping () -> Swift.Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AttributeGraph.Subgraph.Flags, _ callback: (AttributeGraph.AnyAttribute) -> Swift.Void) } -extension AttributeGraph.WeakAttribute : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } +extension AttributeGraph.Subgraph { + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) } -extension Graph { - public static func typeIndex(ctx: GraphContext, body: any AttributeGraph._AttributeBody.Type, valueType: Metadata, flags: _AttributeType.Flags, update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) -> Swift.Int +extension AttributeGraph.Graph { + public static func typeIndex(ctx: AttributeGraph.GraphContext, body: any AttributeGraph._AttributeBody.Type, valueType: AttributeGraph.Metadata, flags: AttributeGraph._AttributeType.Flags, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.Int } -extension Graph { +extension AttributeGraph.Graph { public static func withoutUpdate(_ body: () -> V) -> V public func withoutSubgraphInvalidation(_ body: () -> V) -> V public func withDeadline(_: Swift.UInt64, _: () -> V) -> V - public func onInvalidation(_ callback: @escaping (AnyAttribute) -> Swift.Void) + public func onInvalidation(_ callback: @escaping (AttributeGraph.AnyAttribute) -> Swift.Void) public func onUpdate(_ callback: @escaping () -> Swift.Void) public func withMainThreadHandler(_: (() -> Swift.Void) -> Swift.Void, do: () -> Swift.Void) } -extension Graph { +extension AttributeGraph.Graph { @_transparent public func startProfiling() { __AGGraphStartProfiling(self) } @@ -517,46 +531,27 @@ extension Graph { public static func stopProfiling() public static func resetProfile() } -extension Graph { +extension AttributeGraph.Graph { @_transparent public var mainUpdates: Swift.Int { @_transparent get { numericCast(counter(for: .mainThreadUpdates)) } } } -extension Graph { +extension AttributeGraph.Graph { @_silgen_name("AGGraphGetOutputValue") @inline(__always) @inlinable public static func outputValue() -> Swift.UnsafePointer? @_silgen_name("AGGraphSetOutputValue") @inline(__always) @inlinable public static func setOutputValue(_ value: Swift.UnsafePointer) } -extension Graph { - @_transparent public static func anyInputsChanged(excluding excludedInputs: [AnyAttribute]) -> Swift.Bool { +extension AttributeGraph.Graph { + @_transparent public static func anyInputsChanged(excluding excludedInputs: [AttributeGraph.AnyAttribute]) -> Swift.Bool { return __AGGraphAnyInputsChanged(excludedInputs, excludedInputs.count) } } -extension Graph { +extension AttributeGraph.Graph { public func archiveJSON(name: Swift.String?) } -extension Subgraph { - public typealias Flags = AnyAttribute.Flags - public typealias ChildFlags = AnyAttribute.Flags -} -extension Subgraph { - public func addObserver(_ observer: @escaping () -> Swift.Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: Subgraph.Flags, _ callback: (AnyAttribute) -> Swift.Void) -} -extension Subgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) -} -public func compareValues(_ lhs: Value, _ rhs: Value, mode: ComparisonMode = .equatableAlways) -> Swift.Bool -public func compareValues(_ lhs: Value, _ rhs: Value, options: ComparisonOptions) -> Swift.Bool -extension ComparisonOptions { - public init(mode: ComparisonMode) -} public func forEachField(of type: any Any.Type, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Void) -extension Metadata : Swift.Hashable, Swift.CustomStringConvertible { +extension AttributeGraph.Metadata : Swift.Hashable, Swift.CustomStringConvertible { public init(_ type: any Any.Type) public var type: any Any.Type { get @@ -564,16 +559,12 @@ extension Metadata : Swift.Hashable, Swift.CustomStringConvertible { public var description: Swift.String { get } - public func forEachField(options: Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool + public func forEachField(options: AttributeGraph.Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool } -extension Signature : Swift.Equatable { - public static func == (lhs: Signature, rhs: Signature) -> Swift.Bool +extension AttributeGraph.Signature : Swift.Equatable { + public static func == (lhs: AttributeGraph.Signature, rhs: AttributeGraph.Signature) -> Swift.Bool } -@discardableResult -public func withUnsafePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeRawPointer) -> ()) -> Swift.Bool -@discardableResult -public func withUnsafeMutablePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeMutableRawPointer) -> ()) -> Swift.Bool -extension TupleType { +extension AttributeGraph.TupleType { @_transparent public init(_ types: [any Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } @@ -597,16 +588,16 @@ extension TupleType { @_transparent public func offset(at index: Swift.Int, as type: T.Type) -> Swift.Int { elementOffset(at: index, type: Metadata(type)) } - @_transparent public func setElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, from srcValue: Swift.UnsafePointer, options: TupleType.CopyOptions) { + @_transparent public func setElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, from srcValue: Swift.UnsafePointer, options: AttributeGraph.TupleType.CopyOptions) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - @_transparent public func getElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, to dstValue: Swift.UnsafeMutablePointer, options: TupleType.CopyOptions) { + @_transparent public func getElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, to dstValue: Swift.UnsafeMutablePointer, options: AttributeGraph.TupleType.CopyOptions) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Swift.Void) -extension UnsafeTuple { +public func withUnsafeTuple(of type: AttributeGraph.TupleType, count: Swift.Int, _ body: (AttributeGraph.UnsafeMutableTuple) -> Swift.Void) +extension AttributeGraph.UnsafeTuple { @_transparent public var count: Swift.Int { @_transparent get { type.count } } @@ -633,8 +624,8 @@ extension UnsafeTuple { @_transparent unsafeAddress { address(of: index, as: T.self) } } } -extension UnsafeMutableTuple { - @_transparent public init(with tupleType: TupleType) { +extension AttributeGraph.UnsafeMutableTuple { + @_transparent public init(with tupleType: AttributeGraph.TupleType) { self.init( type: tupleType, value: UnsafeMutableRawPointer.allocate( @@ -688,21 +679,30 @@ extension UnsafeMutableTuple { @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } } } -extension AttributeGraph.Attribute : Swift.Sendable {} -extension AttributeGraph.Attribute : Swift.BitwiseCopyable {} -extension AttributeGraph.External : Swift.Sendable {} -extension AttributeGraph.External : Swift.BitwiseCopyable {} +@discardableResult +public func withUnsafePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeRawPointer) -> ()) -> Swift.Bool +@discardableResult +public func withUnsafeMutablePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeMutableRawPointer) -> ()) -> Swift.Bool +public func compareValues(_ lhs: Value, _ rhs: Value, mode: AttributeGraph.ComparisonMode = .equatableAlways) -> Swift.Bool +public func compareValues(_ lhs: Value, _ rhs: Value, options: AttributeGraph.ComparisonOptions) -> Swift.Bool +extension AttributeGraph.ComparisonOptions { + public init(mode: AttributeGraph.ComparisonMode) +} extension AttributeGraph.PointerOffset : Swift.Sendable {} extension AttributeGraph.PointerOffset : Swift.BitwiseCopyable {} -extension AttributeGraph.IndirectAttribute : Swift.Sendable {} -extension AttributeGraph.IndirectAttribute : Swift.BitwiseCopyable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.Sendable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.External : Swift.Sendable {} +extension AttributeGraph.External : Swift.BitwiseCopyable {} +extension AttributeGraph.Attribute : Swift.Sendable {} +extension AttributeGraph.Attribute : Swift.BitwiseCopyable {} +extension AttributeGraph.WeakAttribute : Swift.Sendable {} +extension AttributeGraph.WeakAttribute : Swift.BitwiseCopyable {} extension AttributeGraph.OptionalAttribute : Swift.Sendable {} extension AttributeGraph.OptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.AnyOptionalAttribute : Swift.Sendable {} +extension AttributeGraph.AnyOptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.IndirectAttribute : Swift.Sendable {} +extension AttributeGraph.IndirectAttribute : Swift.BitwiseCopyable {} extension AttributeGraph.AnyRuleContext : Swift.Sendable {} extension AttributeGraph.AnyRuleContext : Swift.BitwiseCopyable {} extension AttributeGraph.RuleContext : Swift.Sendable {} extension AttributeGraph.RuleContext : Swift.BitwiseCopyable {} -extension AttributeGraph.WeakAttribute : Swift.Sendable {} -extension AttributeGraph.WeakAttribute : Swift.BitwiseCopyable {} diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface index ce7277c..4076be1 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface @@ -7,19 +7,19 @@ public import Swift public import _Concurrency public import _StringProcessing public import _SwiftConcurrencyShims -extension AnyAttribute { +extension AttributeGraph.AnyAttribute { public init(_ attribute: AttributeGraph.Attribute) public func unsafeCast(to _: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { + public static var current: AttributeGraph.AnyAttribute? { get } - public func unsafeOffset(at offset: Swift.Int) -> AnyAttribute - public func setFlags(_ newFlags: AnyAttribute.Flags, mask: AnyAttribute.Flags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Swift.Int) + public func unsafeOffset(at offset: Swift.Int) -> AttributeGraph.AnyAttribute + public func setFlags(_ newFlags: AttributeGraph.AnyAttribute.Flags, mask: AttributeGraph.AnyAttribute.Flags) + public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor public func mutateBody(as type: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Swift.Void) - public func breadthFirstSearch(options _: SearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public func breadthFirstSearch(options _: AttributeGraph.SearchOptions = [], _: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool public var _bodyType: any Any.Type { get } @@ -29,24 +29,69 @@ extension AnyAttribute { public var valueType: any Any.Type { get } - public var indirectDependency: AnyAttribute? { + public var indirectDependency: AttributeGraph.AnyAttribute? { get nonmutating set } } -extension AnyAttribute : Swift.CustomStringConvertible { +extension AttributeGraph.AnyAttribute : Swift.CustomStringConvertible { @inlinable public var description: Swift.String { get { "#\(rawValue)" } } } -public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void +public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void +@frozen public struct PointerOffset { + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) +} +extension AttributeGraph.PointerOffset { + public static func + (lhs: AttributeGraph.PointerOffset, rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset +} +extension AttributeGraph.PointerOffset { + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset +} +extension AttributeGraph.PointerOffset where Base == Member { + public init() +} +extension Swift.UnsafePointer { + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + (lhs: Swift.UnsafePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer +} +extension Swift.UnsafeMutablePointer { + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + (lhs: Swift.UnsafeMutablePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer +} +@frozen public struct External { + public init() +} +extension AttributeGraph.External : AttributeGraph._AttributeBody { + public static var comparisonMode: AttributeGraph.ComparisonMode { + get + } + public static var flags: AttributeGraph.External.Flags { + get + } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) +} +extension AttributeGraph.External : Swift.CustomStringConvertible { + public var description: Swift.String { + get + } +} @frozen @propertyWrapper @dynamicMemberLookup public struct Attribute { - public var identifier: AnyAttribute - public init(identifier: AnyAttribute) + public var identifier: AttributeGraph.AnyAttribute + public init(identifier: AttributeGraph.AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) public init(value: Value) public init(type _: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: _AttributeType.Flags = [], update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) where Body : AttributeGraph._AttributeBody + public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AttributeGraph._AttributeType.Flags = [], update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) where Body : AttributeGraph._AttributeBody public var wrappedValue: Value { unsafeAddress nonmutating set @@ -69,22 +114,22 @@ public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, An public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: SearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var graph: Graph { + public func breadthFirstSearch(options: AttributeGraph.SearchOptions = [], _ body: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var graph: AttributeGraph.Graph { get } - public var subgraph: Subgraph { + public var subgraph: AttributeGraph.Subgraph { get } public var value: Value { unsafeAddress nonmutating set } - public var valueState: ValueState { + public var valueState: AttributeGraph.ValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool) + public func valueAndFlags(options: AttributeGraph.AGValueOptions = []) -> (value: Value, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) public func setValue(_ value: Value) -> Swift.Bool public var hasValue: Swift.Bool { get @@ -93,9 +138,9 @@ public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, An public func prefetchValue() public func invalidateValue() public func validate() - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Swift.Int) - public typealias Flags = AnyAttribute.Flags + public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public typealias Flags = AttributeGraph.AnyAttribute.Flags public var flags: AttributeGraph.Attribute.Flags { get nonmutating set @@ -119,62 +164,29 @@ extension AttributeGraph.Attribute { public init(_ rule: R) where Value == R.Value, R : AttributeGraph.StatefulRule } @_silgen_name("AGGraphCreateAttribute") -@inline(__always) @inlinable internal func AGGraphCreateAttribute(index: Swift.Int, body: Swift.UnsafeRawPointer, value: Swift.UnsafeRawPointer?) -> AnyAttribute +@inline(__always) @inlinable internal func AGGraphCreateAttribute(index: Swift.Int, body: Swift.UnsafeRawPointer, value: Swift.UnsafeRawPointer?) -> AttributeGraph.AnyAttribute @_silgen_name("AGGraphGetValue") -@inline(__always) @inlinable internal func AGGraphGetValue(_ attribute: AnyAttribute, options: AGValueOptions = [], type: Value.Type = Value.self) -> AGValue +@inline(__always) @inlinable internal func AGGraphGetValue(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue @_silgen_name("AGGraphSetValue") -@inline(__always) @inlinable internal func AGGraphSetValue(_ attribute: AnyAttribute, valuePointer: Swift.UnsafePointer) -> Swift.Bool -@frozen public struct External { - public init() +@inline(__always) @inlinable internal func AGGraphSetValue(_ attribute: AttributeGraph.AnyAttribute, valuePointer: Swift.UnsafePointer) -> Swift.Bool +public protocol AttributeBodyVisitor { + func visit(body: Swift.UnsafePointer) where Body : AttributeGraph._AttributeBody } -extension AttributeGraph.External : AttributeGraph._AttributeBody { - public static var comparisonMode: ComparisonMode { - get - } - public static var flags: AttributeGraph.External.Flags { - get - } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) +public protocol ObservedAttribute : AttributeGraph._AttributeBody { + mutating func destroy() } -extension AttributeGraph.External : Swift.CustomStringConvertible { - public var description: Swift.String { +extension AttributeGraph.ObservedAttribute { + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } -@frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) -} -extension AttributeGraph.PointerOffset { - public static func + (lhs: AttributeGraph.PointerOffset, rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset where Base == Member { - public init() -} -extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (lhs: Swift.UnsafePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer -} -extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (lhs: Swift.UnsafeMutablePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer -} public protocol _AttributeBody { static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) static var _hasDestroySelf: Swift.Bool { get } static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - static var comparisonMode: ComparisonMode { get } - typealias Flags = _AttributeType.Flags + static var comparisonMode: AttributeGraph.ComparisonMode { get } + typealias Flags = AttributeGraph._AttributeType.Flags static var flags: Self.Flags { get } } extension AttributeGraph._AttributeBody { @@ -183,85 +195,148 @@ extension AttributeGraph._AttributeBody { get } public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - public static var comparisonMode: ComparisonMode { + public static var comparisonMode: AttributeGraph.ComparisonMode { get } public static var flags: Self.Flags { get } } -public protocol AttributeBodyVisitor { - func visit(body: Swift.UnsafePointer) where Body : AttributeGraph._AttributeBody -} -public protocol ObservedAttribute : AttributeGraph._AttributeBody { - mutating func destroy() -} -extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { +@frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { + internal var base: AttributeGraph.AnyWeakAttribute + public init(base: AttributeGraph.AnyWeakAttribute) + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { + public var projectedValue: AttributeGraph.Attribute? { get - nonmutating set + set + _modify } - public var dependency: AnyAttribute? { + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get - nonmutating set } - public var value: Value { + public var attribute: AttributeGraph.Attribute? { get - nonmutating set - nonmutating _modify + set } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool) - public var wrappedValue: Value { + public var value: Value? { get - nonmutating set - nonmutating _modify } - public var projectedValue: AttributeGraph.Attribute { + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? +} +extension AttributeGraph.WeakAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.WeakAttribute, b: AttributeGraph.WeakAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { +} +extension AttributeGraph.WeakAttribute : Swift.CustomStringConvertible { + public var description: Swift.String { get } } -extension AttributeGraph.IndirectAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.IndirectAttribute, b: AttributeGraph.IndirectAttribute) -> Swift.Bool +extension AttributeGraph.AnyWeakAttribute { + public init(_ attribute: AttributeGraph.AnyAttribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public func unsafeCast(to _: Value.Type) -> AttributeGraph.WeakAttribute + public var attribute: AttributeGraph.AnyAttribute? { + get + set + } +} +extension AttributeGraph.AnyWeakAttribute : Swift.Hashable { + public static func == (lhs: AttributeGraph.AnyWeakAttribute, rhs: AttributeGraph.AnyWeakAttribute) -> Swift.Bool public func hash(into hasher: inout Swift.Hasher) public var hashValue: Swift.Int { get } } -@frozen public struct AnyOptionalAttribute { - public var identifier: AnyAttribute - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public static var current: AttributeGraph.AnyOptionalAttribute { +extension AttributeGraph.AnyWeakAttribute : Swift.CustomStringConvertible { + @_alwaysEmitIntoClient public var description: Swift.String { + get { attribute?.description ?? "nil" } + } +} +public protocol Rule : AttributeGraph._AttributeBody { + associatedtype Value + static var initialValue: Self.Value? { get } + var value: Self.Value { get } +} +extension AttributeGraph.Rule { + public static var initialValue: Self.Value? { + get + } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) + public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) +} +extension AttributeGraph.Rule { + public var attribute: AttributeGraph.Attribute { get } - public var attribute: AnyAttribute? { + public var context: AttributeGraph.RuleContext { get - set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to _: Value.Type) -> AttributeGraph.OptionalAttribute } -extension AttributeGraph.AnyOptionalAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.AnyOptionalAttribute, b: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { +extension AttributeGraph.Rule where Self : Swift.Hashable { + public func cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value + public func cachedValueIfExists(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value? + public static func _cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?, hashValue: Swift.Int, bodyPtr: Swift.UnsafeRawPointer, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.UnsafePointer +} +@frozen public struct Map : AttributeGraph.Rule, Swift.CustomStringConvertible { + public var arg: AttributeGraph.Attribute + public let body: (Source) -> Value + public init(_ arg: AttributeGraph.Attribute, _ body: @escaping (Source) -> Value) + public var value: Value { + get + } + public static var flags: AttributeGraph.Map.Flags { + get + } + public var description: Swift.String { get } } -extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { +public protocol StatefulRule : AttributeGraph._AttributeBody { + associatedtype Value + static var initialValue: Self.Value? { get } + mutating func updateValue() +} +extension AttributeGraph.StatefulRule { + public static var initialValue: Self.Value? { + get + } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) + public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) +} +extension AttributeGraph.StatefulRule { + public var attribute: AttributeGraph.Attribute { + get + } + public var context: AttributeGraph.RuleContext { + get + } + public var value: Self.Value { + unsafeAddress + nonmutating set + } + public var hasValue: Swift.Bool { + get + } +} +@frozen public struct Focus : AttributeGraph.Rule, Swift.CustomStringConvertible { + public var root: AttributeGraph.Attribute + public var keyPath: Swift.KeyPath + public init(root: AttributeGraph.Attribute, keyPath: Swift.KeyPath) + public var value: Value { + get + } + public static var flags: AttributeGraph.Focus.Flags { + get + } public var description: Swift.String { get } @@ -280,7 +355,7 @@ extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? public var wrappedValue: Value? { get @@ -306,89 +381,73 @@ extension AttributeGraph.OptionalAttribute : Swift.CustomStringConvertible { get } } -@frozen public struct Focus : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var root: AttributeGraph.Attribute - public var keyPath: Swift.KeyPath - public init(root: AttributeGraph.Attribute, keyPath: Swift.KeyPath) - public var value: Value { - get - } - public static var flags: AttributeGraph.Focus.Flags { +@frozen public struct AnyOptionalAttribute { + public var identifier: AttributeGraph.AnyAttribute + public init() + public init(_ attribute: AttributeGraph.AnyAttribute) + public init(_ attribute: AttributeGraph.AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var description: Swift.String { + public var attribute: AttributeGraph.AnyAttribute? { get + set } + public func map(_ body: (AttributeGraph.AnyAttribute) -> Value) -> Value? + public func unsafeCast(to _: Value.Type) -> AttributeGraph.OptionalAttribute } -@frozen public struct Map : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var arg: AttributeGraph.Attribute - public let body: (Source) -> Value - public init(_ arg: AttributeGraph.Attribute, _ body: @escaping (Source) -> Value) - public var value: Value { - get - } - public static var flags: AttributeGraph.Map.Flags { +extension AttributeGraph.AnyOptionalAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.AnyOptionalAttribute, b: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } +} +extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { public var description: Swift.String { get } } -public protocol Rule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - var value: Self.Value { get } -} -extension AttributeGraph.Rule { - public static var initialValue: Self.Value? { +@frozen @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { + public let identifier: AttributeGraph.AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { get + nonmutating set } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { + public var dependency: AttributeGraph.AnyAttribute? { get + nonmutating set } - public var context: AttributeGraph.RuleContext { + public var value: Value { get + nonmutating set + nonmutating _modify } -} -extension AttributeGraph.Rule where Self : Swift.Hashable { - public func cachedValue(options: AGCachedValueOptions = [], owner: AnyAttribute?) -> Self.Value - public func cachedValueIfExists(options: AGCachedValueOptions = [], owner: AnyAttribute?) -> Self.Value? - public static func _cachedValue(options: AGCachedValueOptions = [], owner: AnyAttribute?, hashValue: Swift.Int, bodyPtr: Swift.UnsafeRawPointer, update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) -> Swift.UnsafePointer -} -public protocol StatefulRule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - mutating func updateValue() -} -extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) + public var wrappedValue: Value { get + nonmutating set + nonmutating _modify } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { + public var projectedValue: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public var value: Self.Value { - unsafeAddress - nonmutating set - } - public var hasValue: Swift.Bool { +} +extension AttributeGraph.IndirectAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.IndirectAttribute, b: AttributeGraph.IndirectAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } } @frozen public struct AnyRuleContext : Swift.Equatable { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) + public var attribute: AttributeGraph.AnyAttribute + public init(attribute: AttributeGraph.AnyAttribute) public init(_ context: AttributeGraph.RuleContext) public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress @@ -399,8 +458,8 @@ extension AttributeGraph.StatefulRule { public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) public func update(body: () -> Swift.Void) public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext public static func == (a: AttributeGraph.AnyRuleContext, b: AttributeGraph.AnyRuleContext) -> Swift.Bool @@ -424,86 +483,41 @@ extension AttributeGraph.StatefulRule { public var hasValue: Swift.Bool { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) public func update(body: () -> Swift.Void) public static func == (a: AttributeGraph.RuleContext, b: AttributeGraph.RuleContext) -> Swift.Bool } @_silgen_name("AGGraphGetInputValue") -@inline(__always) @inlinable internal func AGGraphGetInputValue(_ attribute: AnyAttribute, input: AnyAttribute, options: AGValueOptions = [], type: Value.Type = Value.self) -> AGValue +@inline(__always) @inlinable internal func AGGraphGetInputValue(_ attribute: AttributeGraph.AnyAttribute, input: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue @_silgen_name("AGGraphWithUpdate") -@inline(__always) @inlinable internal func AGGraphWithUpdate(_ attribute: AnyAttribute, body: () -> Swift.Void) -extension AnyWeakAttribute { - public init(_ attribute: AnyAttribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public func unsafeCast(to _: Value.Type) -> AttributeGraph.WeakAttribute - public var attribute: AnyAttribute? { - get - set - } -} -extension AnyWeakAttribute : Swift.Hashable { - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension AnyWeakAttribute : Swift.CustomStringConvertible { - @_alwaysEmitIntoClient public var description: Swift.String { - get { attribute?.description ?? "nil" } - } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - internal var base: AnyWeakAttribute - public init(base: AnyWeakAttribute) - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { - get - } - public var projectedValue: AttributeGraph.Attribute? { - get - set - _modify - } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { - get - } - public var attribute: AttributeGraph.Attribute? { - get - set - } - public var value: Value? { - get - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? +@inline(__always) @inlinable internal func AGGraphWithUpdate(_ attribute: AttributeGraph.AnyAttribute, body: () -> Swift.Void) +extension AttributeGraph.Subgraph { + public typealias Flags = AttributeGraph.AnyAttribute.Flags + public typealias ChildFlags = AttributeGraph.AnyAttribute.Flags } -extension AttributeGraph.WeakAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.WeakAttribute, b: AttributeGraph.WeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } +extension AttributeGraph.Subgraph { + public func addObserver(_ observer: @escaping () -> Swift.Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AttributeGraph.Subgraph.Flags, _ callback: (AttributeGraph.AnyAttribute) -> Swift.Void) } -extension AttributeGraph.WeakAttribute : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } +extension AttributeGraph.Subgraph { + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) } -extension Graph { - public static func typeIndex(ctx: GraphContext, body: any AttributeGraph._AttributeBody.Type, valueType: Metadata, flags: _AttributeType.Flags, update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) -> Swift.Int +extension AttributeGraph.Graph { + public static func typeIndex(ctx: AttributeGraph.GraphContext, body: any AttributeGraph._AttributeBody.Type, valueType: AttributeGraph.Metadata, flags: AttributeGraph._AttributeType.Flags, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.Int } -extension Graph { +extension AttributeGraph.Graph { public static func withoutUpdate(_ body: () -> V) -> V public func withoutSubgraphInvalidation(_ body: () -> V) -> V public func withDeadline(_: Swift.UInt64, _: () -> V) -> V - public func onInvalidation(_ callback: @escaping (AnyAttribute) -> Swift.Void) + public func onInvalidation(_ callback: @escaping (AttributeGraph.AnyAttribute) -> Swift.Void) public func onUpdate(_ callback: @escaping () -> Swift.Void) public func withMainThreadHandler(_: (() -> Swift.Void) -> Swift.Void, do: () -> Swift.Void) } -extension Graph { +extension AttributeGraph.Graph { @_transparent public func startProfiling() { __AGGraphStartProfiling(self) } @@ -517,46 +531,27 @@ extension Graph { public static func stopProfiling() public static func resetProfile() } -extension Graph { +extension AttributeGraph.Graph { @_transparent public var mainUpdates: Swift.Int { @_transparent get { numericCast(counter(for: .mainThreadUpdates)) } } } -extension Graph { +extension AttributeGraph.Graph { @_silgen_name("AGGraphGetOutputValue") @inline(__always) @inlinable public static func outputValue() -> Swift.UnsafePointer? @_silgen_name("AGGraphSetOutputValue") @inline(__always) @inlinable public static func setOutputValue(_ value: Swift.UnsafePointer) } -extension Graph { - @_transparent public static func anyInputsChanged(excluding excludedInputs: [AnyAttribute]) -> Swift.Bool { +extension AttributeGraph.Graph { + @_transparent public static func anyInputsChanged(excluding excludedInputs: [AttributeGraph.AnyAttribute]) -> Swift.Bool { return __AGGraphAnyInputsChanged(excludedInputs, excludedInputs.count) } } -extension Graph { +extension AttributeGraph.Graph { public func archiveJSON(name: Swift.String?) } -extension Subgraph { - public typealias Flags = AnyAttribute.Flags - public typealias ChildFlags = AnyAttribute.Flags -} -extension Subgraph { - public func addObserver(_ observer: @escaping () -> Swift.Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: Subgraph.Flags, _ callback: (AnyAttribute) -> Swift.Void) -} -extension Subgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) -} -public func compareValues(_ lhs: Value, _ rhs: Value, mode: ComparisonMode = .equatableAlways) -> Swift.Bool -public func compareValues(_ lhs: Value, _ rhs: Value, options: ComparisonOptions) -> Swift.Bool -extension ComparisonOptions { - public init(mode: ComparisonMode) -} public func forEachField(of type: any Any.Type, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Void) -extension Metadata : Swift.Hashable, Swift.CustomStringConvertible { +extension AttributeGraph.Metadata : Swift.Hashable, Swift.CustomStringConvertible { public init(_ type: any Any.Type) public var type: any Any.Type { get @@ -564,16 +559,12 @@ extension Metadata : Swift.Hashable, Swift.CustomStringConvertible { public var description: Swift.String { get } - public func forEachField(options: Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool + public func forEachField(options: AttributeGraph.Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool } -extension Signature : Swift.Equatable { - public static func == (lhs: Signature, rhs: Signature) -> Swift.Bool +extension AttributeGraph.Signature : Swift.Equatable { + public static func == (lhs: AttributeGraph.Signature, rhs: AttributeGraph.Signature) -> Swift.Bool } -@discardableResult -public func withUnsafePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeRawPointer) -> ()) -> Swift.Bool -@discardableResult -public func withUnsafeMutablePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeMutableRawPointer) -> ()) -> Swift.Bool -extension TupleType { +extension AttributeGraph.TupleType { @_transparent public init(_ types: [any Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } @@ -597,16 +588,16 @@ extension TupleType { @_transparent public func offset(at index: Swift.Int, as type: T.Type) -> Swift.Int { elementOffset(at: index, type: Metadata(type)) } - @_transparent public func setElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, from srcValue: Swift.UnsafePointer, options: TupleType.CopyOptions) { + @_transparent public func setElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, from srcValue: Swift.UnsafePointer, options: AttributeGraph.TupleType.CopyOptions) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - @_transparent public func getElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, to dstValue: Swift.UnsafeMutablePointer, options: TupleType.CopyOptions) { + @_transparent public func getElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, to dstValue: Swift.UnsafeMutablePointer, options: AttributeGraph.TupleType.CopyOptions) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Swift.Void) -extension UnsafeTuple { +public func withUnsafeTuple(of type: AttributeGraph.TupleType, count: Swift.Int, _ body: (AttributeGraph.UnsafeMutableTuple) -> Swift.Void) +extension AttributeGraph.UnsafeTuple { @_transparent public var count: Swift.Int { @_transparent get { type.count } } @@ -633,8 +624,8 @@ extension UnsafeTuple { @_transparent unsafeAddress { address(of: index, as: T.self) } } } -extension UnsafeMutableTuple { - @_transparent public init(with tupleType: TupleType) { +extension AttributeGraph.UnsafeMutableTuple { + @_transparent public init(with tupleType: AttributeGraph.TupleType) { self.init( type: tupleType, value: UnsafeMutableRawPointer.allocate( @@ -688,21 +679,30 @@ extension UnsafeMutableTuple { @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } } } -extension AttributeGraph.Attribute : Swift.Sendable {} -extension AttributeGraph.Attribute : Swift.BitwiseCopyable {} -extension AttributeGraph.External : Swift.Sendable {} -extension AttributeGraph.External : Swift.BitwiseCopyable {} +@discardableResult +public func withUnsafePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeRawPointer) -> ()) -> Swift.Bool +@discardableResult +public func withUnsafeMutablePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeMutableRawPointer) -> ()) -> Swift.Bool +public func compareValues(_ lhs: Value, _ rhs: Value, mode: AttributeGraph.ComparisonMode = .equatableAlways) -> Swift.Bool +public func compareValues(_ lhs: Value, _ rhs: Value, options: AttributeGraph.ComparisonOptions) -> Swift.Bool +extension AttributeGraph.ComparisonOptions { + public init(mode: AttributeGraph.ComparisonMode) +} extension AttributeGraph.PointerOffset : Swift.Sendable {} extension AttributeGraph.PointerOffset : Swift.BitwiseCopyable {} -extension AttributeGraph.IndirectAttribute : Swift.Sendable {} -extension AttributeGraph.IndirectAttribute : Swift.BitwiseCopyable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.Sendable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.External : Swift.Sendable {} +extension AttributeGraph.External : Swift.BitwiseCopyable {} +extension AttributeGraph.Attribute : Swift.Sendable {} +extension AttributeGraph.Attribute : Swift.BitwiseCopyable {} +extension AttributeGraph.WeakAttribute : Swift.Sendable {} +extension AttributeGraph.WeakAttribute : Swift.BitwiseCopyable {} extension AttributeGraph.OptionalAttribute : Swift.Sendable {} extension AttributeGraph.OptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.AnyOptionalAttribute : Swift.Sendable {} +extension AttributeGraph.AnyOptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.IndirectAttribute : Swift.Sendable {} +extension AttributeGraph.IndirectAttribute : Swift.BitwiseCopyable {} extension AttributeGraph.AnyRuleContext : Swift.Sendable {} extension AttributeGraph.AnyRuleContext : Swift.BitwiseCopyable {} extension AttributeGraph.RuleContext : Swift.Sendable {} extension AttributeGraph.RuleContext : Swift.BitwiseCopyable {} -extension AttributeGraph.WeakAttribute : Swift.Sendable {} -extension AttributeGraph.WeakAttribute : Swift.BitwiseCopyable {} diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface index 7187423..9fddf56 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface @@ -7,19 +7,19 @@ public import Swift public import _Concurrency public import _StringProcessing public import _SwiftConcurrencyShims -extension AnyAttribute { +extension AttributeGraph.AnyAttribute { public init(_ attribute: AttributeGraph.Attribute) public func unsafeCast(to _: Value.Type) -> AttributeGraph.Attribute - public static var current: AnyAttribute? { + public static var current: AttributeGraph.AnyAttribute? { get } - public func unsafeOffset(at offset: Swift.Int) -> AnyAttribute - public func setFlags(_ newFlags: AnyAttribute.Flags, mask: AnyAttribute.Flags) - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Swift.Int) + public func unsafeOffset(at offset: Swift.Int) -> AttributeGraph.AnyAttribute + public func setFlags(_ newFlags: AttributeGraph.AnyAttribute.Flags, mask: AttributeGraph.AnyAttribute.Flags) + public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor public func mutateBody(as type: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Swift.Void) - public func breadthFirstSearch(options _: SearchOptions = [], _: (AnyAttribute) -> Swift.Bool) -> Swift.Bool + public func breadthFirstSearch(options _: AttributeGraph.SearchOptions = [], _: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool public var _bodyType: any Any.Type { get } @@ -29,24 +29,69 @@ extension AnyAttribute { public var valueType: any Any.Type { get } - public var indirectDependency: AnyAttribute? { + public var indirectDependency: AttributeGraph.AnyAttribute? { get nonmutating set } } -extension AnyAttribute : Swift.CustomStringConvertible { +extension AttributeGraph.AnyAttribute : Swift.CustomStringConvertible { @inlinable public var description: Swift.String { get { "#\(rawValue)" } } } -public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void +public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void +@frozen public struct PointerOffset { + public var byteOffset: Swift.Int + public init(byteOffset: Swift.Int) +} +extension AttributeGraph.PointerOffset { + public static func + (lhs: AttributeGraph.PointerOffset, rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset +} +extension AttributeGraph.PointerOffset { + public static func invalidScenePointer() -> Swift.UnsafeMutablePointer + public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset + public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset +} +extension AttributeGraph.PointerOffset where Base == Member { + public init() +} +extension Swift.UnsafePointer { + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + } + public static func + (lhs: Swift.UnsafePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer +} +extension Swift.UnsafeMutablePointer { + public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { + unsafeAddress + nonmutating unsafeMutableAddress + } + public static func + (lhs: Swift.UnsafeMutablePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer +} +@frozen public struct External { + public init() +} +extension AttributeGraph.External : AttributeGraph._AttributeBody { + public static var comparisonMode: AttributeGraph.ComparisonMode { + get + } + public static var flags: AttributeGraph.External.Flags { + get + } + public static func _update(_: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) +} +extension AttributeGraph.External : Swift.CustomStringConvertible { + public var description: Swift.String { + get + } +} @frozen @propertyWrapper @dynamicMemberLookup public struct Attribute { - public var identifier: AnyAttribute - public init(identifier: AnyAttribute) + public var identifier: AttributeGraph.AnyAttribute + public init(identifier: AttributeGraph.AnyAttribute) public init(_ attribute: AttributeGraph.Attribute) public init(value: Value) public init(type _: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: _AttributeType.Flags = [], update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) where Body : AttributeGraph._AttributeBody + public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AttributeGraph._AttributeType.Flags = [], update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) where Body : AttributeGraph._AttributeBody public var wrappedValue: Value { unsafeAddress nonmutating set @@ -69,22 +114,22 @@ public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, An public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: SearchOptions = [], _ body: (AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var graph: Graph { + public func breadthFirstSearch(options: AttributeGraph.SearchOptions = [], _ body: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool + public var graph: AttributeGraph.Graph { get } - public var subgraph: Subgraph { + public var subgraph: AttributeGraph.Subgraph { get } public var value: Value { unsafeAddress nonmutating set } - public var valueState: ValueState { + public var valueState: AttributeGraph.ValueState { get } - public func valueAndFlags(options: AGValueOptions = []) -> (value: Value, flags: AGChangedValueFlags) - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool) + public func valueAndFlags(options: AttributeGraph.AGValueOptions = []) -> (value: Value, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) public func setValue(_ value: Value) -> Swift.Bool public var hasValue: Swift.Bool { get @@ -93,9 +138,9 @@ public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, An public func prefetchValue() public func invalidateValue() public func validate() - public func addInput(_ attribute: AnyAttribute, options: AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AGInputOptions = [], token: Swift.Int) - public typealias Flags = AnyAttribute.Flags + public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) + public typealias Flags = AttributeGraph.AnyAttribute.Flags public var flags: AttributeGraph.Attribute.Flags { get nonmutating set @@ -119,62 +164,29 @@ extension AttributeGraph.Attribute { public init(_ rule: R) where Value == R.Value, R : AttributeGraph.StatefulRule } @_silgen_name("AGGraphCreateAttribute") -@inline(__always) @inlinable internal func AGGraphCreateAttribute(index: Swift.Int, body: Swift.UnsafeRawPointer, value: Swift.UnsafeRawPointer?) -> AnyAttribute +@inline(__always) @inlinable internal func AGGraphCreateAttribute(index: Swift.Int, body: Swift.UnsafeRawPointer, value: Swift.UnsafeRawPointer?) -> AttributeGraph.AnyAttribute @_silgen_name("AGGraphGetValue") -@inline(__always) @inlinable internal func AGGraphGetValue(_ attribute: AnyAttribute, options: AGValueOptions = [], type: Value.Type = Value.self) -> AGValue +@inline(__always) @inlinable internal func AGGraphGetValue(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue @_silgen_name("AGGraphSetValue") -@inline(__always) @inlinable internal func AGGraphSetValue(_ attribute: AnyAttribute, valuePointer: Swift.UnsafePointer) -> Swift.Bool -@frozen public struct External { - public init() +@inline(__always) @inlinable internal func AGGraphSetValue(_ attribute: AttributeGraph.AnyAttribute, valuePointer: Swift.UnsafePointer) -> Swift.Bool +public protocol AttributeBodyVisitor { + func visit(body: Swift.UnsafePointer) where Body : AttributeGraph._AttributeBody } -extension AttributeGraph.External : AttributeGraph._AttributeBody { - public static var comparisonMode: ComparisonMode { - get - } - public static var flags: AttributeGraph.External.Flags { - get - } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) +public protocol ObservedAttribute : AttributeGraph._AttributeBody { + mutating func destroy() } -extension AttributeGraph.External : Swift.CustomStringConvertible { - public var description: Swift.String { +extension AttributeGraph.ObservedAttribute { + public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) + public static var _hasDestroySelf: Swift.Bool { get } } -@frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) -} -extension AttributeGraph.PointerOffset { - public static func + (lhs: AttributeGraph.PointerOffset, rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset where Base == Member { - public init() -} -extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (lhs: Swift.UnsafePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer -} -extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (lhs: Swift.UnsafeMutablePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer -} public protocol _AttributeBody { static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) static var _hasDestroySelf: Swift.Bool { get } static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - static var comparisonMode: ComparisonMode { get } - typealias Flags = _AttributeType.Flags + static var comparisonMode: AttributeGraph.ComparisonMode { get } + typealias Flags = AttributeGraph._AttributeType.Flags static var flags: Self.Flags { get } } extension AttributeGraph._AttributeBody { @@ -183,85 +195,148 @@ extension AttributeGraph._AttributeBody { get } public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - public static var comparisonMode: ComparisonMode { + public static var comparisonMode: AttributeGraph.ComparisonMode { get } public static var flags: Self.Flags { get } } -public protocol AttributeBodyVisitor { - func visit(body: Swift.UnsafePointer) where Body : AttributeGraph._AttributeBody -} -public protocol ObservedAttribute : AttributeGraph._AttributeBody { - mutating func destroy() -} -extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { +@frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { + internal var base: AttributeGraph.AnyWeakAttribute + public init(base: AttributeGraph.AnyWeakAttribute) + public init() + public init(_ attribute: AttributeGraph.Attribute) + public init(_ attribute: AttributeGraph.Attribute?) + public var wrappedValue: Value? { get } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { + public var projectedValue: AttributeGraph.Attribute? { get - nonmutating set + set + _modify } - public var dependency: AnyAttribute? { + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { get - nonmutating set } - public var value: Value { + public var attribute: AttributeGraph.Attribute? { get - nonmutating set - nonmutating _modify + set } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool) - public var wrappedValue: Value { + public var value: Value? { get - nonmutating set - nonmutating _modify } - public var projectedValue: AttributeGraph.Attribute { + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? +} +extension AttributeGraph.WeakAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.WeakAttribute, b: AttributeGraph.WeakAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { +} +extension AttributeGraph.WeakAttribute : Swift.CustomStringConvertible { + public var description: Swift.String { get } } -extension AttributeGraph.IndirectAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.IndirectAttribute, b: AttributeGraph.IndirectAttribute) -> Swift.Bool +extension AttributeGraph.AnyWeakAttribute { + public init(_ attribute: AttributeGraph.AnyAttribute?) + public init(_ weakAttribute: AttributeGraph.WeakAttribute) + public func unsafeCast(to _: Value.Type) -> AttributeGraph.WeakAttribute + public var attribute: AttributeGraph.AnyAttribute? { + get + set + } +} +extension AttributeGraph.AnyWeakAttribute : Swift.Hashable { + public static func == (lhs: AttributeGraph.AnyWeakAttribute, rhs: AttributeGraph.AnyWeakAttribute) -> Swift.Bool public func hash(into hasher: inout Swift.Hasher) public var hashValue: Swift.Int { get } } -@frozen public struct AnyOptionalAttribute { - public var identifier: AnyAttribute - public init() - public init(_ attribute: AnyAttribute) - public init(_ attribute: AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public static var current: AttributeGraph.AnyOptionalAttribute { +extension AttributeGraph.AnyWeakAttribute : Swift.CustomStringConvertible { + @_alwaysEmitIntoClient public var description: Swift.String { + get { attribute?.description ?? "nil" } + } +} +public protocol Rule : AttributeGraph._AttributeBody { + associatedtype Value + static var initialValue: Self.Value? { get } + var value: Self.Value { get } +} +extension AttributeGraph.Rule { + public static var initialValue: Self.Value? { + get + } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) + public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) +} +extension AttributeGraph.Rule { + public var attribute: AttributeGraph.Attribute { get } - public var attribute: AnyAttribute? { + public var context: AttributeGraph.RuleContext { get - set } - public func map(_ body: (AnyAttribute) -> Value) -> Value? - public func unsafeCast(to _: Value.Type) -> AttributeGraph.OptionalAttribute } -extension AttributeGraph.AnyOptionalAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.AnyOptionalAttribute, b: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { +extension AttributeGraph.Rule where Self : Swift.Hashable { + public func cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value + public func cachedValueIfExists(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value? + public static func _cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?, hashValue: Swift.Int, bodyPtr: Swift.UnsafeRawPointer, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.UnsafePointer +} +@frozen public struct Map : AttributeGraph.Rule, Swift.CustomStringConvertible { + public var arg: AttributeGraph.Attribute + public let body: (Source) -> Value + public init(_ arg: AttributeGraph.Attribute, _ body: @escaping (Source) -> Value) + public var value: Value { + get + } + public static var flags: AttributeGraph.Map.Flags { + get + } + public var description: Swift.String { get } } -extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { +public protocol StatefulRule : AttributeGraph._AttributeBody { + associatedtype Value + static var initialValue: Self.Value? { get } + mutating func updateValue() +} +extension AttributeGraph.StatefulRule { + public static var initialValue: Self.Value? { + get + } + public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) + public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) +} +extension AttributeGraph.StatefulRule { + public var attribute: AttributeGraph.Attribute { + get + } + public var context: AttributeGraph.RuleContext { + get + } + public var value: Self.Value { + unsafeAddress + nonmutating set + } + public var hasValue: Swift.Bool { + get + } +} +@frozen public struct Focus : AttributeGraph.Rule, Swift.CustomStringConvertible { + public var root: AttributeGraph.Attribute + public var keyPath: Swift.KeyPath + public init(root: AttributeGraph.Attribute, keyPath: Swift.KeyPath) + public var value: Value { + get + } + public static var flags: AttributeGraph.Focus.Flags { + get + } public var description: Swift.String { get } @@ -280,7 +355,7 @@ extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { public var value: Value? { get } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? public var wrappedValue: Value? { get @@ -306,89 +381,73 @@ extension AttributeGraph.OptionalAttribute : Swift.CustomStringConvertible { get } } -@frozen public struct Focus : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var root: AttributeGraph.Attribute - public var keyPath: Swift.KeyPath - public init(root: AttributeGraph.Attribute, keyPath: Swift.KeyPath) - public var value: Value { - get - } - public static var flags: AttributeGraph.Focus.Flags { +@frozen public struct AnyOptionalAttribute { + public var identifier: AttributeGraph.AnyAttribute + public init() + public init(_ attribute: AttributeGraph.AnyAttribute) + public init(_ attribute: AttributeGraph.AnyAttribute?) + public init(_ attribute: AttributeGraph.OptionalAttribute) + public static var current: AttributeGraph.AnyOptionalAttribute { get } - public var description: Swift.String { + public var attribute: AttributeGraph.AnyAttribute? { get + set } + public func map(_ body: (AttributeGraph.AnyAttribute) -> Value) -> Value? + public func unsafeCast(to _: Value.Type) -> AttributeGraph.OptionalAttribute } -@frozen public struct Map : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var arg: AttributeGraph.Attribute - public let body: (Source) -> Value - public init(_ arg: AttributeGraph.Attribute, _ body: @escaping (Source) -> Value) - public var value: Value { - get - } - public static var flags: AttributeGraph.Map.Flags { +extension AttributeGraph.AnyOptionalAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.AnyOptionalAttribute, b: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } +} +extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { public var description: Swift.String { get } } -public protocol Rule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - var value: Self.Value { get } -} -extension AttributeGraph.Rule { - public static var initialValue: Self.Value? { +@frozen @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { + public let identifier: AttributeGraph.AnyAttribute + public init(source: AttributeGraph.Attribute) + public var source: AttributeGraph.Attribute { get + nonmutating set } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { + public var dependency: AttributeGraph.AnyAttribute? { get + nonmutating set } - public var context: AttributeGraph.RuleContext { + public var value: Value { get + nonmutating set + nonmutating _modify } -} -extension AttributeGraph.Rule where Self : Swift.Hashable { - public func cachedValue(options: AGCachedValueOptions = [], owner: AnyAttribute?) -> Self.Value - public func cachedValueIfExists(options: AGCachedValueOptions = [], owner: AnyAttribute?) -> Self.Value? - public static func _cachedValue(options: AGCachedValueOptions = [], owner: AnyAttribute?, hashValue: Swift.Int, bodyPtr: Swift.UnsafeRawPointer, update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) -> Swift.UnsafePointer -} -public protocol StatefulRule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - mutating func updateValue() -} -extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { + public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) + public var wrappedValue: Value { get + nonmutating set + nonmutating _modify } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { + public var projectedValue: AttributeGraph.Attribute { get } - public var context: AttributeGraph.RuleContext { + public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { get } - public var value: Self.Value { - unsafeAddress - nonmutating set - } - public var hasValue: Swift.Bool { +} +extension AttributeGraph.IndirectAttribute : Swift.Hashable { + public static func == (a: AttributeGraph.IndirectAttribute, b: AttributeGraph.IndirectAttribute) -> Swift.Bool + public func hash(into hasher: inout Swift.Hasher) + public var hashValue: Swift.Int { get } } @frozen public struct AnyRuleContext : Swift.Equatable { - public var attribute: AnyAttribute - public init(attribute: AnyAttribute) + public var attribute: AttributeGraph.AnyAttribute + public init(attribute: AttributeGraph.AnyAttribute) public init(_ context: AttributeGraph.RuleContext) public subscript(attribute: AttributeGraph.Attribute) -> V { unsafeAddress @@ -399,8 +458,8 @@ extension AttributeGraph.StatefulRule { public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) public func update(body: () -> Swift.Void) public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext public static func == (a: AttributeGraph.AnyRuleContext, b: AttributeGraph.AnyRuleContext) -> Swift.Bool @@ -424,86 +483,41 @@ extension AttributeGraph.StatefulRule { public var hasValue: Swift.Bool { get } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, flags: AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AGValueOptions = []) -> (value: V, changed: Swift.Bool) + public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) + public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) public func update(body: () -> Swift.Void) public static func == (a: AttributeGraph.RuleContext, b: AttributeGraph.RuleContext) -> Swift.Bool } @_silgen_name("AGGraphGetInputValue") -@inline(__always) @inlinable internal func AGGraphGetInputValue(_ attribute: AnyAttribute, input: AnyAttribute, options: AGValueOptions = [], type: Value.Type = Value.self) -> AGValue +@inline(__always) @inlinable internal func AGGraphGetInputValue(_ attribute: AttributeGraph.AnyAttribute, input: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue @_silgen_name("AGGraphWithUpdate") -@inline(__always) @inlinable internal func AGGraphWithUpdate(_ attribute: AnyAttribute, body: () -> Swift.Void) -extension AnyWeakAttribute { - public init(_ attribute: AnyAttribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public func unsafeCast(to _: Value.Type) -> AttributeGraph.WeakAttribute - public var attribute: AnyAttribute? { - get - set - } -} -extension AnyWeakAttribute : Swift.Hashable { - public static func == (lhs: AnyWeakAttribute, rhs: AnyWeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension AnyWeakAttribute : Swift.CustomStringConvertible { - @_alwaysEmitIntoClient public var description: Swift.String { - get { attribute?.description ?? "nil" } - } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - internal var base: AnyWeakAttribute - public init(base: AnyWeakAttribute) - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { - get - } - public var projectedValue: AttributeGraph.Attribute? { - get - set - _modify - } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { - get - } - public var attribute: AttributeGraph.Attribute? { - get - set - } - public var value: Value? { - get - } - public func changedValue(options: AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? +@inline(__always) @inlinable internal func AGGraphWithUpdate(_ attribute: AttributeGraph.AnyAttribute, body: () -> Swift.Void) +extension AttributeGraph.Subgraph { + public typealias Flags = AttributeGraph.AnyAttribute.Flags + public typealias ChildFlags = AttributeGraph.AnyAttribute.Flags } -extension AttributeGraph.WeakAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.WeakAttribute, b: AttributeGraph.WeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } +extension AttributeGraph.Subgraph { + public func addObserver(_ observer: @escaping () -> Swift.Void) -> Swift.Int + public func apply(_ body: () -> Value) -> Value + public func forEach(_ flags: AttributeGraph.Subgraph.Flags, _ callback: (AttributeGraph.AnyAttribute) -> Swift.Void) } -extension AttributeGraph.WeakAttribute : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } +extension AttributeGraph.Subgraph { + public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) + public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) + public static func endTreeElement(value: AttributeGraph.Attribute) } -extension Graph { - public static func typeIndex(ctx: GraphContext, body: any AttributeGraph._AttributeBody.Type, valueType: Metadata, flags: _AttributeType.Flags, update: () -> (Swift.UnsafeMutableRawPointer, AnyAttribute) -> Swift.Void) -> Swift.Int +extension AttributeGraph.Graph { + public static func typeIndex(ctx: AttributeGraph.GraphContext, body: any AttributeGraph._AttributeBody.Type, valueType: AttributeGraph.Metadata, flags: AttributeGraph._AttributeType.Flags, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.Int } -extension Graph { +extension AttributeGraph.Graph { public static func withoutUpdate(_ body: () -> V) -> V public func withoutSubgraphInvalidation(_ body: () -> V) -> V public func withDeadline(_: Swift.UInt64, _: () -> V) -> V - public func onInvalidation(_ callback: @escaping (AnyAttribute) -> Swift.Void) + public func onInvalidation(_ callback: @escaping (AttributeGraph.AnyAttribute) -> Swift.Void) public func onUpdate(_ callback: @escaping () -> Swift.Void) public func withMainThreadHandler(_: (() -> Swift.Void) -> Swift.Void, do: () -> Swift.Void) } -extension Graph { +extension AttributeGraph.Graph { @_transparent public func startProfiling() { __AGGraphStartProfiling(self) } @@ -517,46 +531,27 @@ extension Graph { public static func stopProfiling() public static func resetProfile() } -extension Graph { +extension AttributeGraph.Graph { @_transparent public var mainUpdates: Swift.Int { @_transparent get { numericCast(counter(for: .mainThreadUpdates)) } } } -extension Graph { +extension AttributeGraph.Graph { @_silgen_name("AGGraphGetOutputValue") @inline(__always) @inlinable public static func outputValue() -> Swift.UnsafePointer? @_silgen_name("AGGraphSetOutputValue") @inline(__always) @inlinable public static func setOutputValue(_ value: Swift.UnsafePointer) } -extension Graph { - @_transparent public static func anyInputsChanged(excluding excludedInputs: [AnyAttribute]) -> Swift.Bool { +extension AttributeGraph.Graph { + @_transparent public static func anyInputsChanged(excluding excludedInputs: [AttributeGraph.AnyAttribute]) -> Swift.Bool { return __AGGraphAnyInputsChanged(excludedInputs, excludedInputs.count) } } -extension Graph { +extension AttributeGraph.Graph { public func archiveJSON(name: Swift.String?) } -extension Subgraph { - public typealias Flags = AnyAttribute.Flags - public typealias ChildFlags = AnyAttribute.Flags -} -extension Subgraph { - public func addObserver(_ observer: @escaping () -> Swift.Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: Subgraph.Flags, _ callback: (AnyAttribute) -> Swift.Void) -} -extension Subgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) -} -public func compareValues(_ lhs: Value, _ rhs: Value, mode: ComparisonMode = .equatableAlways) -> Swift.Bool -public func compareValues(_ lhs: Value, _ rhs: Value, options: ComparisonOptions) -> Swift.Bool -extension ComparisonOptions { - public init(mode: ComparisonMode) -} public func forEachField(of type: any Any.Type, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Void) -extension Metadata : Swift.Hashable, Swift.CustomStringConvertible { +extension AttributeGraph.Metadata : Swift.Hashable, Swift.CustomStringConvertible { public init(_ type: any Any.Type) public var type: any Any.Type { get @@ -564,16 +559,12 @@ extension Metadata : Swift.Hashable, Swift.CustomStringConvertible { public var description: Swift.String { get } - public func forEachField(options: Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool + public func forEachField(options: AttributeGraph.Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool } -extension Signature : Swift.Equatable { - public static func == (lhs: Signature, rhs: Signature) -> Swift.Bool +extension AttributeGraph.Signature : Swift.Equatable { + public static func == (lhs: AttributeGraph.Signature, rhs: AttributeGraph.Signature) -> Swift.Bool } -@discardableResult -public func withUnsafePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeRawPointer) -> ()) -> Swift.Bool -@discardableResult -public func withUnsafeMutablePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeMutableRawPointer) -> ()) -> Swift.Bool -extension TupleType { +extension AttributeGraph.TupleType { @_transparent public init(_ types: [any Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) } @@ -597,16 +588,16 @@ extension TupleType { @_transparent public func offset(at index: Swift.Int, as type: T.Type) -> Swift.Int { elementOffset(at: index, type: Metadata(type)) } - @_transparent public func setElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, from srcValue: Swift.UnsafePointer, options: TupleType.CopyOptions) { + @_transparent public func setElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, from srcValue: Swift.UnsafePointer, options: AttributeGraph.TupleType.CopyOptions) { __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) } - @_transparent public func getElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, to dstValue: Swift.UnsafeMutablePointer, options: TupleType.CopyOptions) { + @_transparent public func getElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, to dstValue: Swift.UnsafeMutablePointer, options: AttributeGraph.TupleType.CopyOptions) { __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) } } @_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: TupleType, count: Swift.Int, _ body: (UnsafeMutableTuple) -> Swift.Void) -extension UnsafeTuple { +public func withUnsafeTuple(of type: AttributeGraph.TupleType, count: Swift.Int, _ body: (AttributeGraph.UnsafeMutableTuple) -> Swift.Void) +extension AttributeGraph.UnsafeTuple { @_transparent public var count: Swift.Int { @_transparent get { type.count } } @@ -633,8 +624,8 @@ extension UnsafeTuple { @_transparent unsafeAddress { address(of: index, as: T.self) } } } -extension UnsafeMutableTuple { - @_transparent public init(with tupleType: TupleType) { +extension AttributeGraph.UnsafeMutableTuple { + @_transparent public init(with tupleType: AttributeGraph.TupleType) { self.init( type: tupleType, value: UnsafeMutableRawPointer.allocate( @@ -688,21 +679,30 @@ extension UnsafeMutableTuple { @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } } } -extension AttributeGraph.Attribute : Swift.Sendable {} -extension AttributeGraph.Attribute : Swift.BitwiseCopyable {} -extension AttributeGraph.External : Swift.Sendable {} -extension AttributeGraph.External : Swift.BitwiseCopyable {} +@discardableResult +public func withUnsafePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeRawPointer) -> ()) -> Swift.Bool +@discardableResult +public func withUnsafeMutablePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeMutableRawPointer) -> ()) -> Swift.Bool +public func compareValues(_ lhs: Value, _ rhs: Value, mode: AttributeGraph.ComparisonMode = .equatableAlways) -> Swift.Bool +public func compareValues(_ lhs: Value, _ rhs: Value, options: AttributeGraph.ComparisonOptions) -> Swift.Bool +extension AttributeGraph.ComparisonOptions { + public init(mode: AttributeGraph.ComparisonMode) +} extension AttributeGraph.PointerOffset : Swift.Sendable {} extension AttributeGraph.PointerOffset : Swift.BitwiseCopyable {} -extension AttributeGraph.IndirectAttribute : Swift.Sendable {} -extension AttributeGraph.IndirectAttribute : Swift.BitwiseCopyable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.Sendable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.External : Swift.Sendable {} +extension AttributeGraph.External : Swift.BitwiseCopyable {} +extension AttributeGraph.Attribute : Swift.Sendable {} +extension AttributeGraph.Attribute : Swift.BitwiseCopyable {} +extension AttributeGraph.WeakAttribute : Swift.Sendable {} +extension AttributeGraph.WeakAttribute : Swift.BitwiseCopyable {} extension AttributeGraph.OptionalAttribute : Swift.Sendable {} extension AttributeGraph.OptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.AnyOptionalAttribute : Swift.Sendable {} +extension AttributeGraph.AnyOptionalAttribute : Swift.BitwiseCopyable {} +extension AttributeGraph.IndirectAttribute : Swift.Sendable {} +extension AttributeGraph.IndirectAttribute : Swift.BitwiseCopyable {} extension AttributeGraph.AnyRuleContext : Swift.Sendable {} extension AttributeGraph.AnyRuleContext : Swift.BitwiseCopyable {} extension AttributeGraph.RuleContext : Swift.Sendable {} extension AttributeGraph.RuleContext : Swift.BitwiseCopyable {} -extension AttributeGraph.WeakAttribute : Swift.Sendable {} -extension AttributeGraph.WeakAttribute : Swift.BitwiseCopyable {} From 139fad1291e4f29f6e1de74750c54dd88145e6fb Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 28 Apr 2026 02:48:23 +0800 Subject: [PATCH 3/4] Ignore generated swiftinterface templates --- .gitignore | 3 + .../template.swiftinterface | 704 ------------------ AG/generate_swiftinterface.sh | 1 + AG/update.sh | 9 +- .../template.swiftinterface | 501 ------------- GF/generate_swiftinterface.sh | 1 + GF/update.sh | 7 +- 7 files changed, 14 insertions(+), 1212 deletions(-) delete mode 100644 AG/2024/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface delete mode 100644 GF/2025/Sources/Modules/Gestures.swiftmodule/template.swiftinterface diff --git a/.gitignore b/.gitignore index 4c332dc..01f7d2c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ _Headers .DS_Store +AG/*/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface +GF/*/Sources/Modules/Gestures.swiftmodule/template.swiftinterface + # Tuist generated (from Example/) DarwinPrivateFrameworks.xcodeproj Derived/ diff --git a/AG/2024/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface b/AG/2024/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface deleted file mode 100644 index 8f6ecb7..0000000 --- a/AG/2024/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface +++ /dev/null @@ -1,704 +0,0 @@ -@_exported public import AttributeGraph -public import Swift -public import _Concurrency -public import _StringProcessing -public import _SwiftConcurrencyShims -extension AttributeGraph.AnyAttribute { - public init(_ attribute: AttributeGraph.Attribute) - public func unsafeCast(to _: Value.Type) -> AttributeGraph.Attribute - public static var current: AttributeGraph.AnyAttribute? { - get - } - public func unsafeOffset(at offset: Swift.Int) -> AttributeGraph.AnyAttribute - public func setFlags(_ newFlags: AttributeGraph.AnyAttribute.Flags, mask: AttributeGraph.AnyAttribute.Flags) - public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) - public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor - public func mutateBody(as type: Value.Type, invalidating: Swift.Bool, _ body: (inout Value) -> Swift.Void) - public func breadthFirstSearch(options _: AttributeGraph.SearchOptions = [], _: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var _bodyType: any Any.Type { - get - } - public var _bodyPointer: Swift.UnsafeRawPointer { - get - } - public var valueType: any Any.Type { - get - } - public var indirectDependency: AttributeGraph.AnyAttribute? { - get - nonmutating set - } -} -extension AttributeGraph.AnyAttribute : Swift.CustomStringConvertible { - @inlinable public var description: Swift.String { - get { "#\(rawValue)" } - } -} -public typealias AttributeUpdateBlock = () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void -@frozen public struct PointerOffset { - public var byteOffset: Swift.Int - public init(byteOffset: Swift.Int) -} -extension AttributeGraph.PointerOffset { - public static func + (lhs: AttributeGraph.PointerOffset, rhs: AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset { - public static func invalidScenePointer() -> Swift.UnsafeMutablePointer - public static func of(_ member: inout Member) -> AttributeGraph.PointerOffset - public static func offset(_ body: (inout Base) -> AttributeGraph.PointerOffset) -> AttributeGraph.PointerOffset -} -extension AttributeGraph.PointerOffset where Base == Member { - public init() -} -extension Swift.UnsafePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - } - public static func + (lhs: Swift.UnsafePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafePointer -} -extension Swift.UnsafeMutablePointer { - public subscript(offset offset: AttributeGraph.PointerOffset) -> Member { - unsafeAddress - nonmutating unsafeMutableAddress - } - public static func + (lhs: Swift.UnsafeMutablePointer, rhs: AttributeGraph.PointerOffset) -> Swift.UnsafeMutablePointer -} -@frozen public struct External { - public init() -} -extension AttributeGraph.External : AttributeGraph._AttributeBody { - public static var comparisonMode: AttributeGraph.ComparisonMode { - get - } - public static var flags: AttributeGraph.External.Flags { - get - } - public static func _update(_: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) -} -extension AttributeGraph.External : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct Attribute { - public var identifier: AttributeGraph.AnyAttribute - public init(identifier: AttributeGraph.AnyAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(value: Value) - public init(type _: Value.Type) - public init(body: Swift.UnsafePointer, value: Swift.UnsafePointer?, flags: AttributeGraph._AttributeType.Flags = [], update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) where Body : AttributeGraph._AttributeBody - public var wrappedValue: Value { - unsafeAddress - nonmutating set - } - public var projectedValue: AttributeGraph.Attribute { - get - set - } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { - get - } - public subscript(keyPath keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { - get - } - public subscript(offset body: (inout Value) -> AttributeGraph.PointerOffset) -> AttributeGraph.Attribute { - get - } - public func unsafeCast(to type: V.Type) -> AttributeGraph.Attribute - public func unsafeOffset(at offset: Swift.Int, as _: Member.Type) -> AttributeGraph.Attribute - public func applying(offset: AttributeGraph.PointerOffset) -> AttributeGraph.Attribute - public func visitBody(_ visitor: inout Body) where Body : AttributeGraph.AttributeBodyVisitor - public func mutateBody(as type: V.Type, invalidating: Swift.Bool, _ body: (inout V) -> Swift.Void) - public func breadthFirstSearch(options: AttributeGraph.SearchOptions = [], _ body: (AttributeGraph.AnyAttribute) -> Swift.Bool) -> Swift.Bool - public var graph: AttributeGraph.Graph { - get - } - public var subgraph: AttributeGraph.Subgraph { - get - } - public var value: Value { - unsafeAddress - nonmutating set - } - public var valueState: AttributeGraph.ValueState { - get - } - public func valueAndFlags(options: AttributeGraph.AGValueOptions = []) -> (value: Value, flags: AttributeGraph.AGChangedValueFlags) - public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) - public func setValue(_ value: Value) -> Swift.Bool - public var hasValue: Swift.Bool { - get - } - public func updateValue() - public func prefetchValue() - public func invalidateValue() - public func validate() - public func addInput(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) - public func addInput(_ attribute: AttributeGraph.Attribute, options: AttributeGraph.AGInputOptions = [], token: Swift.Int) - public typealias Flags = AttributeGraph.AnyAttribute.Flags - public var flags: AttributeGraph.Attribute.Flags { - get - nonmutating set - } - public func setFlags(_ newFlags: AttributeGraph.Attribute.Flags, mask: AttributeGraph.Attribute.Flags) -} -extension AttributeGraph.Attribute : Swift.Hashable { - public static func == (a: AttributeGraph.Attribute, b: AttributeGraph.Attribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension AttributeGraph.Attribute : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } -} -extension AttributeGraph.Attribute { - public init(_ rule: R) where Value == R.Value, R : AttributeGraph.Rule - public init(_ rule: R) where Value == R.Value, R : AttributeGraph.StatefulRule -} -@_silgen_name("AGGraphCreateAttribute") -@inline(__always) @inlinable internal func AGGraphCreateAttribute(index: Swift.Int, body: Swift.UnsafeRawPointer, value: Swift.UnsafeRawPointer?) -> AttributeGraph.AnyAttribute -@_silgen_name("AGGraphGetValue") -@inline(__always) @inlinable internal func AGGraphGetValue(_ attribute: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue -@_silgen_name("AGGraphSetValue") -@inline(__always) @inlinable internal func AGGraphSetValue(_ attribute: AttributeGraph.AnyAttribute, valuePointer: Swift.UnsafePointer) -> Swift.Bool -public protocol AttributeBodyVisitor { - func visit(body: Swift.UnsafePointer) where Body : AttributeGraph._AttributeBody -} -public protocol ObservedAttribute : AttributeGraph._AttributeBody { - mutating func destroy() -} -extension AttributeGraph.ObservedAttribute { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { - get - } -} -public protocol _AttributeBody { - static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - static var _hasDestroySelf: Swift.Bool { get } - static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - static var comparisonMode: AttributeGraph.ComparisonMode { get } - typealias Flags = AttributeGraph._AttributeType.Flags - static var flags: Self.Flags { get } -} -extension AttributeGraph._AttributeBody { - public static func _destroySelf(_ pointer: Swift.UnsafeMutableRawPointer) - public static var _hasDestroySelf: Swift.Bool { - get - } - public static func _updateDefault(_ pointer: Swift.UnsafeMutableRawPointer) - public static var comparisonMode: AttributeGraph.ComparisonMode { - get - } - public static var flags: Self.Flags { - get - } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct WeakAttribute { - internal var base: AttributeGraph.AnyWeakAttribute - public init(base: AttributeGraph.AnyWeakAttribute) - public init() - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public var wrappedValue: Value? { - get - } - public var projectedValue: AttributeGraph.Attribute? { - get - set - _modify - } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { - get - } - public var attribute: AttributeGraph.Attribute? { - get - set - } - public var value: Value? { - get - } - public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? -} -extension AttributeGraph.WeakAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.WeakAttribute, b: AttributeGraph.WeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension AttributeGraph.WeakAttribute : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } -} -extension AttributeGraph.AnyWeakAttribute { - public init(_ attribute: AttributeGraph.AnyAttribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public func unsafeCast(to _: Value.Type) -> AttributeGraph.WeakAttribute - public var attribute: AttributeGraph.AnyAttribute? { - get - set - } -} -extension AttributeGraph.AnyWeakAttribute : Swift.Hashable { - public static func == (lhs: AttributeGraph.AnyWeakAttribute, rhs: AttributeGraph.AnyWeakAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension AttributeGraph.AnyWeakAttribute : Swift.CustomStringConvertible { - @_alwaysEmitIntoClient public var description: Swift.String { - get { attribute?.description ?? "nil" } - } -} -public protocol Rule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - var value: Self.Value { get } -} -extension AttributeGraph.Rule { - public static var initialValue: Self.Value? { - get - } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.Rule { - public var attribute: AttributeGraph.Attribute { - get - } - public var context: AttributeGraph.RuleContext { - get - } -} -extension AttributeGraph.Rule where Self : Swift.Hashable { - public func cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value - public func cachedValueIfExists(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?) -> Self.Value? - public static func _cachedValue(options: AttributeGraph.AGCachedValueOptions = [], owner: AttributeGraph.AnyAttribute?, hashValue: Swift.Int, bodyPtr: Swift.UnsafeRawPointer, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.UnsafePointer -} -@frozen public struct Map : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var arg: AttributeGraph.Attribute - public let body: (Source) -> Value - public init(_ arg: AttributeGraph.Attribute, _ body: @escaping (Source) -> Value) - public var value: Value { - get - } - public static var flags: AttributeGraph.Map.Flags { - get - } - public var description: Swift.String { - get - } -} -public protocol StatefulRule : AttributeGraph._AttributeBody { - associatedtype Value - static var initialValue: Self.Value? { get } - mutating func updateValue() -} -extension AttributeGraph.StatefulRule { - public static var initialValue: Self.Value? { - get - } - public static func _update(_ pointer: Swift.UnsafeMutableRawPointer, attribute _: AttributeGraph.AnyAttribute) - public static func _updateDefault(_: Swift.UnsafeMutableRawPointer) -} -extension AttributeGraph.StatefulRule { - public var attribute: AttributeGraph.Attribute { - get - } - public var context: AttributeGraph.RuleContext { - get - } - public var value: Self.Value { - unsafeAddress - nonmutating set - } - public var hasValue: Swift.Bool { - get - } -} -@frozen public struct Focus : AttributeGraph.Rule, Swift.CustomStringConvertible { - public var root: AttributeGraph.Attribute - public var keyPath: Swift.KeyPath - public init(root: AttributeGraph.Attribute, keyPath: Swift.KeyPath) - public var value: Value { - get - } - public static var flags: AttributeGraph.Focus.Flags { - get - } - public var description: Swift.String { - get - } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct OptionalAttribute { - public var base: AttributeGraph.AnyOptionalAttribute - public init() - public init(base: AttributeGraph.AnyOptionalAttribute) - public init(_ attribute: AttributeGraph.Attribute) - public init(_ attribute: AttributeGraph.Attribute?) - public init(_ weakAttribute: AttributeGraph.WeakAttribute) - public var attribute: AttributeGraph.Attribute? { - get - set - } - public var value: Value? { - get - } - public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool)? - public func map(_ body: (AttributeGraph.Attribute) -> V) -> V? - public var wrappedValue: Value? { - get - } - public var projectedValue: AttributeGraph.Attribute? { - get - set - _modify - } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute? { - get - } -} -extension AttributeGraph.OptionalAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.OptionalAttribute, b: AttributeGraph.OptionalAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension AttributeGraph.OptionalAttribute : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } -} -@frozen public struct AnyOptionalAttribute { - public var identifier: AttributeGraph.AnyAttribute - public init() - public init(_ attribute: AttributeGraph.AnyAttribute) - public init(_ attribute: AttributeGraph.AnyAttribute?) - public init(_ attribute: AttributeGraph.OptionalAttribute) - public static var current: AttributeGraph.AnyOptionalAttribute { - get - } - public var attribute: AttributeGraph.AnyAttribute? { - get - set - } - public func map(_ body: (AttributeGraph.AnyAttribute) -> Value) -> Value? - public func unsafeCast(to _: Value.Type) -> AttributeGraph.OptionalAttribute -} -extension AttributeGraph.AnyOptionalAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.AnyOptionalAttribute, b: AttributeGraph.AnyOptionalAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension AttributeGraph.AnyOptionalAttribute : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } -} -@frozen @propertyWrapper @dynamicMemberLookup public struct IndirectAttribute { - public let identifier: AttributeGraph.AnyAttribute - public init(source: AttributeGraph.Attribute) - public var source: AttributeGraph.Attribute { - get - nonmutating set - } - public var dependency: AttributeGraph.AnyAttribute? { - get - nonmutating set - } - public var value: Value { - get - nonmutating set - nonmutating _modify - } - public func changedValue(options: AttributeGraph.AGValueOptions = []) -> (value: Value, changed: Swift.Bool) - public var wrappedValue: Value { - get - nonmutating set - nonmutating _modify - } - public var projectedValue: AttributeGraph.Attribute { - get - } - public subscript(dynamicMember keyPath: Swift.KeyPath) -> AttributeGraph.Attribute { - get - } -} -extension AttributeGraph.IndirectAttribute : Swift.Hashable { - public static func == (a: AttributeGraph.IndirectAttribute, b: AttributeGraph.IndirectAttribute) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -@frozen public struct AnyRuleContext : Swift.Equatable { - public var attribute: AttributeGraph.AnyAttribute - public init(attribute: AttributeGraph.AnyAttribute) - public init(_ context: AttributeGraph.RuleContext) - public subscript(attribute: AttributeGraph.Attribute) -> V { - unsafeAddress - } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { - get - } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { - get - } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Swift.Void) - public func unsafeCast(to _: V.Type) -> AttributeGraph.RuleContext - public static func == (a: AttributeGraph.AnyRuleContext, b: AttributeGraph.AnyRuleContext) -> Swift.Bool -} -@frozen public struct RuleContext : Swift.Equatable { - public var attribute: AttributeGraph.Attribute - public init(attribute: AttributeGraph.Attribute) - public subscript(attribute: AttributeGraph.Attribute) -> V { - unsafeAddress - } - public subscript(weakAttribute: AttributeGraph.WeakAttribute) -> V? { - get - } - public subscript(optionalAttribute: AttributeGraph.OptionalAttribute) -> V? { - get - } - public var value: Value { - unsafeAddress - nonmutating set - } - public var hasValue: Swift.Bool { - get - } - public func valueAndFlags(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, flags: AttributeGraph.AGChangedValueFlags) - public func changedValue(of input: AttributeGraph.Attribute, options: AttributeGraph.AGValueOptions = []) -> (value: V, changed: Swift.Bool) - public func update(body: () -> Swift.Void) - public static func == (a: AttributeGraph.RuleContext, b: AttributeGraph.RuleContext) -> Swift.Bool -} -@_silgen_name("AGGraphGetInputValue") -@inline(__always) @inlinable internal func AGGraphGetInputValue(_ attribute: AttributeGraph.AnyAttribute, input: AttributeGraph.AnyAttribute, options: AttributeGraph.AGValueOptions = [], type: Value.Type = Value.self) -> AttributeGraph.AGValue -@_silgen_name("AGGraphWithUpdate") -@inline(__always) @inlinable internal func AGGraphWithUpdate(_ attribute: AttributeGraph.AnyAttribute, body: () -> Swift.Void) -extension AttributeGraph.Subgraph { - public typealias Flags = AttributeGraph.AnyAttribute.Flags - public typealias ChildFlags = AttributeGraph.AnyAttribute.Flags -} -extension AttributeGraph.Subgraph { - public func addObserver(_ observer: @escaping () -> Swift.Void) -> Swift.Int - public func apply(_ body: () -> Value) -> Value - public func forEach(_ flags: AttributeGraph.Subgraph.Flags, _ callback: (AttributeGraph.AnyAttribute) -> Swift.Void) -} -extension AttributeGraph.Subgraph { - public static func beginTreeElement(value: AttributeGraph.Attribute, flags: Swift.UInt32) - public static func addTreeValue(_ value: AttributeGraph.Attribute, forKey key: Swift.UnsafePointer, flags: Swift.UInt32) - public static func endTreeElement(value: AttributeGraph.Attribute) -} -extension AttributeGraph.Graph { - public static func typeIndex(ctx: AttributeGraph.GraphContext, body: any AttributeGraph._AttributeBody.Type, valueType: AttributeGraph.Metadata, flags: AttributeGraph._AttributeType.Flags, update: () -> (Swift.UnsafeMutableRawPointer, AttributeGraph.AnyAttribute) -> Swift.Void) -> Swift.Int -} -extension AttributeGraph.Graph { - public static func withoutUpdate(_ body: () -> V) -> V - public func withoutSubgraphInvalidation(_ body: () -> V) -> V - public func withDeadline(_: Swift.UInt64, _: () -> V) -> V - public func onInvalidation(_ callback: @escaping (AttributeGraph.AnyAttribute) -> Swift.Void) - public func onUpdate(_ callback: @escaping () -> Swift.Void) - public func withMainThreadHandler(_: (() -> Swift.Void) -> Swift.Void, do: () -> Swift.Void) -} -extension AttributeGraph.Graph { - @_transparent public func startProfiling() { - __AGGraphStartProfiling(self) - } - @_transparent public func stopProfiling() { - __AGGraphStopProfiling(self) - } - @_transparent public func resetProfile() { - __AGGraphResetProfile(self) - } - public static func startProfiling() - public static func stopProfiling() - public static func resetProfile() -} -extension AttributeGraph.Graph { - @_transparent public var mainUpdates: Swift.Int { - @_transparent get { numericCast(counter(for: .mainThreadUpdates)) } - } -} -extension AttributeGraph.Graph { - @_silgen_name("AGGraphGetOutputValue") - @inline(__always) @inlinable public static func outputValue() -> Swift.UnsafePointer? - @_silgen_name("AGGraphSetOutputValue") - @inline(__always) @inlinable public static func setOutputValue(_ value: Swift.UnsafePointer) -} -extension AttributeGraph.Graph { - @_transparent public static func anyInputsChanged(excluding excludedInputs: [AttributeGraph.AnyAttribute]) -> Swift.Bool { - return __AGGraphAnyInputsChanged(excludedInputs, excludedInputs.count) - } -} -extension AttributeGraph.Graph { - public func archiveJSON(name: Swift.String?) -} -public func forEachField(of type: any Any.Type, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Void) -extension AttributeGraph.Metadata : Swift.Hashable, Swift.CustomStringConvertible { - public init(_ type: any Any.Type) - public var type: any Any.Type { - get - } - public var description: Swift.String { - get - } - public func forEachField(options: AttributeGraph.Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool -} -extension AttributeGraph.Signature : Swift.Equatable { - public static func == (lhs: AttributeGraph.Signature, rhs: AttributeGraph.Signature) -> Swift.Bool -} -extension AttributeGraph.TupleType { - @_transparent public init(_ types: [any Any.Type]) { - self.init(count: types.count, elements: types.map(Metadata.init)) - } - @_transparent public init(_ type: any Any.Type) { - self.init(rawValue: unsafeBitCast(type, to: UnsafePointer<_Metadata>.self)) - } - @_transparent public var isEmpty: Swift.Bool { - @_transparent get { count == 0 } - } - @_transparent public var indices: Swift.Range { - @_transparent get { 0 ..< count } - } - @_transparent public var type: any Any.Type { - @_transparent get { - unsafeBitCast(rawValue, to: Any.Type.self) - } - } - @_transparent public func type(at index: Swift.Int) -> any Any.Type { - elementType(at: index).type - } - @_transparent public func offset(at index: Swift.Int, as type: T.Type) -> Swift.Int { - elementOffset(at: index, type: Metadata(type)) - } - @_transparent public func setElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, from srcValue: Swift.UnsafePointer, options: AttributeGraph.TupleType.CopyOptions) { - __AGTupleSetElement(self, tupleValue, index, srcValue, Metadata(T.self), options) - } - @_transparent public func getElement(in tupleValue: Swift.UnsafeMutableRawPointer, at index: Swift.Int, to dstValue: Swift.UnsafeMutablePointer, options: AttributeGraph.TupleType.CopyOptions) { - __AGTupleGetElement(self, tupleValue, index, dstValue, Metadata(T.self), options) - } -} -@_silgen_name("AGTupleWithBuffer") -public func withUnsafeTuple(of type: AttributeGraph.TupleType, count: Swift.Int, _ body: (AttributeGraph.UnsafeMutableTuple) -> Swift.Void) -extension AttributeGraph.UnsafeTuple { - @_transparent public var count: Swift.Int { - @_transparent get { type.count } - } - @_transparent public var isEmpty: Swift.Bool { - @_transparent get { type.isEmpty } - } - @_transparent public var indices: Swift.Range { - @_transparent get { type.indices } - } - @_transparent public func address(as _: T.Type = T.self) -> Swift.UnsafePointer { - guard type.type == T.self else { - preconditionFailure() - } - return value.assumingMemoryBound(to: T.self) - } - @_transparent public func address(of index: Swift.Int, as _: T.Type = T.self) -> Swift.UnsafePointer { - value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) - .assumingMemoryBound(to: T.self) - } - public subscript() -> T { - @_transparent unsafeAddress { address(as: T.self) } - } - public subscript(index: Swift.Int) -> T { - @_transparent unsafeAddress { address(of: index, as: T.self) } - } -} -extension AttributeGraph.UnsafeMutableTuple { - @_transparent public init(with tupleType: AttributeGraph.TupleType) { - self.init( - type: tupleType, - value: UnsafeMutableRawPointer.allocate( - byteCount: tupleType.size, - alignment: -1 - ) - ) - } - @_transparent public func initialize(at index: Swift.Int, to element: T) { - withUnsafePointer(to: element) { elementPointer in - type.setElement(in: value, at: index, from: elementPointer, options: .initCopy) - } - } - @_transparent public func deinitialize() { - type.destroy(value) - } - @_transparent public func deinitialize(at index: Swift.Int) { - type.destroy(value, at: index) - } - @_transparent public func deallocate(initialized: Swift.Bool) { - if initialized { - deinitialize() - } - value.deallocate() - } - @_transparent public var count: Swift.Int { - @_transparent get { type.count } - } - @_transparent public var isEmpty: Swift.Bool { - @_transparent get { type.isEmpty } - } - @_transparent public var indices: Swift.Range { - @_transparent get { type.indices } - } - @_transparent public func address(as _: T.Type = T.self) -> Swift.UnsafeMutablePointer { - guard type.type == T.self else { - preconditionFailure() - } - return value.assumingMemoryBound(to: T.self) - } - @_transparent public func address(of index: Swift.Int, as _: T.Type = T.self) -> Swift.UnsafeMutablePointer { - value.advanced(by: type.elementOffset(at: index, type: Metadata(T.self))) - .assumingMemoryBound(to: T.self) - } - public subscript() -> T { - @_transparent unsafeAddress { UnsafePointer(address(as: T.self)) } - @_transparent nonmutating unsafeMutableAddress { address(as: T.self) } - } - public subscript(index: Swift.Int) -> T { - @_transparent unsafeAddress { UnsafePointer(address(of: index, as: T.self)) } - @_transparent nonmutating unsafeMutableAddress { address(of: index, as: T.self) } - } -} -@discardableResult -public func withUnsafePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeRawPointer) -> ()) -> Swift.Bool -@discardableResult -public func withUnsafeMutablePointerToEnumCase(of value: Swift.UnsafeMutablePointer, do body: (Swift.Int, any Any.Type, Swift.UnsafeMutableRawPointer) -> ()) -> Swift.Bool -public func compareValues(_ lhs: Value, _ rhs: Value, mode: AttributeGraph.ComparisonMode = .equatableAlways) -> Swift.Bool -public func compareValues(_ lhs: Value, _ rhs: Value, options: AttributeGraph.ComparisonOptions) -> Swift.Bool -extension AttributeGraph.ComparisonOptions { - public init(mode: AttributeGraph.ComparisonMode) -} -extension AttributeGraph.PointerOffset : Swift.Sendable {} -extension AttributeGraph.PointerOffset : Swift.BitwiseCopyable {} -extension AttributeGraph.External : Swift.Sendable {} -extension AttributeGraph.External : Swift.BitwiseCopyable {} -extension AttributeGraph.Attribute : Swift.Sendable {} -extension AttributeGraph.Attribute : Swift.BitwiseCopyable {} -extension AttributeGraph.WeakAttribute : Swift.Sendable {} -extension AttributeGraph.WeakAttribute : Swift.BitwiseCopyable {} -extension AttributeGraph.OptionalAttribute : Swift.Sendable {} -extension AttributeGraph.OptionalAttribute : Swift.BitwiseCopyable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.Sendable {} -extension AttributeGraph.AnyOptionalAttribute : Swift.BitwiseCopyable {} -extension AttributeGraph.IndirectAttribute : Swift.Sendable {} -extension AttributeGraph.IndirectAttribute : Swift.BitwiseCopyable {} -extension AttributeGraph.AnyRuleContext : Swift.Sendable {} -extension AttributeGraph.AnyRuleContext : Swift.BitwiseCopyable {} -extension AttributeGraph.RuleContext : Swift.Sendable {} -extension AttributeGraph.RuleContext : Swift.BitwiseCopyable {} diff --git a/AG/generate_swiftinterface.sh b/AG/generate_swiftinterface.sh index 6279506..2dbc5ec 100755 --- a/AG/generate_swiftinterface.sh +++ b/AG/generate_swiftinterface.sh @@ -81,6 +81,7 @@ if [ ! -f "${GENERATED}" ]; then fi # Strip the compiler header comments (update.sh generates per-platform headers) +mkdir -p "$(dirname "${TEMPLATE_PATH}")" sed -e '/^\/\/ swift-/d' \ "${GENERATED}" > "${TEMPLATE_PATH}" diff --git a/AG/update.sh b/AG/update.sh index a4adb17..779a74a 100755 --- a/AG/update.sh +++ b/AG/update.sh @@ -9,6 +9,7 @@ filepath() { VERSION=${DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE:-2024} FRAMEWORK_ROOT="$(dirname $(filepath $0))/$VERSION" +TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface" # Version mapping logic if [ "$VERSION" = "2021" ]; then @@ -42,7 +43,7 @@ generate_swiftinterface() { local name="$1".swiftinterface local target="$2" generate_swiftinterface_header $target > $name - cat template.swiftinterface >> $name + cat "${TEMPLATE_PATH}" >> $name } update_version_in_header() { @@ -118,7 +119,7 @@ generate_xcframework $framework_name generate_framework $framework_name ios-arm64-x86_64-simulator generate_swiftinterface x86_64-apple-ios-simulator x86_64-apple-ios${IOS_VERSION}-simulator generate_swiftinterface arm64-apple-ios-simulator arm64-apple-ios${IOS_VERSION}-simulator -rm template.swiftinterface +rm -f template.swiftinterface generate_framework $framework_name ios-arm64-arm64e # iPhoneOS platform does not support links Swift API of AttributeGraph @@ -129,12 +130,12 @@ generate_macos_framework $framework_name macos-arm64e-arm64-x86_64 generate_swiftinterface x86_64-apple-macos x86_64-apple-macos${MACOS_VERSION} generate_swiftinterface arm64-apple-macos arm64-apple-macos${MACOS_VERSION} generate_swiftinterface arm64e-apple-macos arm64e-apple-macos${MACOS_VERSION} -rm template.swiftinterface +rm -f template.swiftinterface # Add visionOS support if available if [ -n "$XROS_VERSION" ] && [ -d "${FRAMEWORK_ROOT}/tbds/xros-arm64-x86_64-simulator" ]; then generate_framework $framework_name xros-arm64-x86_64-simulator generate_swiftinterface x86_64-apple-xros-simulator x86_64-apple-xros${XROS_VERSION}-simulator generate_swiftinterface arm64-apple-xros-simulator arm64-apple-xros${XROS_VERSION}-simulator - rm template.swiftinterface + rm -f template.swiftinterface fi diff --git a/GF/2025/Sources/Modules/Gestures.swiftmodule/template.swiftinterface b/GF/2025/Sources/Modules/Gestures.swiftmodule/template.swiftinterface deleted file mode 100644 index f135e0e..0000000 --- a/GF/2025/Sources/Modules/Gestures.swiftmodule/template.swiftinterface +++ /dev/null @@ -1,501 +0,0 @@ -public import Dispatch -@_exported public import Gestures -public import Swift -public import _Concurrency -public import _StringProcessing -public import _SwiftConcurrencyShims -public enum GestureOutput : Swift.Sendable where Value : Swift.Sendable { - case empty(Gestures.GestureOutputEmptyReason, metadata: Gestures.GestureOutputMetadata?) - case value(Value, metadata: Gestures.GestureOutputMetadata?) - case finalValue(Value, metadata: Gestures.GestureOutputMetadata?) -} -extension Gestures.GestureOutput { - #if compiler(>=5.3) && $NonescapableTypes - public var value: Value? { - get - } - #endif - public var isEmpty: Swift.Bool { - get - } - public var isFinal: Swift.Bool { - get - } -} -public enum GestureOutputEmptyReason : Swift.Hashable, Swift.Sendable { - case noData - case filtered - case timeUpdate - public static func == (a: Gestures.GestureOutputEmptyReason, b: Gestures.GestureOutputEmptyReason) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -public struct GestureOutputMetadata : Swift.Sendable { -} -public struct GestureTrait : Swift.Hashable, Swift.Identifiable, Swift.Sendable { - public var id: Gestures.GestureTraitID - public var attributes: [Gestures.GestureTrait.AttributeKey : Gestures.GestureTrait.AttributeValue] - public init(id: Gestures.GestureTraitID, attributes: [Gestures.GestureTrait.AttributeKey : Gestures.GestureTrait.AttributeValue] = [:]) - #if compiler(>=5.3) && $NonescapableTypes - public static func tap(tapCount: Swift.Int? = nil, pointCount: Swift.Int? = nil) -> Gestures.GestureTrait - #endif - #if compiler(>=5.3) && $NonescapableTypes - public static func longPress(pointCount: Swift.Int? = nil, minimumDuration: Swift.Duration? = nil, maximumMovement: Swift.Double? = nil) -> Gestures.GestureTrait - #endif - public static func pan() -> Gestures.GestureTrait - public struct AttributeKey : Swift.Hashable, Swift.Sendable, Swift.CustomStringConvertible { - public let rawValue: Swift.Int - public init(_ label: Swift.String) - public var description: Swift.String { - get - } - public static let pointCount: Gestures.GestureTrait.AttributeKey - public static let tapCount: Gestures.GestureTrait.AttributeKey - public static let minimumDuration: Gestures.GestureTrait.AttributeKey - public static let maximumMovement: Gestures.GestureTrait.AttributeKey - public static func == (a: Gestures.GestureTrait.AttributeKey, b: Gestures.GestureTrait.AttributeKey) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } - } - public enum AttributeValue : Swift.Hashable, Swift.Sendable, Swift.CustomStringConvertible { - case bool(Swift.Bool) - case int(Swift.Int) - case double(Swift.Double) - public var description: Swift.String { - get - } - public static func == (a: Gestures.GestureTrait.AttributeValue, b: Gestures.GestureTrait.AttributeValue) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } - } - public static func == (a: Gestures.GestureTrait, b: Gestures.GestureTrait) -> Swift.Bool - public typealias ID = Gestures.GestureTraitID - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension Gestures.GestureTrait { - public var label: Swift.String { - get - } -} -public struct GestureTraitID : Swift.Hashable, Swift.Sendable { - public let rawValue: Swift.Int - public init(_ label: Swift.String) - public static let tap: Gestures.GestureTraitID - public static let longPress: Gestures.GestureTraitID - public static let pan: Gestures.GestureTraitID - public static func == (a: Gestures.GestureTraitID, b: Gestures.GestureTraitID) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -public struct GestureTraitCollection : Swift.Hashable, Swift.Sendable { - public init(traits: [Gestures.GestureTrait] = []) - public static func withTrait(_ trait: Gestures.GestureTrait) -> Gestures.GestureTraitCollection - public var allTraits: [Gestures.GestureTrait] { - get - } - public func containsSubtraits(from other: Gestures.GestureTraitCollection) -> Swift.Bool - public static func == (a: Gestures.GestureTraitCollection, b: Gestures.GestureTraitCollection) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -public enum GestureRelationType : Swift.Hashable, Swift.Sendable { - case exclusion - case activeExclusion - case failureRequirement - public static func == (a: Gestures.GestureRelationType, b: Gestures.GestureRelationType) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -public enum GestureRelationRole : Swift.Hashable, Swift.Sendable { - case regular - case blocking - public static func == (a: Gestures.GestureRelationRole, b: Gestures.GestureRelationRole) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -public enum GestureRelationDirection : Swift.Hashable, Swift.Sendable { - case outgoing - case incoming - public static func == (a: Gestures.GestureRelationDirection, b: Gestures.GestureRelationDirection) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -public struct GestureRelation : Swift.Equatable, Swift.Sendable { - public var type: Gestures.GestureRelationType - public var direction: Gestures.GestureRelationDirection - public var role: Gestures.GestureRelationRole? - public var target: Gestures.GestureNodeMatcher - #if compiler(>=5.3) && $NonescapableTypes - public init(type: Gestures.GestureRelationType, direction: Gestures.GestureRelationDirection, role: Gestures.GestureRelationRole?, target: Gestures.GestureNodeMatcher) - #endif - public static func == (a: Gestures.GestureRelation, b: Gestures.GestureRelation) -> Swift.Bool -} -extension Swift.Array where Element == Gestures.GestureRelation { - public static var `default`: [Gestures.GestureRelation] { - get - } -} -public enum GesturePhase : Swift.Sendable where Value : Swift.Sendable { - case idle - case possible - case blocked(value: Value, blockedBy: Gestures.GestureNodeID) - case active(value: Value) - case ended(value: Value) - case failed(reason: Gestures.GestureFailureReason) -} -extension Gestures.GesturePhase { - public var isIdle: Swift.Bool { - get - } - public var isPossible: Swift.Bool { - get - } - public var isActive: Swift.Bool { - get - } - public var isBlocked: Swift.Bool { - get - } - public var isEnded: Swift.Bool { - get - } - public var isFailed: Swift.Bool { - get - } - public var isTerminal: Swift.Bool { - get - } - public var isRecognized: Swift.Bool { - get - } - #if compiler(>=5.3) && $NonescapableTypes - public var value: Value? { - get - } - #endif - #if compiler(>=5.3) && $NonescapableTypes - public var failureReason: Gestures.GestureFailureReason? { - get - } - #endif - public func mapValue(_ transform: (Value) -> T) -> Gestures.GesturePhase where T : Swift.Sendable -} -extension Gestures.GesturePhase : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } -} -public enum GestureFailureReason : Swift.Sendable { - case excluded(by: Gestures.GestureNodeID) - case failureDependency(on: Gestures.GestureNodeID) - case custom(any Swift.Error) - case disabled - case removedFromContainer - case activationDenied - case aborted - case coordinatorChanged -} -extension Gestures.GestureFailureReason : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } -} -public enum GestureNodeMatcher : Swift.Hashable, Swift.Sendable { - case id(Gestures.GestureNodeID) - case tag(Gestures.GestureTag) - case traits(Gestures.GestureTraitCollection, position: Gestures.GestureNodeMatcher.RelativePosition) - case any(position: Gestures.GestureNodeMatcher.RelativePosition) - public enum RelativePosition : Swift.Hashable, Swift.Sendable { - case any - case above - case below - public static func == (a: Gestures.GestureNodeMatcher.RelativePosition, b: Gestures.GestureNodeMatcher.RelativePosition) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } - } - public static func == (a: Gestures.GestureNodeMatcher, b: Gestures.GestureNodeMatcher) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension Gestures.GestureNodeMatcher : Swift.Comparable { - public static func < (lhs: Gestures.GestureNodeMatcher, rhs: Gestures.GestureNodeMatcher) -> Swift.Bool -} -@frozen public struct GestureTag : Swift.Hashable, Swift.Sendable, Swift.ExpressibleByStringLiteral, Swift.CustomStringConvertible { - public let rawValue: Swift.String - public init(rawValue: Swift.String) - public init(stringLiteral value: Swift.String) - public var description: Swift.String { - get - } - public static func == (a: Gestures.GestureTag, b: Gestures.GestureTag) -> Swift.Bool - public typealias ExtendedGraphemeClusterLiteralType = Swift.String - public typealias StringLiteralType = Swift.String - public typealias UnicodeScalarLiteralType = Swift.String - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -extension Gestures.GFGesturePhase : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } -} -extension Gestures.GFGestureRelationType : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } -} -extension Gestures.GFGestureRelationRole : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } -} -public protocol LocationContaining { - var location: CoreFoundation.CGPoint { get } -} -extension CoreFoundation.CGPoint : Gestures.LocationContaining { - public var location: CoreFoundation.CGPoint { - get - } -} -extension Swift.Never : Gestures.LocationContaining { - public var location: CoreFoundation.CGPoint { - get - } -} -@frozen public struct GestureNodeID : Swift.Hashable, Swift.Comparable, Swift.Sendable, Swift.CustomStringConvertible { - package let rawValue: Swift.UInt32 - public static func < (lhs: Gestures.GestureNodeID, rhs: Gestures.GestureNodeID) -> Swift.Bool - public var description: Swift.String { - get - } - public static func == (a: Gestures.GestureNodeID, b: Gestures.GestureNodeID) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -public struct GestureNodeOptions : Swift.OptionSet, Swift.Sendable { - public let rawValue: Swift.Int - public init(rawValue: Swift.Int) - public static let isDisabled: Gestures.GestureNodeOptions - public static let disallowExclusionWithUnresolvedFailureRequirements: Gestures.GestureNodeOptions - public static let isGloballyScoped: Gestures.GestureNodeOptions - public typealias ArrayLiteralElement = Gestures.GestureNodeOptions - public typealias Element = Gestures.GestureNodeOptions - public typealias RawValue = Swift.Int -} -extension Gestures.GestureNodeOptions : Swift.CustomStringConvertible { - public var description: Swift.String { - get - } -} -public protocol TimeSource { - var timestamp: Gestures.Timestamp { get } -} -extension Swift.Never : Gestures.TimeSource { - public var timestamp: Gestures.Timestamp { - get - } -} -public protocol TimeSourceImpl : Gestures.TimeSource { - var _duration: Swift.Duration { get } -} -public protocol GestureUpdateDriver : Swift.Sendable { - func register(_ handler: @escaping () -> Swift.Void) -> Gestures.GestureUpdateDriverToken - func unregister(token: Gestures.GestureUpdateDriverToken) -} -public struct GestureUpdateDriverToken : Swift.Hashable, Swift.Sendable { - public var value: Swift.UInt32 - public init(value: Swift.UInt32) - public static func == (a: Gestures.GestureUpdateDriverToken, b: Gestures.GestureUpdateDriverToken) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -@_hasMissingDesignatedInitializers final public class UpdateScheduler { - @objc deinit -} -public protocol TimeScheduler : AnyObject, Gestures.TimeSource { - #if compiler(>=5.3) && $NonescapableTypes - func schedule(after duration: Swift.Duration, handler: @escaping () -> Swift.Void, cancelHandler: (() -> Swift.Void)?) -> Gestures.TimeSchedulerToken - #endif - func cancel(token: Gestures.TimeSchedulerToken) -} -public struct TimeSchedulerToken : Swift.Hashable, Swift.Sendable { - public let rawValue: Swift.Int - public init(rawValue: Swift.Int) - public static func == (a: Gestures.TimeSchedulerToken, b: Gestures.TimeSchedulerToken) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -final public class DispatchTimeScheduler : @unchecked Swift.Sendable, Gestures.TimeScheduler { - final public let queue: Dispatch.DispatchQueue - final public let timeSource: any Gestures.TimeSource - public init(queue: Dispatch.DispatchQueue, timeSource: any Gestures.TimeSource) - final public var timestamp: Gestures.Timestamp { - get - } - #if compiler(>=5.3) && $NonescapableTypes - final public func schedule(after duration: Swift.Duration, handler: @escaping () -> Swift.Void, cancelHandler: (() -> Swift.Void)? = nil) -> Gestures.TimeSchedulerToken - #endif - final public func cancel(token: Gestures.TimeSchedulerToken) - @objc deinit -} -@frozen public struct Timestamp : Swift.Hashable, Swift.Comparable, Swift.Sendable, Swift.CustomStringConvertible { - package let value: Swift.Duration - public static func < (lhs: Gestures.Timestamp, rhs: Gestures.Timestamp) -> Swift.Bool - public var description: Swift.String { - get - } - public func advanced(by duration: Swift.Duration) -> Gestures.Timestamp - public func duration(to other: Gestures.Timestamp) -> Swift.Duration - public static func + (lhs: Gestures.Timestamp, rhs: Swift.Duration) -> Gestures.Timestamp - public static func - (lhs: Gestures.Timestamp, rhs: Swift.Duration) -> Gestures.Timestamp - public static func - (lhs: Gestures.Timestamp, rhs: Gestures.Timestamp) -> Swift.Duration - public static func += (lhs: inout Gestures.Timestamp, rhs: Swift.Duration) - public static func -= (lhs: inout Gestures.Timestamp, rhs: Swift.Duration) - public static func == (a: Gestures.Timestamp, b: Gestures.Timestamp) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -public struct UptimeTimeSource : Gestures.TimeSourceImpl, Swift.Sendable { - public init() - public var _duration: Swift.Duration { - get - } -} -public protocol Event : Swift.Identifiable { - var id: Gestures.EventID { get } - var phase: Gestures.EventPhase { get } - var timestamp: Gestures.Timestamp { get } -} -extension Swift.Never : Gestures.Event { - public var id: Gestures.EventID { - get - } - public var phase: Gestures.EventPhase { - get - } -} -public enum EventPhase : Swift.Hashable, Swift.Sendable { - case began - case active - case ended - case failed - public static func == (a: Gestures.EventPhase, b: Gestures.EventPhase) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -public protocol ScrollEvent : Gestures.SpatialEvent { - var delta: CoreFoundation.CGVector { get } - var acceleratedDelta: CoreFoundation.CGVector { get } -} -extension Swift.Never : Gestures.ScrollEvent { - public var delta: CoreFoundation.CGVector { - get - } - public var acceleratedDelta: CoreFoundation.CGVector { - get - } -} -public struct ConcreteScrollEvent : Gestures.ScrollEvent, Swift.Sendable { - public var id: Gestures.EventID - public var phase: Gestures.EventPhase - public var timestamp: Gestures.Timestamp - public var location: CoreFoundation.CGPoint - public var delta: CoreFoundation.CGVector - public var acceleratedDelta: CoreFoundation.CGVector - public init(id: Gestures.EventID, phase: Gestures.EventPhase, timestamp: Gestures.Timestamp, location: CoreFoundation.CGPoint, delta: CoreFoundation.CGVector, acceleratedDelta: CoreFoundation.CGVector) - public typealias ID = Gestures.EventID -} -public struct TouchEvent : Gestures.SpatialEvent, Swift.Sendable { - public var id: Gestures.EventID - public var phase: Gestures.EventPhase - public var timestamp: Gestures.Timestamp - public var location: CoreFoundation.CGPoint - public init(id: Gestures.EventID, phase: Gestures.EventPhase, timestamp: Gestures.Timestamp, location: CoreFoundation.CGPoint) - public typealias ID = Gestures.EventID -} -public struct MouseEvent : Gestures.SpatialEvent, Swift.Sendable { - public let id: Gestures.EventID - public let phase: Gestures.EventPhase - public let timestamp: Gestures.Timestamp - public let location: CoreFoundation.CGPoint - public let button: Gestures.MouseEvent.Button - public init(id: Gestures.EventID, phase: Gestures.EventPhase, timestamp: Gestures.Timestamp, location: CoreFoundation.CGPoint, button: Gestures.MouseEvent.Button) - public struct Button : Swift.RawRepresentable, Swift.Sendable { - public let rawValue: Swift.Int - public init(rawValue: Swift.Int) - public static let primary: Gestures.MouseEvent.Button - public static let secondary: Gestures.MouseEvent.Button - public static let tertiary: Gestures.MouseEvent.Button - public typealias RawValue = Swift.Int - } - public typealias ID = Gestures.EventID -} -public struct EventID : Swift.Hashable, Swift.CustomStringConvertible, Swift.Sendable { - public let rawValue: Swift.Int - public init(rawValue: Swift.Int) - public var description: Swift.String { - get - } - public static func == (a: Gestures.EventID, b: Gestures.EventID) -> Swift.Bool - public func hash(into hasher: inout Swift.Hasher) - public var hashValue: Swift.Int { - get - } -} -public protocol SpatialEvent : Gestures.Event, Gestures.LocationContaining { -} -extension Swift.Never : Gestures.SpatialEvent { -} -extension Gestures.GestureOutput : Swift.CustomStringConvertible {} -extension Gestures.GestureOutput : Swift.CustomDebugStringConvertible {} -extension Gestures.GestureOutputMetadata : Swift.CustomStringConvertible {} -extension Gestures.GestureOutputMetadata : Swift.CustomDebugStringConvertible {} -extension Gestures.GestureTrait : Swift.CustomStringConvertible {} -extension Gestures.GestureTrait : Swift.CustomDebugStringConvertible {} -extension Gestures.GestureTraitCollection : Swift.CustomStringConvertible {} -extension Gestures.GestureTraitCollection : Swift.CustomDebugStringConvertible {} -extension Gestures.GestureNodeMatcher : Swift.CustomStringConvertible {} -extension Gestures.GestureNodeMatcher : Swift.CustomDebugStringConvertible {} -extension Gestures.GestureNodeID : Swift.BitwiseCopyable {} -extension Gestures.Timestamp : Swift.BitwiseCopyable {} -extension Gestures.ConcreteScrollEvent : Swift.CustomStringConvertible {} -extension Gestures.ConcreteScrollEvent : Swift.CustomDebugStringConvertible {} -extension Gestures.TouchEvent : Swift.CustomStringConvertible {} -extension Gestures.TouchEvent : Swift.CustomDebugStringConvertible {} -extension Gestures.MouseEvent : Swift.CustomStringConvertible {} -extension Gestures.MouseEvent : Swift.CustomDebugStringConvertible {} diff --git a/GF/generate_swiftinterface.sh b/GF/generate_swiftinterface.sh index bef229f..1be53e1 100755 --- a/GF/generate_swiftinterface.sh +++ b/GF/generate_swiftinterface.sh @@ -82,6 +82,7 @@ if [ ! -f "${GENERATED}" ]; then fi # Strip the compiler header comments (update.sh generates per-platform headers) +mkdir -p "$(dirname "${TEMPLATE_PATH}")" sed -e '/^\/\/ swift-/d' \ "${GENERATED}" > "${TEMPLATE_PATH}" diff --git a/GF/update.sh b/GF/update.sh index 486c96e..adcfa41 100755 --- a/GF/update.sh +++ b/GF/update.sh @@ -9,6 +9,7 @@ filepath() { VERSION=${DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE:-2025} FRAMEWORK_ROOT="$(dirname $(filepath $0))/$VERSION" +TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/Gestures.swiftmodule/template.swiftinterface" IOS_VERSION="26.0" MACOS_VERSION="26.0" @@ -30,7 +31,7 @@ generate_swiftinterface() { local name="$1".swiftinterface local target="$2" generate_swiftinterface_header $target > $name - cat template.swiftinterface >> $name + cat "${TEMPLATE_PATH}" >> $name } generate_framework() { @@ -73,7 +74,7 @@ generate_framework $framework_name ios-arm64-x86_64-simulator cd ${FRAMEWORK_ROOT}/${framework_name}.xcframework/ios-arm64-x86_64-simulator/${framework_name}.framework/Modules/${framework_name}.swiftmodule generate_swiftinterface x86_64-apple-ios-simulator x86_64-apple-ios${IOS_VERSION}-simulator generate_swiftinterface arm64-apple-ios-simulator arm64-apple-ios${IOS_VERSION}-simulator -rm template.swiftinterface +rm -f template.swiftinterface generate_macos_framework() { local framework_name=$1 @@ -103,4 +104,4 @@ cd ${FRAMEWORK_ROOT}/${framework_name}.xcframework/macos-arm64e-arm64-x86_64/${f generate_swiftinterface x86_64-apple-macos x86_64-apple-macos${MACOS_VERSION} generate_swiftinterface arm64-apple-macos arm64-apple-macos${MACOS_VERSION} generate_swiftinterface arm64e-apple-macos arm64e-apple-macos${MACOS_VERSION} -rm template.swiftinterface +rm -f template.swiftinterface From ccf04269746dd9d221b3080fd6a0bdd58868ab42 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 28 Apr 2026 23:03:26 +0800 Subject: [PATCH 4/4] Fix xcframework update bootstrap --- .gitignore | 4 +- .../arm64-apple-ios-simulator.swiftinterface | 3 -- .../x86_64-apple-ios-simulator.swiftinterface | 3 -- .../arm64-apple-macos.swiftinterface | 3 -- .../arm64e-apple-macos.swiftinterface | 3 -- .../x86_64-apple-macos.swiftinterface | 3 -- AG/DeviceSwiftShims/Runtime/Metadata.swift | 2 + AG/generate_swiftinterface.sh | 31 +++++++++-- AG/update.sh | 38 +++++++++---- GF/generate_swiftinterface.sh | 30 +++++++++-- GF/update.sh | 54 ++++++++++++------- .../UpdateXCFrameworksCommand.swift | 16 +++++- 12 files changed, 134 insertions(+), 56 deletions(-) diff --git a/.gitignore b/.gitignore index 01f7d2c..006534f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,8 @@ _Headers .DS_Store -AG/*/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface -GF/*/Sources/Modules/Gestures.swiftmodule/template.swiftinterface +AG/*/Sources/Modules/AttributeGraph.swiftmodule/template*.swiftinterface +GF/*/Sources/Modules/Gestures.swiftmodule/template*.swiftinterface # Tuist generated (from Example/) DarwinPrivateFrameworks.xcodeproj diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface index 651c221..a60aef3 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/arm64-apple-ios-simulator.swiftinterface @@ -561,9 +561,6 @@ extension AttributeGraph.Metadata : Swift.Hashable, Swift.CustomStringConvertibl } public func forEachField(options: AttributeGraph.Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool } -extension AttributeGraph.Signature : Swift.Equatable { - public static func == (lhs: AttributeGraph.Signature, rhs: AttributeGraph.Signature) -> Swift.Bool -} extension AttributeGraph.TupleType { @_transparent public init(_ types: [any Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) diff --git a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface index ab589ac..167dc62 100644 --- a/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/ios-arm64-x86_64-simulator/AttributeGraph.framework/Modules/AttributeGraph.swiftmodule/x86_64-apple-ios-simulator.swiftinterface @@ -561,9 +561,6 @@ extension AttributeGraph.Metadata : Swift.Hashable, Swift.CustomStringConvertibl } public func forEachField(options: AttributeGraph.Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool } -extension AttributeGraph.Signature : Swift.Equatable { - public static func == (lhs: AttributeGraph.Signature, rhs: AttributeGraph.Signature) -> Swift.Bool -} extension AttributeGraph.TupleType { @_transparent public init(_ types: [any Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface index 6578eb7..9b658e0 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64-apple-macos.swiftinterface @@ -561,9 +561,6 @@ extension AttributeGraph.Metadata : Swift.Hashable, Swift.CustomStringConvertibl } public func forEachField(options: AttributeGraph.Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool } -extension AttributeGraph.Signature : Swift.Equatable { - public static func == (lhs: AttributeGraph.Signature, rhs: AttributeGraph.Signature) -> Swift.Bool -} extension AttributeGraph.TupleType { @_transparent public init(_ types: [any Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface index 4076be1..4fd1cce 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/arm64e-apple-macos.swiftinterface @@ -561,9 +561,6 @@ extension AttributeGraph.Metadata : Swift.Hashable, Swift.CustomStringConvertibl } public func forEachField(options: AttributeGraph.Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool } -extension AttributeGraph.Signature : Swift.Equatable { - public static func == (lhs: AttributeGraph.Signature, rhs: AttributeGraph.Signature) -> Swift.Bool -} extension AttributeGraph.TupleType { @_transparent public init(_ types: [any Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) diff --git a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface index 9fddf56..51c5e12 100644 --- a/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface +++ b/AG/2021/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/AttributeGraph.framework/Versions/A/Modules/AttributeGraph.swiftmodule/x86_64-apple-macos.swiftinterface @@ -561,9 +561,6 @@ extension AttributeGraph.Metadata : Swift.Hashable, Swift.CustomStringConvertibl } public func forEachField(options: AttributeGraph.Metadata.ApplyOptions, do body: (Swift.UnsafePointer, Swift.Int, any Any.Type) -> Swift.Bool) -> Swift.Bool } -extension AttributeGraph.Signature : Swift.Equatable { - public static func == (lhs: AttributeGraph.Signature, rhs: AttributeGraph.Signature) -> Swift.Bool -} extension AttributeGraph.TupleType { @_transparent public init(_ types: [any Any.Type]) { self.init(count: types.count, elements: types.map(Metadata.init)) diff --git a/AG/DeviceSwiftShims/Runtime/Metadata.swift b/AG/DeviceSwiftShims/Runtime/Metadata.swift index b72e4fd..fe04882 100644 --- a/AG/DeviceSwiftShims/Runtime/Metadata.swift +++ b/AG/DeviceSwiftShims/Runtime/Metadata.swift @@ -59,6 +59,7 @@ extension Metadata: Swift.Hashable, Swift.CustomStringConvertible { } } +#if ATTRIBUTEGRAPH_RELEASE_2024 extension Signature: Swift.Equatable { public static func == (_ lhs: Signature, _ rhs: Signature) -> Bool { return lhs.bytes.0 == rhs.bytes.0 && lhs.bytes.1 == rhs.bytes.1 @@ -73,3 +74,4 @@ extension Signature: Swift.Equatable { && lhs.bytes.18 == rhs.bytes.18 && lhs.bytes.19 == rhs.bytes.19 } } +#endif diff --git a/AG/generate_swiftinterface.sh b/AG/generate_swiftinterface.sh index 2dbc5ec..d916b33 100755 --- a/AG/generate_swiftinterface.sh +++ b/AG/generate_swiftinterface.sh @@ -16,14 +16,23 @@ PACKAGE_DIR="$(dirname "${SCRIPT_DIR}")" VERSION=${DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE:-2024} FRAMEWORK_ROOT="${SCRIPT_DIR}/${VERSION}" SHIMS_DIR="${SCRIPT_DIR}/DeviceSwiftShims" -TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface" +TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/AttributeGraph.swiftmodule/template-${VERSION}.swiftinterface" SWIFTPM_SCRATCH_PATH=$(mktemp -d) +SWIFTPM_CACHE_PATH="${PACKAGE_DIR}/.build" +SWIFTPM_BUILD_LOG="" +SWIFTC_LOG="" TMPDIR_WORK="" cleanup() { if [ -n "${SWIFTPM_SCRATCH_PATH}" ]; then rm -rf "${SWIFTPM_SCRATCH_PATH}" fi + if [ -n "${SWIFTPM_BUILD_LOG}" ]; then + rm -f "${SWIFTPM_BUILD_LOG}" + fi + if [ -n "${SWIFTC_LOG}" ]; then + rm -f "${SWIFTC_LOG}" + fi if [ -n "${TMPDIR_WORK}" ]; then rm -rf "${TMPDIR_WORK}" fi @@ -42,17 +51,25 @@ fi # Build package dependencies via SPM # The command plugin already holds the package build lock. Use a separate # scratch path for this nested build so update-xcframeworks does not deadlock. -swift build --package-path "${PACKAGE_DIR}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --target _AttributeGraphDeviceSwiftShims 2>/dev/null -if [ $? -ne 0 ]; then +SWIFTPM_BUILD_LOG=$(mktemp) +mkdir -p "${SWIFTPM_CACHE_PATH}" +if ! swift build --disable-sandbox --package-path "${PACKAGE_DIR}" --cache-path "${SWIFTPM_CACHE_PATH}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --target _AttributeGraphDeviceSwiftShims 2>"${SWIFTPM_BUILD_LOG}"; then + cat "${SWIFTPM_BUILD_LOG}" >&2 echo "Error: failed to build package dependencies" exit 1 fi # Locate the SPM modules directory for import search paths -BUILD_BIN_PATH=$(swift build --package-path "${PACKAGE_DIR}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --show-bin-path 2>/dev/null) +if ! BUILD_BIN_PATH=$(swift build --disable-sandbox --package-path "${PACKAGE_DIR}" --cache-path "${SWIFTPM_CACHE_PATH}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --show-bin-path 2>"${SWIFTPM_BUILD_LOG}"); then + cat "${SWIFTPM_BUILD_LOG}" >&2 + echo "Error: failed to locate package build directory" + exit 1 +fi MODULES_DIR="${BUILD_BIN_PATH}/Modules" TMPDIR_WORK=$(mktemp -d) +CLANG_MODULE_CACHE="${TMPDIR_WORK}/ModuleCache" +mkdir -p "${CLANG_MODULE_CACHE}" GENERATED="${TMPDIR_WORK}/generated.swiftinterface" @@ -60,6 +77,7 @@ GENERATED="${TMPDIR_WORK}/generated.swiftinterface" MACOS_SDK_VERSION=$(xcrun --sdk macosx --show-sdk-version) # Compile DeviceSwiftShims against the macOS xcframework to emit a swiftinterface +SWIFTC_LOG=$(mktemp) xcrun --sdk macosx swiftc \ -emit-module-interface-path "${GENERATED}" \ -emit-module-path "${TMPDIR_WORK}/module.swiftmodule" \ @@ -67,15 +85,18 @@ xcrun --sdk macosx swiftc \ -enable-library-evolution \ -swift-version 5 \ -Osize \ + -D "ATTRIBUTEGRAPH_RELEASE_${VERSION}" \ -enable-upcoming-feature InternalImportsByDefault \ -enable-experimental-feature Extern \ -target "arm64-apple-macos${MACOS_SDK_VERSION}" \ + -module-cache-path "${CLANG_MODULE_CACHE}" \ -F "${FRAMEWORK_ROOT}/AttributeGraph.xcframework/macos-arm64e-arm64-x86_64/" \ -I "${MODULES_DIR}" \ $(find "${SHIMS_DIR}" -name '*.swift') \ - 2>/dev/null + 2>"${SWIFTC_LOG}" if [ ! -f "${GENERATED}" ]; then + cat "${SWIFTC_LOG}" >&2 echo "Error: failed to generate swiftinterface" exit 1 fi diff --git a/AG/update.sh b/AG/update.sh index 779a74a..59722b6 100755 --- a/AG/update.sh +++ b/AG/update.sh @@ -8,8 +8,9 @@ filepath() { } VERSION=${DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE:-2024} -FRAMEWORK_ROOT="$(dirname $(filepath $0))/$VERSION" -TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/AttributeGraph.swiftmodule/template.swiftinterface" +SCRIPT_DIR="$(dirname "$(filepath "$0")")" +FRAMEWORK_ROOT="${SCRIPT_DIR}/${VERSION}" +TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/AttributeGraph.swiftmodule/template-${VERSION}.swiftinterface" # Version mapping logic if [ "$VERSION" = "2021" ]; then @@ -54,9 +55,6 @@ update_version_in_header() { sed -i '' "s/#define ATTRIBUTEGRAPH_RELEASE [0-9]\{4\}/#define ATTRIBUTEGRAPH_RELEASE ${version}/g" "$file" } -# Regenerate template.swiftinterface from DeviceSwiftShims sources -DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE=${VERSION} "$(dirname "$(filepath "$0")")/generate_swiftinterface.sh" - generate_framework() { local framework_name=$1 local arch_name=$2 @@ -76,6 +74,7 @@ generate_framework() { update_version_in_header "${path}/Headers/AGVersion.h" "${VERSION}" + mkdir -p ${path}/Modules/${framework_name}.swiftmodule cd ${path}/Modules/${framework_name}.swiftmodule } @@ -103,6 +102,7 @@ generate_macos_framework() { ln -sf Versions/Current/Resources Resources ln -sf Versions/Current/${framework_name}.tbd ${framework_name}.tbd + mkdir -p ${path}/Versions/A/Modules/${framework_name}.swiftmodule cd ${path}/Versions/A/Modules/${framework_name}.swiftmodule } @@ -116,26 +116,46 @@ generate_xcframework() { generate_xcframework $framework_name +# Regenerate template.swiftinterface from DeviceSwiftShims sources. This needs a +# bootstrap xcframework because the shims import the binary AttributeGraph target. +generate_framework $framework_name ios-arm64-x86_64-simulator + +generate_framework $framework_name ios-arm64-arm64e +# iPhoneOS platform does not support links Swift API of AttributeGraph +cd ../ +rm -rf ./$framework_name.swiftmodule + +generate_macos_framework $framework_name macos-arm64e-arm64-x86_64 + +if [ -n "$XROS_VERSION" ] && [ -d "${FRAMEWORK_ROOT}/tbds/xros-arm64-x86_64-simulator" ]; then + generate_framework $framework_name xros-arm64-x86_64-simulator +fi + +if ! DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE=${VERSION} "${SCRIPT_DIR}/generate_swiftinterface.sh"; then + echo "Error: failed to regenerate AttributeGraph Swift interface for release ${VERSION}" + exit 1 +fi + generate_framework $framework_name ios-arm64-x86_64-simulator generate_swiftinterface x86_64-apple-ios-simulator x86_64-apple-ios${IOS_VERSION}-simulator generate_swiftinterface arm64-apple-ios-simulator arm64-apple-ios${IOS_VERSION}-simulator -rm -f template.swiftinterface +rm -f template*.swiftinterface generate_framework $framework_name ios-arm64-arm64e # iPhoneOS platform does not support links Swift API of AttributeGraph cd ../ -rm -r ./$framework_name.swiftmodule +rm -rf ./$framework_name.swiftmodule generate_macos_framework $framework_name macos-arm64e-arm64-x86_64 generate_swiftinterface x86_64-apple-macos x86_64-apple-macos${MACOS_VERSION} generate_swiftinterface arm64-apple-macos arm64-apple-macos${MACOS_VERSION} generate_swiftinterface arm64e-apple-macos arm64e-apple-macos${MACOS_VERSION} -rm -f template.swiftinterface +rm -f template*.swiftinterface # Add visionOS support if available if [ -n "$XROS_VERSION" ] && [ -d "${FRAMEWORK_ROOT}/tbds/xros-arm64-x86_64-simulator" ]; then generate_framework $framework_name xros-arm64-x86_64-simulator generate_swiftinterface x86_64-apple-xros-simulator x86_64-apple-xros${XROS_VERSION}-simulator generate_swiftinterface arm64-apple-xros-simulator arm64-apple-xros${XROS_VERSION}-simulator - rm -f template.swiftinterface + rm -f template*.swiftinterface fi diff --git a/GF/generate_swiftinterface.sh b/GF/generate_swiftinterface.sh index 1be53e1..77ead4a 100755 --- a/GF/generate_swiftinterface.sh +++ b/GF/generate_swiftinterface.sh @@ -16,14 +16,23 @@ PACKAGE_DIR="$(dirname "${SCRIPT_DIR}")" VERSION=${DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE:-2025} FRAMEWORK_ROOT="${SCRIPT_DIR}/${VERSION}" SHIMS_DIR="${SCRIPT_DIR}/DeviceSwiftShims" -TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/Gestures.swiftmodule/template.swiftinterface" +TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/Gestures.swiftmodule/template-${VERSION}.swiftinterface" SWIFTPM_SCRATCH_PATH=$(mktemp -d) +SWIFTPM_CACHE_PATH="${PACKAGE_DIR}/.build" +SWIFTPM_BUILD_LOG="" +SWIFTC_LOG="" TMPDIR_WORK="" cleanup() { if [ -n "${SWIFTPM_SCRATCH_PATH}" ]; then rm -rf "${SWIFTPM_SCRATCH_PATH}" fi + if [ -n "${SWIFTPM_BUILD_LOG}" ]; then + rm -f "${SWIFTPM_BUILD_LOG}" + fi + if [ -n "${SWIFTC_LOG}" ]; then + rm -f "${SWIFTC_LOG}" + fi if [ -n "${TMPDIR_WORK}" ]; then rm -rf "${TMPDIR_WORK}" fi @@ -42,17 +51,25 @@ fi # Build package dependencies (OrderedCollections etc.) via SPM # The command plugin already holds the package build lock. Use a separate # scratch path for this nested build so update-xcframeworks does not deadlock. -swift build --package-path "${PACKAGE_DIR}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --target _GesturesDeviceSwiftShims 2>/dev/null -if [ $? -ne 0 ]; then +SWIFTPM_BUILD_LOG=$(mktemp) +mkdir -p "${SWIFTPM_CACHE_PATH}" +if ! swift build --disable-sandbox --package-path "${PACKAGE_DIR}" --cache-path "${SWIFTPM_CACHE_PATH}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --target _GesturesDeviceSwiftShims 2>"${SWIFTPM_BUILD_LOG}"; then + cat "${SWIFTPM_BUILD_LOG}" >&2 echo "Error: failed to build package dependencies" exit 1 fi # Locate the SPM modules directory for import search paths -BUILD_BIN_PATH=$(swift build --package-path "${PACKAGE_DIR}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --show-bin-path 2>/dev/null) +if ! BUILD_BIN_PATH=$(swift build --disable-sandbox --package-path "${PACKAGE_DIR}" --cache-path "${SWIFTPM_CACHE_PATH}" --scratch-path "${SWIFTPM_SCRATCH_PATH}" --show-bin-path 2>"${SWIFTPM_BUILD_LOG}"); then + cat "${SWIFTPM_BUILD_LOG}" >&2 + echo "Error: failed to locate package build directory" + exit 1 +fi MODULES_DIR="${BUILD_BIN_PATH}/Modules" TMPDIR_WORK=$(mktemp -d) +CLANG_MODULE_CACHE="${TMPDIR_WORK}/ModuleCache" +mkdir -p "${CLANG_MODULE_CACHE}" GENERATED="${TMPDIR_WORK}/generated.swiftinterface" @@ -60,6 +77,7 @@ GENERATED="${TMPDIR_WORK}/generated.swiftinterface" MACOS_SDK_VERSION=$(xcrun --sdk macosx --show-sdk-version) # Compile DeviceSwiftShims against the macOS xcframework to emit a swiftinterface +SWIFTC_LOG=$(mktemp) xcrun --sdk macosx swiftc \ -emit-module-interface-path "${GENERATED}" \ -emit-module-path "${TMPDIR_WORK}/module.swiftmodule" \ @@ -71,12 +89,14 @@ xcrun --sdk macosx swiftc \ -enable-upcoming-feature InternalImportsByDefault \ -enable-experimental-feature Extern \ -target "arm64-apple-macos${MACOS_SDK_VERSION}" \ + -module-cache-path "${CLANG_MODULE_CACHE}" \ -F "${FRAMEWORK_ROOT}/Gestures.xcframework/macos-arm64e-arm64-x86_64/" \ -I "${MODULES_DIR}" \ $(find "${SHIMS_DIR}" -name '*.swift') \ - 2>/dev/null + 2>"${SWIFTC_LOG}" if [ ! -f "${GENERATED}" ]; then + cat "${SWIFTC_LOG}" >&2 echo "Error: failed to generate swiftinterface" exit 1 fi diff --git a/GF/update.sh b/GF/update.sh index adcfa41..2ca148a 100755 --- a/GF/update.sh +++ b/GF/update.sh @@ -8,8 +8,9 @@ filepath() { } VERSION=${DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE:-2025} -FRAMEWORK_ROOT="$(dirname $(filepath $0))/$VERSION" -TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/Gestures.swiftmodule/template.swiftinterface" +SCRIPT_DIR="$(dirname "$(filepath "$0")")" +FRAMEWORK_ROOT="${SCRIPT_DIR}/${VERSION}" +TEMPLATE_PATH="${FRAMEWORK_ROOT}/Sources/Modules/Gestures.swiftmodule/template-${VERSION}.swiftinterface" IOS_VERSION="26.0" MACOS_VERSION="26.0" @@ -50,6 +51,8 @@ generate_framework() { cp -rf ${FRAMEWORK_ROOT}/Sources/Headers ${path}/ cp -rf ${FRAMEWORK_ROOT}/Sources/Modules ${path}/ cp -rf ${FRAMEWORK_ROOT}/Sources/Info.plist ${path}/ + + mkdir -p ${path}/Modules/${framework_name}.swiftmodule } generate_xcframework() { @@ -60,22 +63,6 @@ generate_xcframework() { cp ${FRAMEWORK_ROOT}/Info.plist ${path}/ } -# Regenerate template.swiftinterface from DeviceSwiftShims sources -DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE=${VERSION} "$(dirname "$(filepath "$0")")/generate_swiftinterface.sh" - -generate_xcframework $framework_name - -generate_framework $framework_name ios-arm64-arm64e -# iPhoneOS platform does not support linking Swift API of Gestures -cd ${FRAMEWORK_ROOT}/${framework_name}.xcframework/ios-arm64-arm64e/${framework_name}.framework/Modules -rm -r ./$framework_name.swiftmodule - -generate_framework $framework_name ios-arm64-x86_64-simulator -cd ${FRAMEWORK_ROOT}/${framework_name}.xcframework/ios-arm64-x86_64-simulator/${framework_name}.framework/Modules/${framework_name}.swiftmodule -generate_swiftinterface x86_64-apple-ios-simulator x86_64-apple-ios${IOS_VERSION}-simulator -generate_swiftinterface arm64-apple-ios-simulator arm64-apple-ios${IOS_VERSION}-simulator -rm -f template.swiftinterface - generate_macos_framework() { local framework_name=$1 local arch_name=$2 @@ -97,11 +84,40 @@ generate_macos_framework() { ln -sf Versions/Current/Modules Modules ln -sf Versions/Current/Resources Resources ln -sf Versions/Current/${framework_name}.tbd ${framework_name}.tbd + + mkdir -p ${path}/Versions/A/Modules/${framework_name}.swiftmodule } +generate_xcframework $framework_name + +# Regenerate template.swiftinterface from DeviceSwiftShims sources. This needs a +# bootstrap xcframework because the shims import the binary Gestures target. +generate_framework $framework_name ios-arm64-arm64e +cd ${FRAMEWORK_ROOT}/${framework_name}.xcframework/ios-arm64-arm64e/${framework_name}.framework/Modules +rm -rf ./$framework_name.swiftmodule + +generate_framework $framework_name ios-arm64-x86_64-simulator +generate_macos_framework $framework_name macos-arm64e-arm64-x86_64 + +if ! DARWINPRIVATEFRAMEWORKS_TARGET_RELEASE=${VERSION} "${SCRIPT_DIR}/generate_swiftinterface.sh"; then + echo "Error: failed to regenerate Gestures Swift interface for release ${VERSION}" + exit 1 +fi + +generate_framework $framework_name ios-arm64-arm64e +# iPhoneOS platform does not support linking Swift API of Gestures +cd ${FRAMEWORK_ROOT}/${framework_name}.xcframework/ios-arm64-arm64e/${framework_name}.framework/Modules +rm -rf ./$framework_name.swiftmodule + +generate_framework $framework_name ios-arm64-x86_64-simulator +cd ${FRAMEWORK_ROOT}/${framework_name}.xcframework/ios-arm64-x86_64-simulator/${framework_name}.framework/Modules/${framework_name}.swiftmodule +generate_swiftinterface x86_64-apple-ios-simulator x86_64-apple-ios${IOS_VERSION}-simulator +generate_swiftinterface arm64-apple-ios-simulator arm64-apple-ios${IOS_VERSION}-simulator +rm -f template*.swiftinterface + generate_macos_framework $framework_name macos-arm64e-arm64-x86_64 cd ${FRAMEWORK_ROOT}/${framework_name}.xcframework/macos-arm64e-arm64-x86_64/${framework_name}.framework/Modules/${framework_name}.swiftmodule generate_swiftinterface x86_64-apple-macos x86_64-apple-macos${MACOS_VERSION} generate_swiftinterface arm64-apple-macos arm64-apple-macos${MACOS_VERSION} generate_swiftinterface arm64e-apple-macos arm64e-apple-macos${MACOS_VERSION} -rm -f template.swiftinterface +rm -f template*.swiftinterface diff --git a/Plugins/UpdateXCFrameworks/UpdateXCFrameworksCommand.swift b/Plugins/UpdateXCFrameworks/UpdateXCFrameworksCommand.swift index 149a4ac..c852877 100644 --- a/Plugins/UpdateXCFrameworks/UpdateXCFrameworksCommand.swift +++ b/Plugins/UpdateXCFrameworks/UpdateXCFrameworksCommand.swift @@ -5,6 +5,15 @@ import PackagePlugin import Foundation +private struct CommandFailedError: LocalizedError { + var command: String + var status: Int32 + + var errorDescription: String? { + "Command failed with exit code \(status): \(command)" + } +} + @main struct UpdateXCFrameworksCommand: CommandPlugin { func performCommand(context: PackagePlugin.PluginContext, arguments: [String]) async throws { @@ -38,9 +47,14 @@ struct UpdateXCFrameworksCommand: CommandPlugin { private func run(context: PackagePlugin.PluginContext, command: String, environment: [String: String]) throws { let process = Process() process.executableURL = try context.tool(named: "bash").url - process.environment = environment + process.environment = ProcessInfo.processInfo.environment.merging(environment) { _, new in + new + } process.arguments = [command] try process.run() process.waitUntilExit() + guard process.terminationStatus == 0 else { + throw CommandFailedError(command: command, status: process.terminationStatus) + } } }