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
2 changes: 1 addition & 1 deletion Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

301 changes: 300 additions & 1 deletion Sources/OpenRenderBox/Render/ORBDisplayList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,306 @@
//

#if !canImport(ObjectiveC)
public final class ORBDisplayList {
public import Foundation
public import OpenCoreGraphicsShims

public final class ORBDisplayList: NSObject, ORBDisplayListContents {
// MARK: - Properties

public var linearColors: Bool = false
public var profile: UInt32 = 0
public var contentRect: CGRect = .zero
public var deviceScale: Double = 0
public var defaultColorSpace: ORBColor.ColorSpace = .default

public private(set) var clipBoundingBox: CGRect = .zero

public var CTM: CGAffineTransform {
get { _openRenderBoxUnimplementedFailure() }
set { _openRenderBoxUnimplementedFailure() }
}

public private(set) var identifier: UInt32 = 0
public private(set) var identifierNamespace: UUID?

public var empty: Bool { isEmpty() }

public var boundingRect: CGRect {
_openRenderBoxUnimplementedFailure()
}

public var xmlDescription: String {
_openRenderBoxUnimplementedFailure()
}

// MARK: - Init

public override init() {
super.init()
}

// MARK: - ORBDisplayListContents

public func isEmpty() -> Bool {
_openRenderBoxUnimplementedFailure()
}

public func render(in context: CGContext, options: Any?) {
_openRenderBoxUnimplementedFailure()
}

// MARK: - Cache & State

public func clearCaches() {
_openRenderBoxUnimplementedFailure()
}

public func clear() {
_openRenderBoxUnimplementedFailure()
}

public func value(forAttribute attribute: UInt32) -> Any? {
_openRenderBoxUnimplementedFailure()
}

public func save() {
_openRenderBoxUnimplementedFailure()
}

public func restore() {
_openRenderBoxUnimplementedFailure()
}

public func setValue(_ value: Any?, forAttribute attribute: UInt32) {
_openRenderBoxUnimplementedFailure()
}

// MARK: - Transform

public func concat(_ transform: CGAffineTransform) {
_openRenderBoxUnimplementedFailure()
}

public func translateBy(x: Double, y: Double) {
_openRenderBoxUnimplementedFailure()
}

public func scaleBy(x: Double, y: Double) {
_openRenderBoxUnimplementedFailure()
}

public func rotate(by angle: Double) {
_openRenderBoxUnimplementedFailure()
}

// MARK: - CG Context

public func beginCGContext(withAlpha alpha: Float) -> CGContext {
_openRenderBoxUnimplementedFailure()
}

public func beginCGContext(withAlpha alpha: Float, flags: UInt32) -> CGContext {
_openRenderBoxUnimplementedFailure()
}

public func endCGContext() {
_openRenderBoxUnimplementedFailure()
}

// MARK: - Layer

public func beginLayer() {
_openRenderBoxUnimplementedFailure()
}

public func beginLayer(withFlags flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func drawLayer(withAlpha alpha: Float, blendMode mode: Int32) {
_openRenderBoxUnimplementedFailure()
}

public func clipLayer(withAlpha alpha: Float, mode: Int32) {
_openRenderBoxUnimplementedFailure()
}

// MARK: - Clip & Draw

public func clipShape(_ shape: Any, mode: Int32) {
_openRenderBoxUnimplementedFailure()
}

public func clipShape(_ shape: Any, alpha: Float, mode: Int32) {
_openRenderBoxUnimplementedFailure()
}

public func drawShape(_ shape: Any, fill: Any, alpha: Float, blendMode mode: Int32) {
_openRenderBoxUnimplementedFailure()
}

public func drawDisplayList(_ list: any ORBDisplayListContents) {
_openRenderBoxUnimplementedFailure()
}

public func drawDisplayList(_ list: any ORBDisplayListContents, alpha: Float) {
_openRenderBoxUnimplementedFailure()
}

// MARK: - Contents

public func moveContents() -> (any ORBDisplayListContents)? {
_openRenderBoxUnimplementedFailure()
}

public func setIdentifier(_ identifier: UInt32, namespace ns: UUID?) {
_openRenderBoxUnimplementedFailure()
}

public func beginRecordingXML() {
_openRenderBoxUnimplementedFailure()
}

// MARK: - Styles

public func addAffineTransformStyle(_ style: CGAffineTransform) {
_openRenderBoxUnimplementedFailure()
}

public func addTranslationStyle(withOffset offset: CGSize) {
_openRenderBoxUnimplementedFailure()
}

public func addScaleStyle(withScale scale: CGSize, anchor: CGPoint) {
_openRenderBoxUnimplementedFailure()
}

public func addRotationStyle(withAngle angle: Double, anchor: CGPoint) {
_openRenderBoxUnimplementedFailure()
}

public func addTransformStyle(_ style: Any) {
_openRenderBoxUnimplementedFailure()
}

public func addPredicateStyle(_ style: Any) {
_openRenderBoxUnimplementedFailure()
}

// MARK: - Filters

public func addBlurFilter(withRadius radius: Double) {
_openRenderBoxUnimplementedFailure()
}

public func addBlurFilter(withRadius radius: Double, opaque: Bool) {
_openRenderBoxUnimplementedFailure()
}

public func addBlurFilter(withRadius radius: Double, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addBlurFilter(withRadius radius: Double, bounds: CGRect, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addBrightnessFilter(withAmount amount: Float) {
_openRenderBoxUnimplementedFailure()
}

public func addBrightnessFilter(withAmount amount: Float, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addContrastFilter(withAmount amount: Float) {
_openRenderBoxUnimplementedFailure()
}

public func addContrastFilter(withAmount amount: Float, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addGrayscaleFilter(withAmount amount: Float) {
_openRenderBoxUnimplementedFailure()
}

public func addGrayscaleFilter(withAmount amount: Float, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addHueRotationFilter(withAngle angle: Double) {
_openRenderBoxUnimplementedFailure()
}

public func addHueRotationFilter(withAngle angle: Double, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addSaturationFilter(withAmount amount: Float) {
_openRenderBoxUnimplementedFailure()
}

public func addSaturationFilter(withAmount amount: Float, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addColorInvertFilter() {
_openRenderBoxUnimplementedFailure()
}

public func addColorInvertFilter(withAmount amount: Float, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addColorMultiplyFilter(withColor color: ORBColor) {
_openRenderBoxUnimplementedFailure()
}

public func addColorMultiplyFilter(withColor color: ORBColor, colorSpace space: ORBColor.ColorSpace, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addColorMonochromeFilter(withAmount amount: Float, color: ORBColor, bias: Float) {
_openRenderBoxUnimplementedFailure()
}

public func addColorMonochromeFilter(withAmount amount: Float, color: ORBColor, colorSpace space: ORBColor.ColorSpace, bias: Float, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addAlphaMultiplyFilter(withColor color: ORBColor) {
_openRenderBoxUnimplementedFailure()
}

public func addAlphaMultiplyFilter(withColor color: ORBColor, colorSpace space: ORBColor.ColorSpace, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addLuminanceToAlphaFilter() {
_openRenderBoxUnimplementedFailure()
}

public func addLuminanceToAlphaFilter(withFlags flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addDistanceFilter(withMaxDistance distance: Double, scale: Double, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

// MARK: - Shadow

public func addShadowStyle(withRadius radius: Double, offset: CGSize, color: ORBColor, mode: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addShadowStyle(withRadius radius: Double, offset: CGSize, color: ORBColor, colorSpace space: ORBColor.ColorSpace, blendMode mode: Int32, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}

public func addShadowStyle(withRadius radius: Double, midpoint: Float, offset: CGSize, color: ORBColor, colorSpace space: ORBColor.ColorSpace, blendMode mode: Int32, flags: UInt32) {
_openRenderBoxUnimplementedFailure()
}
}
#endif
17 changes: 17 additions & 0 deletions Sources/OpenRenderBox/Render/ORBDisplayListContents.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// ORBDisplayListContents.swift
// OpenRenderBox
//

#if !canImport(ObjectiveC)
public import Foundation
public import OpenCoreGraphicsShims

public protocol ORBDisplayListContents: AnyObject {
var empty: Bool { get }
var boundingRect: CGRect { get }
var xmlDescription: String { get }
func isEmpty() -> Bool
func render(in context: CGContext, options: Any?)
}
#endif
57 changes: 57 additions & 0 deletions Sources/OpenRenderBox/Render/ORBDisplayListInterpolator.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// ORBDisplayListInterpolator.swift
// OpenRenderBox
//

#if !canImport(ObjectiveC)
public import Foundation
public import OpenCoreGraphicsShims

public class ORBDisplayListInterpolator: NSObject {
// MARK: - Properties

public var from: any ORBDisplayListContents {
get { _openRenderBoxUnimplementedFailure() }
set { _openRenderBoxUnimplementedFailure() }
}

public private(set) var to: any ORBDisplayListContents {
get { _openRenderBoxUnimplementedFailure() }
set { }
}

public private(set) var options: [AnyHashable: Any]? = nil
public private(set) var isIdentity: Bool = false
public private(set) var onlyFades: Bool = false
public private(set) var activeDuration: Double = 0

// MARK: - Init

public convenience init(from: any ORBDisplayListContents, to: any ORBDisplayListContents, options: [AnyHashable: Any]?) {
self.init()
_openRenderBoxUnimplementedFailure()
}

public static func interpolator(withFrom from: any ORBDisplayListContents, to: any ORBDisplayListContents, options: [AnyHashable: Any]?) -> ORBDisplayListInterpolator {
_openRenderBoxUnimplementedFailure()
}

// MARK: - Methods

public func boundingRect(withProgress progress: Float) -> CGRect {
_openRenderBoxUnimplementedFailure()
}

public func contents(withProgress progress: Float) -> (any ORBDisplayListContents)? {
_openRenderBoxUnimplementedFailure()
}

public func copyContents(withProgress progress: Float) -> (any ORBDisplayListContents)? {
_openRenderBoxUnimplementedFailure()
}

public func maxAbsoluteVelocity(withProgress progress: Float) -> Double {
_openRenderBoxUnimplementedFailure()
}
}
#endif
Loading