Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions Sources/OpenRenderBoxShims/Export.swift

This file was deleted.

44 changes: 44 additions & 0 deletions Sources/OpenRenderBoxShims/ORBShims.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// ORBShims.swift
// OpenRenderBoxShims

/// A type that identifies the underlying RenderBox implementation vendor.
///
/// Use ``renderBoxVendor`` to check which vendor is active at runtime.
public struct RenderBoxVendor: RawRepresentable, CaseIterable {
public let rawValue: String

public init(rawValue: String) {
self.rawValue = rawValue
}

/// OpenRenderBox — the open source implementation by OpenSwiftUIProject.
public static let orb = RenderBoxVendor(rawValue: "org.OpenSwiftUIProject.OpenRenderBox")

/// Apple's private RenderBox framework.
public static let rb = RenderBoxVendor(rawValue: "com.apple.RenderBox")

public static var allCases: [RenderBoxVendor] { [.orb, .rb] }
}

#if OPENRENDERBOX_RENDERBOX
@_exported public import RenderBox

public typealias ORBAnimation = RBAnimation
public typealias ORBColor = RBColor
public typealias ORBDevice = RBDevice
public typealias ORBDisplayList = RBDisplayList
public typealias ORBLayer = RBLayer
public typealias ORBLayerDelegate = RBLayerDelegate
public typealias ORBPath = RBPath
public typealias ORBPathApplyCallback = RBPathApplyCallback
public typealias ORBUUID = RBUUID
public typealias ORBSymbolAnimator = RBSymbolAnimator
public typealias ORBSymbolAnimatorObserver = RBSymbolAnimatorObserver

public let renderBoxVendor = RenderBoxVendor.rb
#else
@_exported import OpenRenderBox

public let renderBoxVendor = RenderBoxVendor.orb
#endif
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
//
// Shims.swift
// ORBShims.swift
// OpenRenderBoxShims

#if OPENRENDERBOX_COMPATIBILITY_TEST
@_exported public import RenderBox

public typealias ORBAnimation = RBAnimation
public typealias ORBColor = RBColor
public typealias ORBDevice = RBDevice
public typealias ORBDisplayList = RBDisplayList
public typealias ORBLayer = RBLayer
public typealias ORBLayerDelegate = RBLayerDelegate
public typealias ORBPath = RBPath
public typealias ORBPathApplyCallback = RBPathApplyCallback
public typealias ORBUUID = RBUUID
public typealias ORBAnimation = RBAnimation
public typealias ORBSymbolAnimator = RBSymbolAnimator
public typealias ORBSymbolAnimatorObserver = RBSymbolAnimatorObserver

public let compatibilityTestEnabled = true
#else
@_exported import OpenRenderBox
@_exported import OpenRenderBoxCxx

public let compatibilityTestEnabled = false
#endif