diff --git a/.gitignore b/.gitignore index 7338d71..0da2833 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ .DS_Store /.build +/Derived +/OpenRenderBox.xcodeproj +/OpenRenderBox.xcworkspace +/Workspace.xcworkspace /Packages xcuserdata/ DerivedData/ @@ -9,4 +13,4 @@ DerivedData/ .claude/ .rb_template/ .augment/ -/.build-debug \ No newline at end of file +/.build-debug diff --git a/Package.swift b/Package.swift index 77f6874..6387a61 100644 --- a/Package.swift +++ b/Package.swift @@ -226,8 +226,9 @@ let openRenderBoxTarget = Target.target( // The SwiftPM support for such usage is still in progress. let openRenderBoxCxxTarget = Target.target( name: "OpenRenderBoxCxx", - cSettings: sharedCSettings, - cxxSettings: sharedCxxSettings + publicHeadersPath: "include", + cSettings: sharedCSettings + [.headerSearchPath(".")], + cxxSettings: sharedCxxSettings + [.headerSearchPath(".")] ) let openRenderBoxShimsTarget = Target.target( name: "OpenRenderBoxShims", diff --git a/Project.swift b/Project.swift new file mode 100644 index 0000000..1a3dde0 --- /dev/null +++ b/Project.swift @@ -0,0 +1,130 @@ +import Foundation +import ProjectDescription + +let sourceRoot = "Sources/OpenRenderBoxCxx" +let root = URL(fileURLWithPath: #filePath).deletingLastPathComponent() +let sourceModuleMap = try String( + contentsOf: root.appendingPathComponent("\(sourceRoot)/include/module.modulemap"), + encoding: .utf8 +) +let moduleHeaders = sourceModuleMap.components(separatedBy: .newlines).compactMap { line -> String? in + guard line.contains("header \"") else { return nil } + return line.components(separatedBy: "\"")[1] +} + +// Use the same module declarations for SwiftPM and the framework. +let frameworkModuleMap = "framework " + sourceModuleMap + .replacingOccurrences(of: "module OpenRenderBoxCxx", with: "module OpenRenderBox") + .replacingOccurrences(of: "module OpenRenderBox.C {", with: "module OpenRenderBox.C {\n header \"ORBConfiguration.h\"") + .replacingOccurrences(of: "header \"OpenRenderBox/", with: "header \"") + .replacingOccurrences(of: "header \"../", with: "header \"") +let moduleMapDirectory = root.appendingPathComponent("Derived/ModuleMaps") +try FileManager.default.createDirectory(at: moduleMapDirectory, withIntermediateDirectories: true) +try frameworkModuleMap.write( + to: moduleMapDirectory.appendingPathComponent("OpenRenderBox.modulemap"), + atomically: true, + encoding: .utf8 +) + +// Consumers must use the same backend as the framework binary. +let frameworkConfiguration = """ +#pragma once + +#if defined(OPENRENDERBOX_CF_CGTYPES) && OPENRENDERBOX_CF_CGTYPES != 1 +#error "This OpenRenderBox framework requires OPENRENDERBOX_CF_CGTYPES=1." +#endif +#ifndef OPENRENDERBOX_CF_CGTYPES +#define OPENRENDERBOX_CF_CGTYPES 1 +#endif + +""" + +// Preserve feature paths for the C++ and Objective-C submodules. +let internalHeaders = moduleHeaders.filter { $0.hasPrefix("../") }.map { String($0.dropFirst(3)) } +// Tuist otherwise treats template headers as resources and adds a resource bundle. +let templateHeaders = internalHeaders.filter { $0.hasSuffix(".tpp") } +let headerCopyCommands = internalHeaders.map { header in + let directory = (header as NSString).deletingLastPathComponent + return """ + mkdir -p "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\(directory)" + cp "${SRCROOT}/\(sourceRoot)/\(header)" "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/\(header)" + """ +}.joined(separator: "\n") +let exportModuleHeaders = TargetScript.pre( + script: """ + set -eu + mkdir -p "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}" + cat > "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}/ORBConfiguration.h" <<'EOF' + \(frameworkConfiguration) + EOF + \(headerCopyCommands) + """, + name: "Export module headers", + inputPaths: internalHeaders.map { .glob(.path("\(sourceRoot)/\($0)")) }, + outputPaths: [.path("$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/ORBConfiguration.h")] + + internalHeaders.map { .path("$(TARGET_BUILD_DIR)/$(PUBLIC_HEADERS_FOLDER_PATH)/\($0)") }, + basedOnDependencyAnalysis: true +) + +let destinations: Destinations = [.mac, .iPhone, .iPad, .macCatalyst, .appleTv, .appleWatch, .appleVision] +let deploymentTargets = DeploymentTargets.multiplatform( + iOS: "18.0", macOS: "15.0", watchOS: "10.0", tvOS: "18.0", visionOS: "2.0" +) + +let project = Project( + name: "OpenRenderBox", + settings: .settings(base: [ + "CLANG_CXX_LANGUAGE_STANDARD": "c++20", + "GCC_PREPROCESSOR_DEFINITIONS": ["$(inherited)", "OPENRENDERBOX_CF_CGTYPES"], + "SWIFT_ACTIVE_COMPILATION_CONDITIONS": ["$(inherited)", "OPENRENDERBOX_CF_CGTYPES"], + "SWIFT_VERSION": "5.0", + ]), + targets: [ + .target( + name: "OpenRenderBoxCxx", + destinations: destinations, + product: .staticLibrary, + bundleId: "org.openswiftui.OpenRenderBoxCxx", + deploymentTargets: deploymentTargets, + infoPlist: nil, + buildableFolders: [ + .folder(.path(sourceRoot), exceptions: [.exception(excluded: ["include/module.modulemap"] + templateHeaders)]) + ], + settings: .settings(base: [ + "HEADER_SEARCH_PATHS": ["$(SRCROOT)/\(sourceRoot)", "$(SRCROOT)/\(sourceRoot)/include"], + // Match SwiftPM while path operations still have incomplete implementations. + "GCC_WARN_ABOUT_RETURN_TYPE": "YES", + "SKIP_INSTALL": "YES", + ]) + ), + .target( + name: "OpenRenderBox", + destinations: destinations, + product: .framework, + bundleId: "org.openswiftui.OpenRenderBox", + deploymentTargets: deploymentTargets, + buildableFolders: ["Sources/OpenRenderBox"], + headers: .headers(public: .list([.glob(.path("\(sourceRoot)/include/OpenRenderBox/*.h"))])), + scripts: [exportModuleHeaders], + dependencies: [ + .target(name: "OpenRenderBoxCxx"), + .sdk(name: "Foundation", type: .framework), + .sdk(name: "CoreGraphics", type: .framework), + .sdk(name: "QuartzCore", type: .framework), + .sdk(name: "Metal", type: .framework), + .sdk(name: "c++", type: .library), + ], + settings: .settings(base: [ + "BUILD_LIBRARY_FOR_DISTRIBUTION": "YES", + // Keep Xcode responsible for installing the framework module map. + "MODULEMAP_FILE[sdk=*]": "$(SRCROOT)/Derived/ModuleMaps/OpenRenderBox.modulemap", + // The Swift target does not reference every exported C or Objective-C symbol. + "OTHER_LDFLAGS": ["$(inherited)", "-force_load", "$(BUILT_PRODUCTS_DIR)/libOpenRenderBoxCxx.a"], + "OTHER_SWIFT_FLAGS": ["$(inherited)", "-package-name", "OpenRenderBox", "-enable-upcoming-feature", "InternalImportsByDefault"], + "SKIP_INSTALL": "NO", + // ORBVersion.c defines the framework version symbols. + "VERSIONING_SYSTEM": "", + ]) + ), + ] +) diff --git a/README.md b/README.md index 69f21a9..4fd797c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,65 @@ Currently, this project is in early development. The current suggested toolchain to build the project is Swift 6.3.3 / Xcode 26.6. +Tuist builds `OpenRenderBoxCxx` as a static library and links it into the dynamic +`OpenRenderBox.framework`. This build uses the Darwin SDK's CoreGraphics types. +Use SwiftPM for the other backend configurations. + +```sh +tuist generate run --no-open --cache-profile none +tuist xcodebuild build -workspace OpenRenderBox.xcworkspace -scheme OpenRenderBox \ + -configuration Release -destination 'generic/platform=macOS' \ + -derivedDataPath .build/tuist-framework CODE_SIGNING_ALLOWED=NO +Scripts/Tests/framework-test .build/tuist-framework/Build/Products/Release/OpenRenderBox.framework +``` + +The framework contains the public C headers and the C++, Objective-C, and Swift +modules. The client test uses a separate copy of the bundle with no source search +paths and compiles the Swift interface. +The framework exports `ORBConfiguration.h` with its fixed CoreGraphics backend +setting. Consumers can use its path APIs without extra compiler definitions. +SwiftPM continues to select the backend with `OPENRENDERBOX_CF_CGTYPES`. + +## Source Layout + +`Sources/OpenRenderBoxCxx` groups headers and implementations by feature. +`include/OpenRenderBox` contains relative symbolic links to the public C and +Objective-C headers, so each declaration has one source file. Clients keep paths such as +``. Headers that share C and Objective-C declarations +use `ORB_OBJC_FOUNDATION` to guard the Objective-C declarations. + +The target uses `publicHeadersPath: "include"`. The module map lists the exported +headers and preserves the Swift submodule names and language requirements. +Swift sources remain in the separate `OpenRenderBox` target. + +Framework builds and template exports copy the linked header contents. The +framework client test checks that exported headers are regular files. + +### Add an exported header + +Create the header beside its implementation, then register it with Python 3.9 or +later. Pass a path relative to the repository root, or an absolute path, and an +existing submodule name: + +```sh +Scripts/add_header.py Sources/OpenRenderBoxCxx/Animation/ORBNewAnimation.h C +Scripts/add_header.py Sources/OpenRenderBoxCxx/Animation/ORBNewObserver.h ObjC +Scripts/add_header.py Sources/OpenRenderBoxCxx/Animation/NewAnimation.hpp Animation +``` + +The script creates a relative public-header link for C and Objective-C modules +and adds the header to `include/module.modulemap`. Modules with `requires cplusplus` +keep feature paths and do not use flat links. Files with a `.tpp` extension use +`textual header`. Repeated calls do not add duplicates. The script rejects name +conflicts and headers already registered in another module. + +If a C header must also be available through ``, +add its include to that header. Internal headers do not need registration. +Regenerate the Tuist project after registration, then build the framework with +the commands above. SwiftPM reads the updated source module map directly. + +Run the helper tests with `Scripts/Tests/add-header-test`. + ## Shims The `OpenRenderBoxShims` product provides Swift aliases and a C header for path APIs. diff --git a/Scripts/Tests/add-header-test b/Scripts/Tests/add-header-test new file mode 100755 index 0000000..68619c5 --- /dev/null +++ b/Scripts/Tests/add-header-test @@ -0,0 +1,185 @@ +#!/usr/bin/env python3 + +import os +from pathlib import Path +import shutil +import subprocess +import sys +import tempfile +import unittest + + +SCRIPT = Path(__file__).resolve().parents[1] / "add_header.py" +MODULE_MAP = """module OpenRenderBoxCxx { + export * +} + +module OpenRenderBoxCxx.C { + export * +} + +module OpenRenderBoxCxx.ObjC { + requires objc + export * +} + +module OpenRenderBoxCxx.Animation { + requires cplusplus + export * +} +""" + + +class AddHeaderTests(unittest.TestCase): + def setUp(self): + temporary = tempfile.TemporaryDirectory(prefix="orb-header-test-") + self.addCleanup(temporary.cleanup) + self.root = Path(temporary.name).resolve() / "repo with spaces" + self.script = self.root / "Scripts/add_header.py" + self.script.parent.mkdir(parents=True) + shutil.copy2(SCRIPT, self.script) + self.source = self.root / "Sources/OpenRenderBoxCxx" + self.public = self.source / "include/OpenRenderBox" + self.public.mkdir(parents=True) + self.module_map = self.source / "include/module.modulemap" + self.module_map.write_text(MODULE_MAP, encoding="utf-8") + + def make_header(self, name): + header = self.source / name + header.parent.mkdir(parents=True, exist_ok=True) + header.write_text("#pragma once\n", encoding="utf-8") + return header + + def run_script(self, header, module, success=True): + result = subprocess.run( + [sys.executable, str(self.script), str(header), module], + cwd=self.root.parent, + capture_output=True, + text=True, + ) + if success: + self.assertEqual(result.returncode, 0, result.stderr) + else: + self.assertNotEqual(result.returncode, 0, result.stdout) + return result + + def test_public_header_and_repeat(self): + header = self.make_header("Animation/ORBNewAnimation.h") + self.run_script(header.relative_to(self.root), "C") + link = self.public / header.name + self.assertTrue(link.is_symlink()) + self.assertFalse(os.path.isabs(os.readlink(link))) + self.assertEqual(link.resolve(), header) + expected = MODULE_MAP.replace( + "module OpenRenderBoxCxx.C {\n", + 'module OpenRenderBoxCxx.C {\n header "OpenRenderBox/ORBNewAnimation.h"\n', + ) + self.assertEqual(self.module_map.read_text(), expected) + modification_time = self.module_map.stat().st_mtime_ns + self.run_script(header, "OpenRenderBoxCxx.C") + self.assertEqual(self.module_map.read_text(), expected) + self.assertEqual(self.module_map.stat().st_mtime_ns, modification_time) + + def test_objc_header(self): + header = self.make_header("Animation/ORBNewObserver.h") + self.run_script(header, "ObjC") + self.assertEqual((self.public / header.name).resolve(), header) + self.assertIn( + ' requires objc\n header "OpenRenderBox/ORBNewObserver.h"\n', + self.module_map.read_text(), + ) + + def test_cxx_and_textual_headers(self): + for name in ["Animation/NewAnimation.hpp", "Animation/NewAnimation.tpp"]: + header = self.make_header(name) + self.run_script(header, "Animation") + self.run_script(header, "Animation") + self.assertEqual(list(self.public.iterdir()), []) + self.assertIn( + ' requires cplusplus\n' + ' header "../Animation/NewAnimation.hpp"\n' + ' textual header "../Animation/NewAnimation.tpp"\n', + self.module_map.read_text(), + ) + + def test_missing_link_is_repaired(self): + header = self.make_header("Color/ORBNewColor.h") + self.run_script(header, "C") + contents = self.module_map.read_bytes() + link = self.public / header.name + link.unlink() + self.run_script(header, "C") + self.assertEqual(link.resolve(), header) + self.assertEqual(self.module_map.read_bytes(), contents) + + def test_existing_link_is_registered(self): + header = self.make_header("Color/ORBNewColor.h") + link = self.public / header.name + link.symlink_to(os.path.relpath(header, self.public)) + self.run_script(header, "C") + self.assertEqual(link.resolve(), header) + self.assertIn('header "OpenRenderBox/ORBNewColor.h"', self.module_map.read_text()) + + def test_conflicting_public_path_is_preserved(self): + header = self.make_header("Color/ORBNewColor.h") + other = self.make_header("Animation/ORBNewColor.h") + link = self.public / header.name + for target in [other, self.source / "Missing.h", None]: + with self.subTest(target=target): + if target is None: + link.write_text("User content\n") + else: + link.symlink_to(os.path.relpath(target, self.public)) + result = self.run_script(header, "C", success=False) + self.assertIn("already exists", result.stderr) + self.assertEqual(self.module_map.read_text(), MODULE_MAP) + if target is None: + self.assertEqual(link.read_text(), "User content\n") + else: + self.assertEqual(os.readlink(link), os.path.relpath(target, self.public)) + link.unlink() + + def test_other_module_is_not_changed(self): + header = self.make_header("Animation/ORBNewAnimation.h") + self.run_script(header, "C") + contents = self.module_map.read_bytes() + result = self.run_script(header, "ObjC", success=False) + self.assertIn("already registered", result.stderr) + self.assertEqual(self.module_map.read_bytes(), contents) + + def test_unknown_module_does_not_create_link(self): + header = self.make_header("Color/ORBNewColor.h") + result = self.run_script(header, "Missing", success=False) + self.assertIn("Unknown module", result.stderr) + self.assertEqual(self.module_map.read_text(), MODULE_MAP) + self.assertEqual(list(self.public.iterdir()), []) + + def test_invalid_headers_do_not_change_exports(self): + outside = self.root / "Outside.h" + outside.write_text("#pragma once\n") + escaped = self.source / "Escape.h" + escaped.symlink_to(outside) + headers = [ + self.source / "Missing.h", + self.make_header("Animation/Implementation.cpp"), + self.make_header("Animation/CPPOnly.hpp"), + self.make_header('Animation/Bad"Name.h'), + self.make_header("Animation/Bad$Name.h"), + self.make_header("include/RealHeader.h"), + outside, + escaped, + ] + for header in headers: + with self.subTest(header=header): + self.run_script(header, "C", success=False) + self.assertEqual(self.module_map.read_text(), MODULE_MAP) + self.assertEqual(list(self.public.iterdir()), []) + + def test_header_path_with_spaces(self): + header = self.make_header("New Feature/ORBNewHeader.h") + self.run_script(header, "C") + self.assertEqual((self.public / header.name).resolve(), header) + + +if __name__ == "__main__": + unittest.main() diff --git a/Scripts/Tests/framework-test b/Scripts/Tests/framework-test new file mode 100755 index 0000000..8fce3db --- /dev/null +++ b/Scripts/Tests/framework-test @@ -0,0 +1,124 @@ +#!/bin/bash +set -euo pipefail + +framework="${1:?Usage: framework-test /path/to/OpenRenderBox.framework}" +test_root=$(mktemp -d) +trap 'rm -rf "$test_root"' EXIT +ditto "$framework" "$test_root/OpenRenderBox.framework" +cd "$test_root" + +case "$(xcrun otool -L OpenRenderBox.framework/OpenRenderBox)" in + *OpenRenderBoxCxx*) + echo "OpenRenderBox must not depend on a dynamic OpenRenderBoxCxx library." >&2 + exit 1 + ;; +esac + +if [[ -n "$(find -L OpenRenderBox.framework/Resources -type f -name '*.tpp' -print -quit)" ]]; then + echo "Template headers must be exported under Headers, not bundled as resources." >&2 + exit 1 +fi + +# Use only the bundle, including its Swift interface, to detect source-path dependencies. +for module in OpenRenderBox.framework/Modules/OpenRenderBox.swiftmodule/*.swiftmodule; do + test ! -f "$module" || rm "$module" +done +for header in OpenRenderBox.framework/Headers/*.h; do + if [[ -L "$header" || ! -f "$header" ]]; then + echo "Framework headers must be regular files: $header" >&2 + exit 1 + fi + printf '#include \n' "${header##*/}" +done > public-headers.h + +cat > client.c <<'EOF' +#include "public-headers.h" +#include + +int main(void) { + ORBColor color = ORBColorMake(1, 0, 0, 1); + assert(color.red == 1 && color.alpha == 1); + assert(ORBPathIsEmpty(ORBPathEmpty)); + assert(ORBPathIsNull(ORBPathNull)); + bool (*storageIsEmpty)(ORBPathStorageRef) = ORBPathStorageIsEmpty; + assert(storageIsEmpty != NULL); + return 0; +} +EOF + +cat > client.cpp <<'EOF' +#include "public-headers.h" +#include +#include + +int main() { + ORB::Animation animation; + assert(animation.empty()); + animation.add_spring(1, 1, 1, 1, 0); + assert(!animation.empty()); + assert(ORBPathIsEmpty(ORBPathEmpty)); +} +EOF + +cat > client.m <<'EOF' +#include +#include +#include +#include +#include + +int main(void) { + ORBAnimation *animation = [ORBAnimation new]; + [animation removeAll]; + assert(animation.activeDuration == 0); + ORBSymbolAnimationOptionKey key = ORBSymbolAnimationSpeed; + assert([key isEqualToString:@"speed"]); + ORBSymbolAnimator *animator = [ORBSymbolAnimator new]; + assert(animator != nil); + ORBTransition *transition = [ORBTransition new]; + assert(transition != nil); + assert(ORBPathIsEmpty(ORBPathEmpty)); + return 0; +} +EOF + +cat > client.swift <<'EOF' +import OpenRenderBox + +precondition(ORBColor.black.alpha == 1) +precondition(ORBPath.empty.isEmpty) +precondition(ORBPath.null.isNull) +let animation = ORBAnimation() +animation.removeAll() +precondition(animation.activeDuration == 0) +precondition(ORBSymbolAnimation.OptionKey.speed.rawValue == "speed") +EOF + +target="$(uname -m)-apple-macos15.0" +common=(-target "$target" -F "$test_root" -framework OpenRenderBox -Wl,-rpath,"$test_root") +# Each guarded header must expose its API without another header setting the backend first. +for declaration in CFCGTypes.h:CGFloat ORBPath.h:ORBPath ORBPathCallbacks.h:ORBPathCallbacks ORBPathStorage.h:ORBPathStorageRef; do + printf '#include \n%s value;\n' "${declaration%:*}" "${declaration#*:}" > path-header.c + xcrun clang -target "$target" -F "$test_root" -fsyntax-only path-header.c +done +for declaration in Path/Storage.hpp:ORB::Path::Storage Path/NestedCallbacks.hpp:ORB::Path::NestedCallbacks; do + printf '#include \nstatic_assert(sizeof(%s) > 0);\n' "${declaration%%:*}" "${declaration#*:}" > path-header.cpp + xcrun clang++ -target "$target" -F "$test_root" -std=c++20 -fsyntax-only path-header.cpp +done +if xcrun clang -target "$target" -F "$test_root" -DOPENRENDERBOX_CF_CGTYPES=0 \ + -fsyntax-only path-header.c > backend-conflict.log 2>&1; then + echo "The framework must reject a conflicting backend setting." >&2 + exit 1 +fi +grep -Fq 'requires OPENRENDERBOX_CF_CGTYPES=1' backend-conflict.log +xcrun clang "${common[@]}" client.c -o client-c +./client-c +xcrun clang++ "${common[@]}" -std=c++20 client.cpp -o client-cxx +./client-cxx +xcrun clang "${common[@]}" -fmodules -fmodules-cache-path=clang-modules -fobjc-arc -framework Foundation client.m -o client-objc +./client-objc +xcrun swiftc -target "$target" -F "$test_root" -framework OpenRenderBox \ + -module-cache-path swift-modules -Xlinker -rpath -Xlinker "$test_root" client.swift -o client-swift +./client-swift + +echo "Framework clients passed: C, C++, Objective-C, and Swift." diff --git a/Scripts/add_header.py b/Scripts/add_header.py new file mode 100755 index 0000000..937a47d --- /dev/null +++ b/Scripts/add_header.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python3 +"""Register a header in an existing OpenRenderBoxCxx submodule.""" + +import argparse +import os +from pathlib import Path +import re +import stat +import tempfile + + +MODULE = re.compile( + r"^module (?POpenRenderBoxCxx(?:\.[A-Za-z_][A-Za-z0-9_]*)+) \{\n" + r"(?P[^{}]*)^\}", + re.MULTILINE, +) +HEADER = re.compile(r'^\s*(?:textual )?header "(?P[^"\n]+)"', re.MULTILINE) + + +def write_module_map(path, contents): + temporary = None + try: + with tempfile.NamedTemporaryFile( + mode="w", encoding="utf-8", dir=path.parent, prefix=".modulemap-", delete=False + ) as output: + temporary = Path(output.name) + output.write(contents) + temporary.chmod(stat.S_IMODE(path.stat().st_mode)) + temporary.replace(path) + finally: + if temporary is not None: + temporary.unlink(missing_ok=True) + + +def add_header(root, header_path, module_name): + source = root / "Sources/OpenRenderBoxCxx" + include = source / "include" + public = include / "OpenRenderBox" + module_map = include / "module.modulemap" + header = (root / header_path).resolve(strict=True) + if not header.is_file() or not header.is_relative_to(source) or header.is_relative_to(include): + raise ValueError("Use a source header under Sources/OpenRenderBoxCxx, outside include/.") + relative = header.relative_to(source).as_posix() + # These paths also become quoted shell arguments in the Tuist header copy script. + if not re.fullmatch(r"[A-Za-z0-9_./ -]+", relative): + raise ValueError("Header paths can contain only letters, digits, spaces, _, -, ., and /.") + + contents = module_map.read_text(encoding="utf-8") + modules = {match["name"]: match for match in MODULE.finditer(contents)} + name = module_name if module_name.startswith("OpenRenderBoxCxx.") else f"OpenRenderBoxCxx.{module_name}" + if name not in modules: + available = ", ".join(key.removeprefix("OpenRenderBoxCxx.") for key in modules) + raise ValueError(f"Unknown module {module_name}. Use one of: {available}.") + module = modules[name] + cplusplus = re.search(r"^\s*requires cplusplus\s*$", module["body"], re.MULTILINE) + extensions = (".h", ".hpp", ".tpp") if cplusplus else (".h",) + if header.suffix not in extensions: + raise ValueError(f"Module {name} accepts these header extensions: {', '.join(extensions)}.") + + link = None if cplusplus else public / header.name + entry = f"../{relative}" if cplusplus else f"OpenRenderBox/{header.name}" + create_link = link is not None and not os.path.lexists(link) + if link is not None and not create_link: + if not link.is_symlink() or link.resolve() != header: + raise ValueError(f"Public header path already exists: {link.relative_to(root)}.") + + registered = False + for owner in modules.values(): + for declaration in HEADER.finditer(owner["body"]): + path = declaration["path"] + if path != entry and (include / path).resolve() != header: + continue + if owner["name"] != name or path != entry: + raise ValueError(f"Header already registered in {owner['name']} as {path}.") + registered = True + + updated = contents + if not registered: + export = re.search(r"^([ \t]+)export \*[ \t]*$", module["body"], re.MULTILINE) + if export is None: + raise ValueError(f"Module {name} must contain an 'export *' line.") + kind = "textual header" if header.suffix == ".tpp" else "header" + position = module.start("body") + export.start() + updated = contents[:position] + f'{export[1]}{kind} "{entry}"\n' + contents[position:] + + if create_link: + public.mkdir(parents=True, exist_ok=True) + link.symlink_to(os.path.relpath(header, public)) + try: + if updated != contents: + write_module_map(module_map, updated) + except OSError: + if create_link: + link.unlink() + raise + + if create_link or updated != contents: + print(f"Registered {relative} in {name}.") + print("Regenerate the Tuist project before the next framework build.") + else: + print(f"Already registered: {relative} in {name}.") + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("header", type=Path, help="Source header path, absolute or relative to the repository root.") + parser.add_argument("module", help="Existing submodule, such as C, ObjC, or Animation.") + arguments = parser.parse_args() + try: + add_header(Path(__file__).resolve().parents[1], arguments.header, arguments.module) + except (OSError, ValueError) as error: + parser.error(str(error)) + + +if __name__ == "__main__": + main() diff --git a/Scripts/gen_rb_template.sh b/Scripts/gen_rb_template.sh index 5019ff1..7d24723 100755 --- a/Scripts/gen_rb_template.sh +++ b/Scripts/gen_rb_template.sh @@ -14,7 +14,7 @@ gen_interface() { gen_header() { mkdir -p .rb_template/Headers - cp -r Sources/OpenRenderBox/include/OpenRenderBox/* .rb_template/Headers/ + cp -L Sources/OpenRenderBoxCxx/include/OpenRenderBox/*.h .rb_template/Headers/ # Rename files from ORBxx to RBxx and OpenRenderBoxxx to RenderBoxxx find .rb_template/Headers -name "ORB*" -type f | while read file; do diff --git a/Sources/OpenRenderBox/Animation/ORBSymbolUpdate.swift b/Sources/OpenRenderBox/Animation/ORBSymbolUpdate.swift index de367ac..5b468b4 100644 --- a/Sources/OpenRenderBox/Animation/ORBSymbolUpdate.swift +++ b/Sources/OpenRenderBox/Animation/ORBSymbolUpdate.swift @@ -2,8 +2,10 @@ // ORBSymbolUpdate.swift // OpenRenderBox +#if !canImport(ObjectiveC) || !OPENRENDERBOX_CF_CGTYPES public import OpenCoreGraphicsShims public import OpenRenderBoxCxx +#endif #if !canImport(ObjectiveC) diff --git a/Sources/OpenRenderBox/Export.swift b/Sources/OpenRenderBox/Export.swift index d29d410..4bfb9e2 100644 --- a/Sources/OpenRenderBox/Export.swift +++ b/Sources/OpenRenderBox/Export.swift @@ -2,4 +2,6 @@ // Export.swift // OpenRenderBox +#if SWIFT_PACKAGE @_exported public import OpenRenderBoxCxx +#endif diff --git a/Sources/OpenRenderBoxCxx/Animation/Animation.cpp b/Sources/OpenRenderBoxCxx/Animation/Animation.cpp index 2c29925..6c92cc9 100644 --- a/Sources/OpenRenderBoxCxx/Animation/Animation.cpp +++ b/Sources/OpenRenderBoxCxx/Animation/Animation.cpp @@ -2,7 +2,7 @@ // Animation.cpp // OpenRenderBox -#include +#include "Animation.hpp" #include namespace ORB { diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Animation/Animation.hpp b/Sources/OpenRenderBoxCxx/Animation/Animation.hpp similarity index 95% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Animation/Animation.hpp rename to Sources/OpenRenderBoxCxx/Animation/Animation.hpp index 8a830fd..fb1bba4 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Animation/Animation.hpp +++ b/Sources/OpenRenderBoxCxx/Animation/Animation.hpp @@ -4,7 +4,7 @@ #pragma once -#include +#include "../Vector/vector.hpp" namespace ORB { diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBAnimation.h b/Sources/OpenRenderBoxCxx/Animation/ORBAnimation.h similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBAnimation.h rename to Sources/OpenRenderBoxCxx/Animation/ORBAnimation.h diff --git a/Sources/OpenRenderBoxCxx/Animation/ORBAnimation.mm b/Sources/OpenRenderBoxCxx/Animation/ORBAnimation.mm index 61e3c7b..6bce39b 100644 --- a/Sources/OpenRenderBoxCxx/Animation/ORBAnimation.mm +++ b/Sources/OpenRenderBoxCxx/Animation/ORBAnimation.mm @@ -2,7 +2,7 @@ // ORBAnimation.mm // OpenRenderBox -#include +#include #if ORB_OBJC_FOUNDATION diff --git a/Sources/OpenRenderBoxCxx/Animation/ORBAnimation_Private.h b/Sources/OpenRenderBoxCxx/Animation/ORBAnimation_Private.h index a8b340c..06188cf 100644 --- a/Sources/OpenRenderBoxCxx/Animation/ORBAnimation_Private.h +++ b/Sources/OpenRenderBoxCxx/Animation/ORBAnimation_Private.h @@ -4,10 +4,10 @@ #pragma once -#include +#include #if ORB_OBJC_FOUNDATION && defined(__cplusplus) -#include +#include "Animation.hpp" @interface ORBAnimation () - (const ORB::Animation &)orb_animation __attribute__((objc_direct)); diff --git a/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimation.h b/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimation.h new file mode 100644 index 0000000..1896c5b --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimation.h @@ -0,0 +1,111 @@ +// +// ORBSymbolAnimation.h +// OpenRenderBox + +#pragma once + +#include + +ORB_EXTERN_C_BEGIN + +typedef ORB_ENUM(uint32_t, ORBSymbolAnimation) { + ORBSymbolAnimationVariableValue = 0, + ORBSymbolAnimationVariableColor = 1, + ORBSymbolAnimationPulse = 2, + ORBSymbolAnimationBounce = 3, + ORBSymbolAnimationScale = 4, + ORBSymbolAnimationAppear = 5, + ORBSymbolAnimationReplace = 6, + ORBSymbolAnimationInterpolate = 7, + ORBSymbolAnimationPush = 8, + ORBSymbolAnimationDisappear = 9, + ORBSymbolAnimationWiggle = 10, + ORBSymbolAnimationRotate = 11, + ORBSymbolAnimationBreathe = 12, +}; + +typedef ORB_ENUM(int32_t, ORBSymbolScaleLevel) { + ORBSymbolScaleLevelDown = -1, + ORBSymbolScaleLevelNormal = 0, + ORBSymbolScaleLevelUp = 1, +}; + +typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationBreatheFlags) { + ORBSymbolAnimationBreatheFlagsOnlyScale = 1 << 0, +} ORB_SWIFT_NAME(ORBSymbolAnimation.BreatheOptions); + +typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationBounceFlags) { + ORBSymbolAnimationBounceFlagsUp = 1 << 0, + ORBSymbolAnimationBounceFlagsDown = 1 << 1, + ORBSymbolAnimationBounceFlagsContinuous = 1 << 4, +} ORB_SWIFT_NAME(ORBSymbolAnimation.BounceOptions); + +typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationWiggleFlags) { + ORBSymbolAnimationWiggleFlagsLocalized = 0x1, + ORBSymbolAnimationWiggleFlagsRotational = 0x3, + ORBSymbolAnimationWiggleFlagsForward = 0x10, + ORBSymbolAnimationWiggleFlagsBackward = 0x20, + ORBSymbolAnimationWiggleFlagsDirectionMask = 0xF0, + ORBSymbolAnimationWiggleFlagsContinuous = 0x100, +} ORB_SWIFT_NAME(ORBSymbolAnimation.WiggleOptions); + +typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationRotateFlags) { + ORBSymbolAnimationRotateFlagsClockwise = 1 << 0, + ORBSymbolAnimationRotateFlagsCounterClockwise = 1 << 1, + ORBSymbolAnimationRotateFlagsContinuous = 1 << 4, +} ORB_SWIFT_NAME(ORBSymbolAnimation.RotateOptions); + +typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationVariableColorFlags) { + ORBSymbolAnimationVariableColorFlagsIterative = 1 << 0, + ORBSymbolAnimationVariableColorFlagsHideInactiveLayers = 1 << 1, + ORBSymbolAnimationVariableColorFlagsReversing = 1 << 3, +} ORB_SWIFT_NAME(ORBSymbolAnimation.VariableColorOptions); + +typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationAppearDisappearFlags) { + ORBSymbolAnimationAppearDisappearFlagsDown = 0x2, + ORBSymbolAnimationAppearDisappearFlagsUp = 0x3, + ORBSymbolAnimationAppearDisappearFlagsWholeSymbol = 0x10, +} ORB_SWIFT_NAME(ORBSymbolAnimation.AppearDisappearOptions); + +typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationReplaceFlags) { + ORBSymbolAnimationReplaceFlagsDown = 0x2, + ORBSymbolAnimationReplaceFlagsUp = 0x3, + ORBSymbolAnimationReplaceFlagsOffUp = 0x4, + ORBSymbolAnimationReplaceFlagsWholeSymbol = 0x10, + ORBSymbolAnimationReplaceFlagsNoSlashes = 0x20, + ORBSymbolAnimationReplaceFlagsNoBadges = 0x40, +} ORB_SWIFT_NAME(ORBSymbolAnimation.ReplaceOptions); + +ORB_EXTERN_C_END + +#if ORB_OBJC_FOUNDATION + +#include + +ORB_ASSUME_NONNULL_BEGIN + +typedef NSString *ORBSymbolAnimationOptionKey NS_TYPED_EXTENSIBLE_ENUM ORB_SWIFT_NAME(ORBSymbolAnimation.OptionKey); + +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationTiming; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationSpeed; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationClampsSpeed; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationRepeatCount; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationRepeatDelay; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationPriority; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationByLayer; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationOnCompletion; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationSymbolDefaults; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationBreatheOptions; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationPulseOptions; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationBounceOptions; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationWiggleOptions; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationWiggleAngle; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationRotateOptions; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationVariableColorOptions; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationAppearDisappearOptions; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationReplaceOptions; +ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationInterpolateOptions; + +ORB_ASSUME_NONNULL_END + +#endif /* ORB_OBJC_FOUNDATION */ diff --git a/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimation.m b/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimation.m index 2d9b293..a8e1631 100644 --- a/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimation.m +++ b/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimation.m @@ -2,7 +2,7 @@ // ORBSymbolAnimation.m // OpenRenderBox -#include +#include #if ORB_OBJC_FOUNDATION diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBSymbolAnimator.h b/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimator.h similarity index 95% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBSymbolAnimator.h rename to Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimator.h index eef5f44..95623e9 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBSymbolAnimator.h +++ b/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimator.h @@ -11,8 +11,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimator.m b/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimator.m index dd4b2b2..72aee7c 100644 --- a/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimator.m +++ b/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimator.m @@ -2,7 +2,7 @@ // ORBSymbolAnimator.m // OpenRenderBox -#include +#include #if ORB_OBJC_FOUNDATION diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBSymbolAnimatorObserver.h b/Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimatorObserver.h similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBSymbolAnimatorObserver.h rename to Sources/OpenRenderBoxCxx/Animation/ORBSymbolAnimatorObserver.h diff --git a/Sources/OpenRenderBoxCxx/Animation/ORBSymbolUpdate.h b/Sources/OpenRenderBoxCxx/Animation/ORBSymbolUpdate.h new file mode 100644 index 0000000..d8de26b --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Animation/ORBSymbolUpdate.h @@ -0,0 +1,75 @@ +// +// ORBSymbolUpdate.h +// OpenRenderBox + +#pragma once + +#include +#include +#include +#include +#include + +#if ORB_OBJC_FOUNDATION +#include +#endif + +ORB_ASSUME_NONNULL_BEGIN + +typedef ORB_OPTIONS(uint32_t, ORBSymbolUpdateFlags) { + ORBSymbolUpdateFlagsSwapAxes = 1 << 0, + ORBSymbolUpdateFlagsFlipX = 1 << 1, + ORBSymbolUpdateFlagsFlipY = 1 << 2, + ORBSymbolUpdateFlagsMergeLayers = 1 << 4, + // Apply the glyph's vertical alignment offset to each layer transform. + ORBSymbolUpdateFlagsApplyVerticalOffset = 1 << 5, +}; + +typedef ORB_OPTIONS(uint32_t, ORBSymbolUpdateLayerFlags) { + ORBSymbolUpdateLayerFlagsIncludeClips = 1 << 0, +}; + +typedef ORB_ENUM(uint32_t, ORBSymbolStyle) { + ORBSymbolStylePrimary = 0, + ORBSymbolStyleSecondary = 5, + ORBSymbolStyleTertiary = 6, + ORBSymbolStyleQuaternary = 7, + ORBSymbolStyleQuinary = 8, + ORBSymbolStyleNamedColor = 9, +}; + +typedef struct _ORBSymbolUpdate *ORBSymbolUpdate ORB_SWIFT_STRUCT; + +// The update owns all layer data. A layer is valid until endUpdate:. +typedef struct ORBSymbolUpdateLayer { + ORBSymbolUpdate update; + intptr_t group; + intptr_t index; +} ORBSymbolUpdateLayer; + +#if ORB_OBJC_FOUNDATION + +ORB_EXTERN_C_BEGIN + +ORB_EXPORT double ORBSymbolUpdateNextTime(ORBSymbolUpdate update) ORB_SWIFT_NAME(getter:ORBSymbolUpdate.nextTime(self:)); +ORB_EXPORT uint32_t ORBSymbolUpdateStyleMask(ORBSymbolUpdate update) ORB_SWIFT_NAME(getter:ORBSymbolUpdate.styleMask(self:)); +ORB_EXPORT intptr_t ORBSymbolUpdateGroupCount(ORBSymbolUpdate update) ORB_SWIFT_NAME(getter:ORBSymbolUpdate.groupCount(self:)); +ORB_EXPORT intptr_t ORBSymbolUpdateGroupSize(ORBSymbolUpdate update, intptr_t group) ORB_SWIFT_NAME(ORBSymbolUpdate.groupSize(self:group:)); +ORB_EXPORT CGImageRef _Nullable ORBSymbolUpdateTemplateImage(ORBSymbolUpdate update, double * _Nullable scale, float * _Nullable opacity) CF_RETURNS_NOT_RETAINED ORB_SWIFT_NAME(ORBSymbolUpdate.templateImage(self:scale:opacity:)); +ORB_EXPORT void ORBSymbolUpdateDrawWithStyleResolver(ORBSymbolUpdate update, ORBDrawingState state, ORBColor (^resolver)(ORBSymbolStyle, NSString * _Nullable)) ORB_SWIFT_NAME(ORBSymbolUpdate.draw(self:in:resolver:)); + +ORB_EXPORT float ORBSymbolUpdateLayerDrawingOpacity(ORBSymbolUpdateLayer layer) ORB_SWIFT_NAME(getter:ORBSymbolUpdateLayer.drawingOpacity(self:)); +ORB_EXPORT ORBSymbolStyle ORBSymbolUpdateLayerStyle(ORBSymbolUpdateLayer layer) ORB_SWIFT_NAME(getter:ORBSymbolUpdateLayer.style(self:)); +ORB_EXPORT NSString * _Nullable ORBSymbolUpdateLayerColorName(ORBSymbolUpdateLayer layer) ORB_SWIFT_NAME(getter:ORBSymbolUpdateLayer.colorName(self:)); +ORB_EXPORT CGColorRef _Nullable ORBSymbolUpdateLayerDefaultColor(ORBSymbolUpdateLayer layer) CF_RETURNS_NOT_RETAINED ORB_SWIFT_NAME(getter:ORBSymbolUpdateLayer.defaultColor(self:)); +// The update owns the returned path. Copy it before the update ends. +#if OPENRENDERBOX_CF_CGTYPES +ORB_EXPORT ORBPath ORBSymbolUpdateLayerPath(ORBSymbolUpdateLayer layer, CGAffineTransform *transform, ORBSymbolUpdateLayerFlags flags) ORB_SWIFT_NAME(ORBSymbolUpdateLayer.path(self:transform:flags:)); +#endif +ORB_EXPORT void ORBSymbolUpdateLayerDraw(ORBSymbolUpdateLayer layer, ORBDrawingState state, ORBColor color, float opacity, ORBBlendMode blendMode, ORBSymbolUpdateLayerFlags flags) ORB_SWIFT_NAME(ORBSymbolUpdateLayer.draw(self:in:color:opacity:blendMode:flags:)); + +ORB_EXTERN_C_END + +#endif /* ORB_OBJC_FOUNDATION */ + +ORB_ASSUME_NONNULL_END diff --git a/Sources/OpenRenderBoxCxx/Animation/ORBTransition.h b/Sources/OpenRenderBoxCxx/Animation/ORBTransition.h new file mode 100644 index 0000000..1589836 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Animation/ORBTransition.h @@ -0,0 +1,104 @@ +// +// ORBTransition.h +// OpenRenderBox + +#pragma once + +#include + +ORB_ASSUME_NONNULL_BEGIN + +ORB_EXTERN_C_BEGIN + +typedef ORB_ENUM(uint32_t, ORBTransitionMethod) { + ORBTransitionMethodEmpty = 0, + ORBTransitionMethodDiff = 1, + ORBTransitionMethodForwards = 2, + ORBTransitionMethodBackwards = 3, + ORBTransitionMethodPrefix = 4, + ORBTransitionMethodSuffix = 5, + ORBTransitionMethodBinary = 6, + ORBTransitionMethodNone = 7, + ORBTransitionMethodPrefixAndSuffix = 8, +}; + +typedef ORB_OPTIONS(uint32_t, ORBTransitionEvents) { + ORBTransitionEventsAdd = 1 << 0, + ORBTransitionEventsRemove = 1 << 1, + ORBTransitionEventsAddRemove = ORBTransitionEventsAdd | ORBTransitionEventsRemove, +}; + +typedef ORB_OPTIONS(uint32_t, ORBTransitionEffectFlags) { + ORBTransitionEffectFlagsRemoveInverts = 1 << 0, +}; + +typedef ORB_ENUM(uint32_t, ORBTransitionEffectType) { + ORBTransitionEffectTypeNone = 0, + ORBTransitionEffectTypeAlpha = 1, + ORBTransitionEffectTypeScaleCenter = 2, + ORBTransitionEffectTypeTranslation = 3, + ORBTransitionEffectTypeBlur = 4, + ORBTransitionEffectTypeMatchMove = 5, + ORBTransitionEffectTypeScaleOrigin = 6, + ORBTransitionEffectTypeAnchorLeft = 7, + ORBTransitionEffectTypeAnchorRight = 8, + ORBTransitionEffectTypeAnchorUp = 9, + ORBTransitionEffectTypeAnchorDown = 10, + ORBTransitionEffectTypeSequenceLeft = 11, + ORBTransitionEffectTypeSequenceRight = 12, + ORBTransitionEffectTypeSequenceUp = 13, + ORBTransitionEffectTypeSequenceDown = 14, + ORBTransitionEffectTypeRelativeTranslation = 15, + ORBTransitionEffectTypeRelativeBlur = 16, + ORBTransitionEffectTypeAppearDisappear = 17, + ORBTransitionEffectTypeReplace = 18, + ORBTransitionEffectTypeSequenceForwards = 19, + ORBTransitionEffectTypeSequenceBackwards = 20, +}; + +ORB_EXTERN_C_END + +ORB_ASSUME_NONNULL_END + +#if ORB_OBJC_FOUNDATION + +#include +#include + +ORB_ASSUME_NONNULL_BEGIN + +@interface ORBTransitionEffect : NSObject + +@property (nonatomic) ORBTransitionEffectType type; +@property (nonatomic) ORBTransitionEffectFlags flags; +@property (nonatomic) ORBTransitionEvents events; +@property (nonatomic) float beginTime; +@property (nonatomic) float duration; +@property (nonatomic) NSUInteger animationIndex; +@property (nonatomic) NSUInteger insertAnimationIndex; +@property (nonatomic) NSUInteger removeAnimationIndex; + +- (float)argumentValueAtIndex:(NSUInteger)index; +- (void)setArgumentValue:(float)value atIndex:(NSUInteger)index; +- (uint32_t)integerArgumentValueAtIndex:(NSUInteger)index; +- (void)setIntegerArgumentValue:(uint32_t)value atIndex:(NSUInteger)index; + +@end + +@interface ORBTransition : NSObject + +@property (class, readonly, nonatomic) ORBTransition *defaultTransition; +@property (nonatomic) ORBTransitionMethod method; +@property (nonatomic, strong, nullable) ORBAnimation *animation; +@property (nonatomic) uint32_t maxChanges; +@property (nonatomic, getter=isReplaceable) BOOL replaceable; +@property (readonly, nonatomic, copy) NSArray *effects; +@property (nonatomic) float addRemoveDuration; + +- (void)addEffect:(nullable ORBTransitionEffect *)effect; + +@end + +ORB_ASSUME_NONNULL_END + +#endif /* ORB_OBJC_FOUNDATION */ diff --git a/Sources/OpenRenderBoxCxx/Animation/ORBTransition.mm b/Sources/OpenRenderBoxCxx/Animation/ORBTransition.mm index 0c6ad8f..68547ac 100644 --- a/Sources/OpenRenderBoxCxx/Animation/ORBTransition.mm +++ b/Sources/OpenRenderBoxCxx/Animation/ORBTransition.mm @@ -2,13 +2,13 @@ // ORBTransition.mm // OpenRenderBox -#include +#include #if ORB_OBJC_FOUNDATION -#include -#include -#include +#include "Transition.hpp" +#include +#include #include "ORBAnimation_Private.h" #include diff --git a/Sources/OpenRenderBoxCxx/Animation/Transition.cpp b/Sources/OpenRenderBoxCxx/Animation/Transition.cpp index 66ebf5c..92fb608 100644 --- a/Sources/OpenRenderBoxCxx/Animation/Transition.cpp +++ b/Sources/OpenRenderBoxCxx/Animation/Transition.cpp @@ -2,7 +2,7 @@ // Transition.cpp // OpenRenderBox -#include +#include "Transition.hpp" #include #include diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Animation/Transition.hpp b/Sources/OpenRenderBoxCxx/Animation/Transition.hpp similarity index 98% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Animation/Transition.hpp rename to Sources/OpenRenderBoxCxx/Animation/Transition.hpp index 7638f0a..339b1a2 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Animation/Transition.hpp +++ b/Sources/OpenRenderBoxCxx/Animation/Transition.hpp @@ -4,7 +4,7 @@ #pragma once -#include +#include "Animation.hpp" #include namespace ORB { diff --git a/Sources/OpenRenderBoxCxx/Base/CFCGTypes.h b/Sources/OpenRenderBoxCxx/Base/CFCGTypes.h new file mode 100644 index 0000000..12f1be4 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Base/CFCGTypes.h @@ -0,0 +1,132 @@ +#if __has_include() +#include +#endif + +#if OPENRENDERBOX_CF_CGTYPES + +/* CFCGTypes.h + Copyright (c) 1998-2021, Apple Inc. and the Swift project authors + + Portions Copyright (c) 2014-2021, Apple Inc. and the Swift project authors + Licensed under Apache License v2.0 with Runtime Library Exception + See http://swift.org/LICENSE.txt for license information + See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +*/ + +#if !defined(__COREFOUNDATION_CFCGTYPES__) +#define __COREFOUNDATION_CFCGTYPES__ 1 + +#include +#include +#include +#include + +#define CF_DEFINES_CG_TYPES + +#if defined(__has_attribute) && __has_attribute(objc_boxable) +# define CF_BOXABLE __attribute__((objc_boxable)) +#else +# define CF_BOXABLE +#endif + +/* Definition of `CGFLOAT_TYPE', `CGFLOAT_IS_DOUBLE', `CGFLOAT_MIN', and + * `CGFLOAT_MAX'. */ + + #if defined(__LP64__) && __LP64__ + # define CGFLOAT_TYPE double + # define CGFLOAT_IS_DOUBLE 1 + # define CGFLOAT_MIN DBL_MIN + # define CGFLOAT_MAX DBL_MAX + # define CGFLOAT_EPSILON DBL_EPSILON + #else + # define CGFLOAT_TYPE float + # define CGFLOAT_IS_DOUBLE 0 + # define CGFLOAT_MIN FLT_MIN + # define CGFLOAT_MAX FLT_MAX + # define CGFLOAT_EPSILON FLT_EPSILON + #endif + +/* Definition of the `CGFloat' type and `CGFLOAT_DEFINED'. */ + +typedef CGFLOAT_TYPE CGFloat; +#define CGFLOAT_DEFINED 1 + +/* Points. */ +struct +CGPoint { + CGFloat x; + CGFloat y; +}; +typedef struct CF_BOXABLE CGPoint CGPoint; + +/* Sizes. */ + +struct CGSize { + CGFloat width; + CGFloat height; +}; +typedef struct CF_BOXABLE CGSize CGSize; + +/* Vectors. */ + +#define CGVECTOR_DEFINED 1 + +struct CGVector { + CGFloat dx; + CGFloat dy; +}; +typedef struct CF_BOXABLE CGVector CGVector; + +/* Rectangles. */ + +struct CGRect { + CGPoint origin; + CGSize size; +}; +typedef struct CF_BOXABLE CGRect CGRect; + +/* Rectangle edges. */ + +typedef CF_CLOSED_ENUM(uint32_t, CGRectEdge) { + CGRectMinXEdge, CGRectMinYEdge, CGRectMaxXEdge, CGRectMaxYEdge +}; + +typedef struct CGAffineTransform CGAffineTransform; + +struct CGAffineTransform { + CGFloat a, b, c, d; + CGFloat tx, ty; +}; + +#define CF_DEFINES_CGAFFINETRANSFORMCOMPONENTS + +/* |------------------ CGAffineTransformComponents ----------------| + * + * | a b 0 | | sx 0 0 | | 1 0 0 | | cos(t) sin(t) 0 | | 1 0 0 | + * | c d 0 | = | 0 sy 0 | * | sh 1 0 | * |-sin(t) cos(t) 0 | * | 0 1 0 | + * | tx ty 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | tx ty 1 | + * CGAffineTransform scale shear rotation translation + */ +typedef struct CGAffineTransformComponents CGAffineTransformComponents + CF_SWIFT_NAME(CGAffineTransform.Components); + +struct CGAffineTransformComponents { + + /* initial scaling in X and Y dimensions. {sx,sy} */ + /* Negative values indicate the image has been flipped in this dimension. */ + CGSize scale; + + /* shear distortion (sh). Turns rectangles to parallelograms. 0 for no shear. Typically 0. */ + CGFloat horizontalShear; + + /* Rotation angle in radians about the origin. (t) Sign convention for clockwise rotation */ + /* may differ between various Apple frameworks based on origin placement. Please see discussion. */ + CGFloat rotation; + + /* Displacement from the origin (ty, ty) */ + CGVector translation; +}; + +#endif /* ! __COREFOUNDATION_CFCGTYPES__ */ + +#endif /* OPENRENDERBOX_CF_CGTYPES */ diff --git a/Sources/OpenRenderBoxCxx/Base/ORBBase.h b/Sources/OpenRenderBoxCxx/Base/ORBBase.h new file mode 100644 index 0000000..84627af --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Base/ORBBase.h @@ -0,0 +1,76 @@ +// +// ORBBase.h +// OpenRenderBox + +#pragma once + +// Framework builds export their fixed backend configuration. +#if __has_include() +#include +#endif + +#if DEBUG +#define ORB_ASSERTION +#else +#undef ORB_ASSERTION +#endif + +#if __has_attribute(cold) +#define __cold __attribute__((__cold__)) +#else +#define __cold +#endif + +#if __has_attribute(noreturn) +#define __dead2 __attribute__((__noreturn__)) +#else +#define __dead2 +#endif + +#if defined(__cplusplus) +#define ORB_NOEXCEPT noexcept +#else +#define ORB_NOEXCEPT +#endif + +#if defined(__GNUC__) +#define ORB_INLINE __inline__ __attribute__((always_inline)) +#elif defined(__cplusplus) +#define ORB_INLINE inline +#else +#define ORB_INLINE +#endif + +#if defined(__cplusplus) +#define ORB_CONSTEXPR constexpr +#else +#define ORB_CONSTEXPR +#endif + +#include +#include +#include +#include +#include + +#define ORB_ENUM CF_ENUM +#define ORB_CLOSED_ENUM CF_CLOSED_ENUM +#define ORB_OPTIONS CF_OPTIONS +#define ORB_EXTERN_C_BEGIN CF_EXTERN_C_BEGIN +#define ORB_EXTERN_C_END CF_EXTERN_C_END +#define ORB_ASSUME_NONNULL_BEGIN CF_ASSUME_NONNULL_BEGIN +#define ORB_ASSUME_NONNULL_END CF_ASSUME_NONNULL_END +#define ORB_IMPLICIT_BRIDGING_ENABLED CF_IMPLICIT_BRIDGING_ENABLED +#define ORB_IMPLICIT_BRIDGING_DISABLED CF_IMPLICIT_BRIDGING_DISABLED +#define ORB_EXPORT CF_EXPORT +#define ORB_BRIDGED_TYPE CF_BRIDGED_TYPE + +#if ORB_TARGET_OS_DARWIN && __OBJC__ +#define ORB_OBJC_FOUNDATION 1 +#else +#define ORB_OBJC_FOUNDATION 0 +#endif /* TARGET_OS_DARWIN && __OBJC__ */ + +#if !ORB_TRRET_OS_DARWIN +#include +#endif diff --git a/Sources/OpenRenderBoxCxx/Base/ORBSwiftSupport.h b/Sources/OpenRenderBoxCxx/Base/ORBSwiftSupport.h new file mode 100644 index 0000000..ea4e40d --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Base/ORBSwiftSupport.h @@ -0,0 +1,42 @@ +// +// ORBSwiftSupport.h +// OpenRenderBox + +#pragma once + +#if __has_attribute(swift_name) +#define ORB_SWIFT_NAME(_name) __attribute__((swift_name(#_name))) +#else +#define ORB_SWIFT_NAME +#endif + +#if __has_attribute(swift_wrapper) +#define ORB_SWIFT_STRUCT __attribute__((swift_wrapper(struct))) +#else +#define ORB_SWIFT_STRUCT +#endif + +#if __has_attribute(swift_private) +#define ORB_REFINED_FOR_SWIFT __attribute__((swift_private)) +#else +#define ORB_REFINED_FOR_SWIFT +#endif + +// MARK: - Call Convension + +#define ORB_SWIFT_CC(CC) ORB_SWIFT_CC_##CC +// ORB_SWIFT_CC(c) is the C calling convention. +#define ORB_SWIFT_CC_c + +// ORB_SWIFT_CC(swift) is the Swift calling convention. +#if __has_attribute(swiftcall) +#define ORB_SWIFT_CC_swift __attribute__((swiftcall)) +#define ORB_SWIFT_CONTEXT __attribute__((swift_context)) +#define ORB_SWIFT_ERROR_RESULT __attribute__((swift_error_result)) +#define ORB_SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) +#else +#define ORB_SWIFT_CC_swift +#define ORB_SWIFT_CONTEXT +#define ORB_SWIFT_ERROR_RESULT +#define ORB_SWIFT_INDIRECT_RESULT +#endif diff --git a/Sources/OpenRenderBoxCxx/Base/ORBTargetConditionals.h b/Sources/OpenRenderBoxCxx/Base/ORBTargetConditionals.h new file mode 100644 index 0000000..13cd9e4 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Base/ORBTargetConditionals.h @@ -0,0 +1,274 @@ +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See http://swift.org/LICENSE.txt for license information +// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// + +/* + File: ORBTargetConditionals.h + + Contains: Autoconfiguration of TARGET_ conditionals for Mac OS X and iPhone + + Note: OpenSwiftUITargetConditionals.h in 3.4 Universal Interfaces works + with all compilers. This header only recognizes compilers + known to run on Mac OS X. + +*/ + +#pragma once +/**************************************************************************************************** + + TARGET_CPU_* + These conditionals specify which microprocessor instruction set is being + generated. At most one of these is true, the rest are false. + + TARGET_CPU_PPC - Compiler is generating PowerPC instructions for 32-bit mode + TARGET_CPU_PPC64 - Compiler is generating PowerPC instructions for 64-bit mode + TARGET_CPU_68K - Compiler is generating 680x0 instructions + TARGET_CPU_X86 - Compiler is generating x86 instructions + TARGET_CPU_ARM - Compiler is generating ARM instructions + TARGET_CPU_MIPS - Compiler is generating MIPS instructions + TARGET_CPU_SPARC - Compiler is generating Sparc instructions + TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions + TARGET_CPU_WASM32 - Compiler is generating WebAssembly instructions for 32-bit mode + + + TARGET_OS_* + These conditionals specify in which Operating System the generated code will + run. Indention is used to show which conditionals are evolutionary subclasses. + + The MAC/WIN32/UNIX conditionals are mutually exclusive. + The IOS/TV/WATCH conditionals are mutually exclusive. + + + TARGET_OS_WIN32 - Generated code will run under 32-bit Windows + TARGET_OS_UNIX - Generated code will run under some Unix (not OSX) + TARGET_OS_CYGWIN - Generated code will run under 64-bit Cygwin + TARGET_OS_WASI - Generated code will run under WebAssembly System Interface + TARGET_OS_MAC - Generated code will run under Mac OS X variant + TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator + TARGET_OS_IOS - Generated code will run under iOS + TARGET_OS_TV - Generated code will run under Apple TV OS + TARGET_OS_WATCH - Generated code will run under Apple Watch OS + TARGET_OS_SIMULATOR - Generated code will run under a simulator + TARGET_OS_EMBEDDED - Generated code for firmware + + TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR + TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH + + TARGET_RT_* + These conditionals specify in which runtime the generated code will + run. This is needed when the OS and CPU support more than one runtime + (e.g. Mac OS X supports CFM and mach-o). + + TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers + TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers + TARGET_RT_64_BIT - Generated code uses 64-bit pointers + TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used + TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used + + +****************************************************************************************************/ + +#if __APPLE__ +#define ORB_TARGET_OS_DARWIN 1 +#define ORB_TARGET_OS_LINUX 0 +#define ORB_TARGET_OS_WINDOWS 0 +#define ORB_TARGET_OS_BSD 0 +#define ORB_TARGET_OS_ANDROID 0 +#define ORB_TARGET_OS_CYGWIN 0 +#define ORB_TARGET_OS_WASI 0 +#elif __ANDROID__ +#define ORB_TARGET_OS_DARWIN 0 +#define ORB_TARGET_OS_LINUX 1 +#define ORB_TARGET_OS_WINDOWS 0 +#define ORB_TARGET_OS_BSD 0 +#define ORB_TARGET_OS_ANDROID 1 +#define ORB_TARGET_OS_CYGWIN 0 +#define ORB_TARGET_OS_WASI 0 +#elif __linux__ +#define ORB_TARGET_OS_DARWIN 0 +#define ORB_TARGET_OS_LINUX 1 +#define ORB_TARGET_OS_WINDOWS 0 +#define ORB_TARGET_OS_BSD 0 +#define ORB_TARGET_OS_ANDROID 0 +#define ORB_TARGET_OS_CYGWIN 0 +#define ORB_TARGET_OS_WASI 0 +#elif __CYGWIN__ +#define ORB_TARGET_OS_DARWIN 0 +#define ORB_TARGET_OS_LINUX 1 +#define ORB_TARGET_OS_WINDOWS 0 +#define ORB_TARGET_OS_BSD 0 +#define ORB_TARGET_OS_ANDROID 0 +#define ORB_TARGET_OS_CYGWIN 1 +#define ORB_TARGET_OS_WASI 0 +#elif _WIN32 || _WIN64 +#define ORB_TARGET_OS_DARWIN 0 +#define ORB_TARGET_OS_LINUX 0 +#define ORB_TARGET_OS_WINDOWS 1 +#define ORB_TARGET_OS_BSD 0 +#define ORB_TARGET_OS_ANDROID 0 +#define ORB_TARGET_OS_CYGWIN 0 +#define ORB_TARGET_OS_WASI 0 +#elif __unix__ +#define ORB_TARGET_OS_DARWIN 0 +#define ORB_TARGET_OS_LINUX 0 +#define ORB_TARGET_OS_WINDOWS 0 +#define ORB_TARGET_OS_BSD 1 +#define ORB_TARGET_OS_ANDROID 0 +#define ORB_TARGET_OS_CYGWIN 0 +#define ORB_TARGET_OS_WASI 0 +#elif __wasi__ +#define ORB_TARGET_OS_DARWIN 0 +#define ORB_TARGET_OS_LINUX 0 +#define ORB_TARGET_OS_WINDOWS 0 +#define ORB_TARGET_OS_BSD 0 +#define ORB_TARGET_OS_ANDROID 0 +#define ORB_TARGET_OS_CYGWIN 0 +#define ORB_TARGET_OS_WASI 1 +#else +#error unknown operating system +#endif + +#define ORB_TARGET_OS_WIN32 ORB_TARGET_OS_WINDOWS +#define ORB_TARGET_OS_MAC ORB_TARGET_OS_DARWIN +#define ORB_TARGET_OS_OSX ORB_TARGET_OS_DARWIN + +// iOS, watchOS, and tvOS are not supported +#define ORB_TARGET_OS_IPHONE 0 +#define ORB_TARGET_OS_IOS 0 +#define ORB_TARGET_OS_WATCH 0 +#define ORB_TARGET_OS_TV 0 + +#if __x86_64__ +#define ORB_TARGET_CPU_PPC 0 +#define ORB_TARGET_CPU_PPC64 0 +#define ORB_TARGET_CPU_X86 0 +#define ORB_TARGET_CPU_X86_64 1 +#define ORB_TARGET_CPU_ARM 0 +#define ORB_TARGET_CPU_ARM64 0 +#define ORB_TARGET_CPU_MIPS 0 +#define ORB_TARGET_CPU_MIPS64 0 +#define ORB_TARGET_CPU_S390X 0 +#define ORB_TARGET_CPU_WASM32 0 +#elif __arm64__ || __aarch64__ +#define ORB_TARGET_CPU_PPC 0 +#define ORB_TARGET_CPU_PPC64 0 +#define ORB_TARGET_CPU_X86 0 +#define ORB_TARGET_CPU_X86_64 0 +#define ORB_TARGET_CPU_ARM 0 +#define ORB_TARGET_CPU_ARM64 1 +#define ORB_TARGET_CPU_MIPS 0 +#define ORB_TARGET_CPU_MIPS64 0 +#define ORB_TARGET_CPU_S390X 0 +#define ORB_TARGET_CPU_WASM32 0 +#elif __mips64__ +#define ORB_TARGET_CPU_PPC 0 +#define ORB_TARGET_CPU_PPC64 0 +#define ORB_TARGET_CPU_X86 0 +#define ORB_TARGET_CPU_X86_64 0 +#define ORB_TARGET_CPU_ARM 0 +#define ORB_TARGET_CPU_ARM64 0 +#define ORB_TARGET_CPU_MIPS 0 +#define ORB_TARGET_CPU_MIPS64 1 +#define ORB_TARGET_CPU_S390X 0 +#define ORB_TARGET_CPU_WASM32 0 +#elif __powerpc64__ +#define ORB_TARGET_CPU_PPC 0 +#define ORB_TARGET_CPU_PPC64 1 +#define ORB_TARGET_CPU_X86 0 +#define ORB_TARGET_CPU_X86_64 0 +#define ORB_TARGET_CPU_ARM 0 +#define ORB_TARGET_CPU_ARM64 0 +#define ORB_TARGET_CPU_MIPS 0 +#define ORB_TARGET_CPU_MIPS64 0 +#define ORB_TARGET_CPU_S390X 0 +#define ORB_TARGET_CPU_WASM32 0 +#elif __i386__ +#define ORB_TARGET_CPU_PPC 0 +#define ORB_TARGET_CPU_PPC64 0 +#define ORB_TARGET_CPU_X86 1 +#define ORB_TARGET_CPU_X86_64 0 +#define ORB_TARGET_CPU_ARM 0 +#define ORB_TARGET_CPU_ARM64 0 +#define ORB_TARGET_CPU_MIPS 0 +#define ORB_TARGET_CPU_MIPS64 0 +#define ORB_TARGET_CPU_S390X 0 +#define ORB_TARGET_CPU_WASM32 0 +#elif __arm__ +#define ORB_TARGET_CPU_PPC 0 +#define ORB_TARGET_CPU_PPC64 0 +#define ORB_TARGET_CPU_X86 0 +#define ORB_TARGET_CPU_X86_64 0 +#define ORB_TARGET_CPU_ARM 1 +#define ORB_TARGET_CPU_ARM64 0 +#define ORB_TARGET_CPU_MIPS 0 +#define ORB_TARGET_CPU_MIPS64 0 +#define ORB_TARGET_CPU_S390X 0 +#define ORB_TARGET_CPU_WASM32 0 +#elif __mips__ +#define ORB_TARGET_CPU_PPC 0 +#define ORB_TARGET_CPU_PPC64 0 +#define ORB_TARGET_CPU_X86 0 +#define ORB_TARGET_CPU_X86_64 0 +#define ORB_TARGET_CPU_ARM 0 +#define ORB_TARGET_CPU_ARM64 0 +#define ORB_TARGET_CPU_MIPS 1 +#define ORB_TARGET_CPU_MIPS64 0 +#define ORB_TARGET_CPU_S390X 0 +#define ORB_TARGET_CPU_WASM32 0 +#elif __powerpc__ +#define ORB_TARGET_CPU_PPC 1 +#define ORB_TARGET_CPU_PPC64 0 +#define ORB_TARGET_CPU_X86 0 +#define ORB_TARGET_CPU_X86_64 0 +#define ORB_TARGET_CPU_ARM 0 +#define ORB_TARGET_CPU_ARM64 0 +#define ORB_TARGET_CPU_MIPS 0 +#define ORB_TARGET_CPU_MIPS64 0 +#define ORB_TARGET_CPU_S390X 0 +#define ORB_TARGET_CPU_WASM32 0 +#elif __s390x__ +#define ORB_TARGET_CPU_PPC 0 +#define ORB_TARGET_CPU_PPC64 0 +#define ORB_TARGET_CPU_X86 0 +#define ORB_TARGET_CPU_X86_64 0 +#define ORB_TARGET_CPU_ARM 0 +#define ORB_TARGET_CPU_ARM64 0 +#define ORB_TARGET_CPU_MIPS 0 +#define ORB_TARGET_CPU_MIPS64 0 +#define ORB_TARGET_CPU_S390X 1 +#define ORB_TARGET_CPU_WASM32 0 +#elif __wasm32__ +#define ORB_TARGET_CPU_PPC 0 +#define ORB_TARGET_CPU_PPC64 0 +#define ORB_TARGET_CPU_X86 0 +#define ORB_TARGET_CPU_X86_64 0 +#define ORB_TARGET_CPU_ARM 0 +#define ORB_TARGET_CPU_ARM64 0 +#define ORB_TARGET_CPU_MIPS 0 +#define ORB_TARGET_CPU_MIPS64 0 +#define ORB_TARGET_CPU_S390X 0 +#define ORB_TARGET_CPU_WASM32 1 +#else +#error unknown architecture +#endif + +#if __LITTLE_ENDIAN__ +#define ORB_TARGET_RT_LITTLE_ENDIAN 1 +#define ORB_TARGET_RT_BIG_ENDIAN 0 +#elif __BIG_ENDIAN__ +#define ORB_TARGET_RT_LITTLE_ENDIAN 0 +#define ORB_TARGET_RT_BIG_ENDIAN 1 +#else +#error unknown endian +#endif + +#if __LP64__ || __LLP64__ || __POINTER_WIDTH__-0 == 64 +#define ORB_TARGET_RT_64_BIT 1 +#else +#define ORB_TARGET_RT_64_BIT 0 +#endif diff --git a/Sources/OpenRenderBoxCxx/Color/ColorSpace.cpp b/Sources/OpenRenderBoxCxx/Color/ColorSpace.cpp index dedb13c..3b6ad5f 100644 --- a/Sources/OpenRenderBoxCxx/Color/ColorSpace.cpp +++ b/Sources/OpenRenderBoxCxx/Color/ColorSpace.cpp @@ -2,7 +2,7 @@ // ColorSpace.cpp // OpenRenderBox -#include +#include "ColorSpace.hpp" #if ORB_TARGET_OS_DARWIN diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Color/ColorSpace.hpp b/Sources/OpenRenderBoxCxx/Color/ColorSpace.hpp similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Color/ColorSpace.hpp rename to Sources/OpenRenderBoxCxx/Color/ColorSpace.hpp diff --git a/Sources/OpenRenderBoxCxx/Color/ORBColor.cpp b/Sources/OpenRenderBoxCxx/Color/ORBColor.cpp index 655d9dd..3b18642 100644 --- a/Sources/OpenRenderBoxCxx/Color/ORBColor.cpp +++ b/Sources/OpenRenderBoxCxx/Color/ORBColor.cpp @@ -3,7 +3,7 @@ // OpenRenderBox #include -#include +#include "ColorSpace.hpp" #include using namespace ORB; diff --git a/Sources/OpenRenderBoxCxx/Color/ORBColor.h b/Sources/OpenRenderBoxCxx/Color/ORBColor.h new file mode 100644 index 0000000..095bc06 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Color/ORBColor.h @@ -0,0 +1,52 @@ +// +// ORBColor.h +// OpenRenderBox + +#pragma once + +#include +#include +#if ORB_TARGET_OS_DARWIN +#include +#endif + +ORB_ASSUME_NONNULL_BEGIN + +ORB_EXTERN_C_BEGIN + +typedef float ORBColorComponent; + +typedef struct ORBColor { + ORBColorComponent red; + ORBColorComponent green; + ORBColorComponent blue; + ORBColorComponent alpha; +} ORBColor; + +ORB_EXPORT const ORBColor ORBColorClear ORB_SWIFT_NAME(ORBColor.clear); +ORB_EXPORT const ORBColor ORBColorBlack ORB_SWIFT_NAME(ORBColor.black); +ORB_EXPORT const ORBColor ORBColorWhite ORB_SWIFT_NAME(ORBColor.white); +ORB_EXPORT const ORBColor ORBColorNull ORB_SWIFT_NAME(ORBColor.null); +ORB_EXPORT const ORBColorComponent ORBColorInvalidComponent ORB_SWIFT_NAME(ORBColor.invalidComponent); + +ORB_EXPORT ORBColor ORBColorMake(float red, float green, float blue, float alpha) ORB_SWIFT_NAME(ORBColor.init(red:green:blue:alpha:)); +ORB_EXPORT ORBColor ORBColorMakeLinear(float red, float green, float blue, float alpha) ORB_SWIFT_NAME(ORBColor.init(linearRed:green:blue:alpha:)); +ORB_EXPORT ORBColor ORBColorToLinear(ORBColor color) ORB_SWIFT_NAME(getter:ORBColor.linear(self:)); +ORB_EXPORT ORBColor ORBColorFromLinear(ORBColor color) ORB_SWIFT_NAME(ORBColor.fromLinear(self:)); +ORB_EXPORT bool ORBColorEqualToColor(ORBColor lhs, ORBColor rhs) ORB_SWIFT_NAME(ORBColor.isEqual(self:to:)); + +#if ORB_TARGET_OS_DARWIN + +// TODO: Verify the interface +ORB_EXPORT ORBColor ORBColorFromComponents(CGColorSpaceRef colorSpace, const CGFloat *components, bool premultiplied) ORB_SWIFT_NAME(ORBColor.init(colorSpace:components:premultiplied:)); +ORB_EXPORT ORBColor ORBColorFromComponents2(CGColorSpaceRef colorSpace, const CGFloat *components, size_t componentCount) ORB_SWIFT_NAME(ORBColor.init(colorSpace:components:componentCount:)); +ORB_EXPORT ORBColor ORBColorFromCGColor(CGColorRef color, bool premultiplied) ORB_SWIFT_NAME(ORBColor.init(_:premultiplied:)); +ORB_EXPORT ORBColor ORBColorFromCGColor2(CGColorRef color, size_t componentCount) ORB_SWIFT_NAME(ORBColor.init(_:componentCount:)); + +ORB_EXPORT CGColorRef _Nullable ORBColorCopyCGColor(ORBColor color, ORBColorSpace orbColorSpace) CF_RETURNS_RETAINED ORB_SWIFT_NAME(ORBColor.cgColor(self:colorSpace:)); + +#endif /* ORB_TARGET_OS_DARWIN */ + +ORB_EXTERN_C_END + +ORB_ASSUME_NONNULL_END diff --git a/Sources/OpenRenderBoxCxx/Color/ORBColorMode.h b/Sources/OpenRenderBoxCxx/Color/ORBColorMode.h new file mode 100644 index 0000000..2ead50c --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Color/ORBColorMode.h @@ -0,0 +1,21 @@ +// +// ORBColorMode.h +// OpenRenderBox + +#pragma once + +#include +#include + +ORB_ASSUME_NONNULL_BEGIN + +ORB_EXTERN_C_BEGIN + +typedef int32_t ORBColorMode ORB_SWIFT_STRUCT ORB_SWIFT_NAME(ORBColor.Mode); + +ORB_EXPORT ORBColorSpace ORBColorModeWorkingColorSpace(ORBColorMode mode) ORB_SWIFT_NAME(getter:ORBColorMode.workingColorSpace(self:)); +ORB_EXPORT bool ORBColorModeHasExtendedRange(ORBColorMode mode) ORB_SWIFT_NAME(getter:ORBColorMode.hasExtendedRange(self:)); + +ORB_EXTERN_C_END + +ORB_ASSUME_NONNULL_END diff --git a/Sources/OpenRenderBoxCxx/Color/ORBColorSpace.h b/Sources/OpenRenderBoxCxx/Color/ORBColorSpace.h new file mode 100644 index 0000000..3715520 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Color/ORBColorSpace.h @@ -0,0 +1,23 @@ +// +// ORBColorSpace.h +// OpenRenderBox + +#pragma once + +#include + +ORB_ASSUME_NONNULL_BEGIN + +ORB_EXTERN_C_BEGIN + +typedef ORB_ENUM(uint32_t, ORBColorSpace) { + ORBColorSpaceDefault = 0, + ORBColorSpaceSRGB = 1, + ORBColorSpaceLinearSRGB = 2, + ORBColorSpaceDisplayP3 = 3, + ORBColorSpaceLinearDisplayP3 = 4, +} ORB_SWIFT_NAME(ORBColor.ColorSpace); + +ORB_EXTERN_C_END + +ORB_ASSUME_NONNULL_END diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Device/ORBDevice.h b/Sources/OpenRenderBoxCxx/Device/ORBDevice.h similarity index 97% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Device/ORBDevice.h rename to Sources/OpenRenderBoxCxx/Device/ORBDevice.h index 26ec47c..abfffa5 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Device/ORBDevice.h +++ b/Sources/OpenRenderBoxCxx/Device/ORBDevice.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include @protocol MTLCaptureScope, MTLDevice, OS_dispatch_queue; diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Device/ORBDevice.hpp b/Sources/OpenRenderBoxCxx/Device/ORBDevice.hpp similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Device/ORBDevice.hpp rename to Sources/OpenRenderBoxCxx/Device/ORBDevice.hpp diff --git a/Sources/OpenRenderBoxCxx/Device/ORBDevice.mm b/Sources/OpenRenderBoxCxx/Device/ORBDevice.mm index d6759c7..c6cb814 100644 --- a/Sources/OpenRenderBoxCxx/Device/ORBDevice.mm +++ b/Sources/OpenRenderBoxCxx/Device/ORBDevice.mm @@ -2,7 +2,7 @@ // ORBDevice.mm // OpenRenderBox -#include +#include #if ORB_OBJC_FOUNDATION diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBDecodable.h b/Sources/OpenRenderBoxCxx/Encoding/ORBDecodable.h similarity index 89% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBDecodable.h rename to Sources/OpenRenderBoxCxx/Encoding/ORBDecodable.h index 2b7f76d..4f71311 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBDecodable.h +++ b/Sources/OpenRenderBoxCxx/Encoding/ORBDecodable.h @@ -11,7 +11,7 @@ #if ORB_OBJC_FOUNDATION -#include +#include #include ORB_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBDecoderDelegate.h b/Sources/OpenRenderBoxCxx/Encoding/ORBDecoderDelegate.h similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBDecoderDelegate.h rename to Sources/OpenRenderBoxCxx/Encoding/ORBDecoderDelegate.h diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBEncodable.h b/Sources/OpenRenderBoxCxx/Encoding/ORBEncodable.h similarity index 88% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBEncodable.h rename to Sources/OpenRenderBoxCxx/Encoding/ORBEncodable.h index 11d837a..d8f5ca2 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBEncodable.h +++ b/Sources/OpenRenderBoxCxx/Encoding/ORBEncodable.h @@ -11,7 +11,7 @@ #if ORB_OBJC_FOUNDATION -#include +#include #include ORB_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBEncoderDelegate.h b/Sources/OpenRenderBoxCxx/Encoding/ORBEncoderDelegate.h similarity index 95% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBEncoderDelegate.h rename to Sources/OpenRenderBoxCxx/Encoding/ORBEncoderDelegate.h index 39eef2c..70df8f9 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBEncoderDelegate.h +++ b/Sources/OpenRenderBoxCxx/Encoding/ORBEncoderDelegate.h @@ -11,7 +11,7 @@ #if ORB_OBJC_FOUNDATION -#include +#include #include #include diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBEncoderSet.h b/Sources/OpenRenderBoxCxx/Encoding/ORBEncoderSet.h similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Encoding/ORBEncoderSet.h rename to Sources/OpenRenderBoxCxx/Encoding/ORBEncoderSet.h diff --git a/Sources/OpenRenderBoxCxx/Encoding/ORBEncoderSet.m b/Sources/OpenRenderBoxCxx/Encoding/ORBEncoderSet.m index 43ab5bb..a75d49b 100644 --- a/Sources/OpenRenderBoxCxx/Encoding/ORBEncoderSet.m +++ b/Sources/OpenRenderBoxCxx/Encoding/ORBEncoderSet.m @@ -2,7 +2,7 @@ // ORBEncoderSet.m // OpenRenderBox -#include +#include #if ORB_OBJC_FOUNDATION diff --git a/Sources/OpenRenderBoxCxx/OpenRenderBox.h b/Sources/OpenRenderBoxCxx/OpenRenderBox.h new file mode 100644 index 0000000..ad56eb4 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/OpenRenderBox.h @@ -0,0 +1,20 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ORB_EXPORT double OpenRenderBoxVersionNumber; +ORB_EXPORT const unsigned char OpenRenderBoxVersionString[]; diff --git a/Sources/OpenRenderBoxCxx/Path/NestedCallbacks.cpp b/Sources/OpenRenderBoxCxx/Path/NestedCallbacks.cpp index 7fe6be6..f1a0597 100644 --- a/Sources/OpenRenderBoxCxx/Path/NestedCallbacks.cpp +++ b/Sources/OpenRenderBoxCxx/Path/NestedCallbacks.cpp @@ -6,12 +6,12 @@ #if OPENRENDERBOX_CF_CGTYPES -#include +#include "NestedCallbacks.hpp" #include #if ORB_TARGET_OS_DARWIN #include #endif -#include +#include namespace ORB { namespace Path { diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Path/NestedCallbacks.hpp b/Sources/OpenRenderBoxCxx/Path/NestedCallbacks.hpp similarity index 99% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Path/NestedCallbacks.hpp rename to Sources/OpenRenderBoxCxx/Path/NestedCallbacks.hpp index acc6611..f27a6a4 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Path/NestedCallbacks.hpp +++ b/Sources/OpenRenderBoxCxx/Path/NestedCallbacks.hpp @@ -4,9 +4,10 @@ #pragma once +#include + #if OPENRENDERBOX_CF_CGTYPES -#include #include ORB_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenRenderBoxCxx/Path/ORBPath.cpp b/Sources/OpenRenderBoxCxx/Path/ORBPath.cpp index b7e041b..30a3449 100644 --- a/Sources/OpenRenderBoxCxx/Path/ORBPath.cpp +++ b/Sources/OpenRenderBoxCxx/Path/ORBPath.cpp @@ -9,8 +9,8 @@ #include #include -#include -#include +#include "Storage.hpp" +#include // Empty path callbacks (all null) - C++ internal linkage static const ORBPathCallbacks empty_path_callbacks = { diff --git a/Sources/OpenRenderBoxCxx/Path/ORBPath.h b/Sources/OpenRenderBoxCxx/Path/ORBPath.h new file mode 100644 index 0000000..85269e3 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Path/ORBPath.h @@ -0,0 +1,131 @@ +// +// ORBPath.h +// OpenRenderBox + +#pragma once + +#include + +#if OPENRENDERBOX_CF_CGTYPES + +#if ORB_TARGET_OS_DARWIN +#include +#endif + +ORB_ASSUME_NONNULL_BEGIN + +ORB_EXTERN_C_BEGIN + +/// Path element type for path enumeration +typedef ORB_ENUM(int32_t, ORBPathElement) { + ORBPathElementMoveToPoint = 0, + ORBPathElementAddLineToPoint = 1, + ORBPathElementAddQuadCurveToPoint = 2, + ORBPathElementAddCurveToPoint = 3, + ORBPathElementCloseSubpath = 4, + ORBPathElementRect = 5, + ORBPathElementRoundedRect = 6, + ORBPathElementFixedRoundedRectCircular = 8, + ORBPathElementFixedRoundedRectContinuous = 9, + + ORBPathElementInvalid = 25, +} ORB_SWIFT_NAME(ORBPath.Element); + +/// Defines the shape of a rounded rectangle's corners. +typedef ORB_ENUM(int32_t, ORBPathRoundedCornerStyle) { + /// Quarter-circle rounded rect corners. + ORBPathRoundedCornerStyleCircular = 0, + /// Continuous curvature rounded rect corners. + ORBPathRoundedCornerStyleContinuous = 1, +} ORB_SWIFT_NAME(ORBPath.RoundedCornerStyle); + +/// Callback type for path element enumeration +/// Returns true to stop enumeration, false to continue +typedef bool (*ORBPathApplyCallback)(void * info, ORBPathElement element, const CGFloat *points, const void * _Nullable userInfo); + +typedef struct ORBPathCallbacks ORBPathCallbacks ORB_SWIFT_NAME(ORBPath.ApplyCallback); + +typedef struct ORBPathStorage * ORBPathStorageRef ORB_SWIFT_STRUCT ORB_SWIFT_NAME(ORBPath.Storage); + +typedef struct ORBPath { + ORBPathStorageRef storage; + const ORBPathCallbacks * callbacks; +} ORBPath; + +/// Global empty path (storage = null, callbacks = &ORBPathEmptyCallbacks) +ORB_EXPORT +const ORBPath ORBPathEmpty ORB_SWIFT_NAME(ORBPath.empty); + +/// Global null path (storage = 0x1, callbacks = &ORBPathEmptyCallbacks) +ORB_EXPORT +const ORBPath ORBPathNull ORB_SWIFT_NAME(ORBPath.null); + +ORB_EXPORT +void ORBPathRetain(ORBPath path) ORB_SWIFT_NAME(ORBPath.retain(self:)); + +ORB_EXPORT +void ORBPathRelease(ORBPath path) ORB_SWIFT_NAME(ORBPath.release(self:)); + +// MARK: - Path Creation + +#if ORB_TARGET_OS_DARWIN +ORB_EXPORT +ORBPath ORBPathMakeWithCGPath(CGPathRef cgPath) ORB_SWIFT_NAME(ORBPath.init(cgPath:)); + +ORB_EXPORT +ORBPath ORBPathMakeRect(CGRect rect, const CGAffineTransform * _Nullable transform) ORB_SWIFT_NAME(ORBPath.init(rect:transform:)); + +ORB_EXPORT +ORBPath ORBPathMakeEllipse(CGRect rect, const CGAffineTransform * _Nullable transform) ORB_SWIFT_NAME(ORBPath.init(ellipseIn:transform:)); + +ORB_EXPORT +ORBPath ORBPathMakeRoundedRect(CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight, ORBPathRoundedCornerStyle style, const CGAffineTransform * _Nullable transform) ORB_SWIFT_NAME(ORBPath.init(roundedRect:cornerWidth:cornerHeight:style:transform:)); + +ORB_EXPORT +ORBPath ORBPathMakeUnevenRoundedRect(CGRect rect, CGFloat topLeftRadius, CGFloat bottomLeftRadius, CGFloat bottomRightRadius, CGFloat topRightRadius, ORBPathRoundedCornerStyle style, const CGAffineTransform * _Nullable transform) ORB_SWIFT_NAME(ORBPath.init(roundedRect:topLeftRadius:bottomLeftRadius:bottomRightRadius:topRightRadius:style:transform:)); +#endif + +#if ORB_TARGET_OS_DARWIN +// MARK: - Path Transformation + +ORB_EXPORT +ORBPath ORBPathCopyTransformedPath(ORBPath path, const CGAffineTransform *transform) ORB_SWIFT_NAME(ORBPath.copy(self:transform:)); + +static ORB_INLINE bool ORBPathIsNull(ORBPath path) ORB_SWIFT_NAME(getter:ORBPath.isNull(self:)) { + return path.storage == ORBPathNull.storage && path.callbacks == ORBPathNull.callbacks; +} + +#endif + +// MARK: - Path Operation + +ORB_EXPORT +bool ORBPathIsEmpty(ORBPath path) ORB_SWIFT_NAME(getter:ORBPath.isEmpty(self:)); + +ORB_EXPORT +bool ORBPathApplyElements(ORBPath path, void * info, _Nullable ORBPathApplyCallback callback) ORB_SWIFT_NAME(ORBPath.apply(self:info:callback:)); + +ORB_EXPORT +bool ORBPathEqualToPath(ORBPath lhs, ORBPath rhs) ORB_SWIFT_NAME(ORBPath.isEqual(self:to:)); + +// MARK: - CGPath Interoperability + +#if ORB_TARGET_OS_DARWIN +ORB_EXPORT +CGPathRef ORBPathCopyCGPath(ORBPath path) ORB_SWIFT_NAME(getter:ORBPath.cgPath(self:)); +#endif + +// MARK: - Point Containment +#if ORB_TARGET_OS_DARWIN +ORB_EXPORT +bool ORBPathContainsPoint(ORBPath path, CGPoint point, bool eoFill) ORB_SWIFT_NAME(ORBPath.contains(self:point:eoFill:)); + +ORB_EXPORT +bool ORBPathContainsPoints(ORBPath path, uint64_t count, const CGPoint *points, bool eoFill, const CGAffineTransform * _Nullable transform) ORB_SWIFT_NAME(ORBPath.containsPoints(self:count:points:eoFill:transform:)); +#endif + +ORB_EXTERN_C_END + +ORB_ASSUME_NONNULL_END + +#endif /* OPENRENDERBOX_CF_CGTYPES */ diff --git a/Sources/OpenRenderBoxCxx/Path/ORBPathCallbacks.cpp b/Sources/OpenRenderBoxCxx/Path/ORBPathCallbacks.cpp index 0c091d1..360b503 100644 --- a/Sources/OpenRenderBoxCxx/Path/ORBPathCallbacks.cpp +++ b/Sources/OpenRenderBoxCxx/Path/ORBPathCallbacks.cpp @@ -8,7 +8,7 @@ #if OPENRENDERBOX_CF_CGTYPES #include -#include +#include #if ORB_TARGET_OS_DARWIN diff --git a/Sources/OpenRenderBoxCxx/Path/ORBPathCallbacks.h b/Sources/OpenRenderBoxCxx/Path/ORBPathCallbacks.h new file mode 100644 index 0000000..63efd77 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Path/ORBPathCallbacks.h @@ -0,0 +1,113 @@ +// +// ORBPathCallbacks.h +// OpenRenderBox +// +// Audited for 6.5.1 +// Status: Complete + +#pragma once + +#include + +#if OPENRENDERBOX_CF_CGTYPES + +#include +#include +#if ORB_TARGET_OS_DARWIN +#include +#endif + +ORB_ASSUME_NONNULL_BEGIN + +ORB_EXTERN_C_BEGIN + +/// Flags for path callbacks +typedef struct ORB_SWIFT_NAME(ORBPath.CallbacksFlags) ORBPathCallbacksFlags { + uint8_t unknown0; + uint8_t unknown1; + bool isExtended; + uint8_t padding[5]; +} ORBPathCallbacksFlags; + +/// Callbacks structure for path operations +/// This allows different path storage types (CGPath, custom storage, etc.) to provide their own implementations +typedef struct ORB_SWIFT_NAME(ORBPath.Callbacks) ORBPathCallbacks { + ORBPathCallbacksFlags flags; + const void * _Nonnull (* _Nullable retain)(const void *object); + void (* _Nullable release)(const void *object); + bool (* _Nullable apply)(const void *object, void * info, ORBPathApplyCallback _Nullable callback); + bool (* _Nullable isEqual)(const void *object, const void *otherObject); + bool (* _Nullable isEmpty)(const void *object); + bool (* _Nullable isSingleElement)(const void *object); + uint32_t (* _Nullable bezierOrder)(const void *object); + CGRect (* _Nullable boundingRect)(const void *object); + #if ORB_TARGET_OS_DARWIN + CGPathRef _Nullable (* _Nullable cgPath)(const void *object); + #else + void * _Nullable (* _Nullable cgPath)(const void *object); + #endif + const struct ORBPathCallbacks * _Nullable (* _Nullable next)(const void *object); +} ORBPathCallbacks; + +// static_assert without message requires C23 or C++17 +#if defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) +static_assert(sizeof(struct ORBPathCallbacks) == 0x58); +static_assert(offsetof(struct ORBPathCallbacks, flags) == 0x00); +static_assert(offsetof(struct ORBPathCallbacks, retain) == 0x08); +static_assert(offsetof(struct ORBPathCallbacks, release) == 0x10); +static_assert(offsetof(struct ORBPathCallbacks, apply) == 0x18); +static_assert(offsetof(struct ORBPathCallbacks, isEqual) == 0x20); +static_assert(offsetof(struct ORBPathCallbacks, isEmpty) == 0x28); +static_assert(offsetof(struct ORBPathCallbacks, isSingleElement) == 0x30); +static_assert(offsetof(struct ORBPathCallbacks, bezierOrder) == 0x38); +static_assert(offsetof(struct ORBPathCallbacks, boundingRect) == 0x40); +static_assert(offsetof(struct ORBPathCallbacks, cgPath) == 0x48); +static_assert(offsetof(struct ORBPathCallbacks, next) == 0x50); +#endif + +/// Extended callbacks structure with additional extended callbacks argument +typedef struct ORB_SWIFT_NAME(ORBPath.CallbacksExtended) ORBPathCallbacksExtended { + ORBPathCallbacksFlags flags; + const void * _Nonnull (* _Nullable retain)(const void *object); + void (* _Nullable release)(const void *object); + bool (* _Nullable apply)(const void *object, void * info, ORBPathApplyCallback _Nullable callback, const struct ORBPathCallbacksExtended *extended); + bool (* _Nullable isEqual)(const void *object, const void *otherObject, const struct ORBPathCallbacksExtended *extended); + bool (* _Nullable isEmpty)(const void *object, const struct ORBPathCallbacksExtended *extended); + bool (* _Nullable isSingleElement)(const void *object, const struct ORBPathCallbacksExtended *extended); + uint32_t (* _Nullable bezierOrder)(const void *object, const struct ORBPathCallbacksExtended *extended); + CGRect (* _Nullable boundingRect)(const void *object, const struct ORBPathCallbacksExtended *extended); + #if ORB_TARGET_OS_DARWIN + CGPathRef _Nullable (* _Nullable cgPath)(const void *object, const struct ORBPathCallbacksExtended *extended); + #else + void * _Nullable (* _Nullable cgPath)(const void *object, const struct ORBPathCallbacksExtended *extended); + #endif + const struct ORBPathCallbacksExtended * _Nullable (* _Nullable next)(const void *object, const struct ORBPathCallbacksExtended *extended); +} ORBPathCallbacksExtended; + +// static_assert without message requires C23 or C++17 +#if defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) +static_assert(sizeof(struct ORBPathCallbacksExtended) == 0x58); +static_assert(offsetof(struct ORBPathCallbacksExtended, flags) == 0x00); +static_assert(offsetof(struct ORBPathCallbacksExtended, retain) == 0x08); +static_assert(offsetof(struct ORBPathCallbacksExtended, release) == 0x10); +static_assert(offsetof(struct ORBPathCallbacksExtended, apply) == 0x18); +static_assert(offsetof(struct ORBPathCallbacksExtended, isEqual) == 0x20); +static_assert(offsetof(struct ORBPathCallbacksExtended, isEmpty) == 0x28); +static_assert(offsetof(struct ORBPathCallbacksExtended, isSingleElement) == 0x30); +static_assert(offsetof(struct ORBPathCallbacksExtended, bezierOrder) == 0x38); +static_assert(offsetof(struct ORBPathCallbacksExtended, boundingRect) == 0x40); +static_assert(offsetof(struct ORBPathCallbacksExtended, cgPath) == 0x48); +static_assert(offsetof(struct ORBPathCallbacksExtended, next) == 0x50); +#endif + +#if ORB_TARGET_OS_DARWIN +/// Global callbacks for CGPath-backed paths +ORB_EXPORT +const ORBPathCallbacks ORBPathCGPathCallbacks ORB_SWIFT_NAME(ORBPathCallbacks.cgPath); +#endif + +ORB_EXTERN_C_END + +ORB_ASSUME_NONNULL_END + +#endif /* OPENRENDERBOX_CF_CGTYPES */ diff --git a/Sources/OpenRenderBoxCxx/Path/ORBPathStorage.cpp b/Sources/OpenRenderBoxCxx/Path/ORBPathStorage.cpp index 5f4f699..926a30c 100644 --- a/Sources/OpenRenderBoxCxx/Path/ORBPathStorage.cpp +++ b/Sources/OpenRenderBoxCxx/Path/ORBPathStorage.cpp @@ -5,8 +5,8 @@ #if OPENRENDERBOX_CF_CGTYPES #include -#include -#include +#include "Storage.hpp" +#include using namespace ORB; diff --git a/Sources/OpenRenderBoxCxx/Path/ORBPathStorage.h b/Sources/OpenRenderBoxCxx/Path/ORBPathStorage.h new file mode 100644 index 0000000..0dce577 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Path/ORBPathStorage.h @@ -0,0 +1,66 @@ +// +// ORBPathStorage.h +// OpenRenderBox +// +// Audited for 6.5.1 +// Status: Complete + +#pragma once + +#include + +#if OPENRENDERBOX_CF_CGTYPES + +#include +#if ORB_TARGET_OS_DARWIN +#include +#endif + +ORB_ASSUME_NONNULL_BEGIN + +ORB_EXTERN_C_BEGIN + +ORB_EXPORT +void ORBPathStorageInit(ORBPathStorageRef dst, uint32_t capacity, ORBPathStorageRef _Nullable source) ORB_SWIFT_NAME(ORBPathStorageRef.initialize(self:capacity:source:)); + +ORB_EXPORT +void ORBPathStorageDestroy(ORBPathStorageRef storage) ORB_SWIFT_NAME(ORBPathStorageRef.destroy(self:)); + +ORB_EXPORT +void ORBPathStorageClear(ORBPathStorageRef storage) ORB_SWIFT_NAME(ORBPathStorageRef.clear(self:)); + +ORB_EXPORT +bool ORBPathStorageAppendElement(ORBPathStorageRef storage, ORBPathElement element, CGFloat const * points, const void * _Nullable userInfo) ORB_SWIFT_NAME(ORBPathStorageRef.append(self:element:points:userInfo:)); + +ORB_EXPORT +bool ORBPathStorageAppendPath(ORBPathStorageRef, ORBPath) ORB_SWIFT_NAME(ORBPathStorageRef.append(self:path:)); + +ORB_EXPORT +bool ORBPathStorageApplyElements(ORBPathStorageRef, void *info, ORBPathApplyCallback _Nullable callback) ORB_SWIFT_NAME(ORBPathStorageRef.apply(self:info:callback:)); + +ORB_EXPORT +bool ORBPathStorageIsEmpty(ORBPathStorageRef storage) ORB_SWIFT_NAME(getter:ORBPathStorageRef.isEmpty(self:)); + +ORB_EXPORT +bool ORBPathStorageEqualToStorage(ORBPathStorageRef lhs, ORBPathStorageRef rhs) ORB_SWIFT_NAME(ORBPathStorageRef.isEqual(self:to:)); + +ORB_EXPORT +bool ORBPathStorageIsSingleElement(ORBPathStorageRef storage) ORB_SWIFT_NAME(getter:ORBPathStorageRef.isSingleElement(self:)); + +ORB_EXPORT +uint32_t ORBPathStorageGetBezierOrder(ORBPathStorageRef storage) ORB_SWIFT_NAME(getter:ORBPathStorageRef.bezierOrder(self:)); + +#if ORB_TARGET_OS_DARWIN +ORB_EXPORT +CGRect ORBPathStorageGetBoundingRect(ORBPathStorageRef storage) ORB_SWIFT_NAME(getter:ORBPathStorageRef.boundingRect(self:)); + +ORB_EXPORT +CF_RETURNS_NOT_RETAINED +__nullable CGPathRef ORBPathStorageGetCGPath(ORBPathStorageRef storage) ORB_SWIFT_NAME(getter:ORBPathStorageRef.cgPath(self:)); +#endif + +ORB_EXTERN_C_END + +ORB_ASSUME_NONNULL_END + +#endif /* OPENRENDERBOX_CF_CGTYPES */ diff --git a/Sources/OpenRenderBoxCxx/Path/Storage.cpp b/Sources/OpenRenderBoxCxx/Path/Storage.cpp index 30c6a4e..30ad2ab 100644 --- a/Sources/OpenRenderBoxCxx/Path/Storage.cpp +++ b/Sources/OpenRenderBoxCxx/Path/Storage.cpp @@ -6,8 +6,8 @@ #include #include -#include -#include +#include "Storage.hpp" +#include #if ORB_TARGET_OS_DARWIN #include diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Path/Storage.hpp b/Sources/OpenRenderBoxCxx/Path/Storage.hpp similarity index 99% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Path/Storage.hpp rename to Sources/OpenRenderBoxCxx/Path/Storage.hpp index b9ab8f2..265d4c3 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Path/Storage.hpp +++ b/Sources/OpenRenderBoxCxx/Path/Storage.hpp @@ -4,11 +4,12 @@ #pragma once +#include + #if OPENRENDERBOX_CF_CGTYPES -#include #include -#include +#include "../Util/assert.hpp" #include #if ORB_TARGET_OS_DARWIN #include diff --git a/Sources/OpenRenderBoxCxx/Render/ORBBlendMode.h b/Sources/OpenRenderBoxCxx/Render/ORBBlendMode.h new file mode 100644 index 0000000..5222d89 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Render/ORBBlendMode.h @@ -0,0 +1,61 @@ +// +// ORBBlendMode.h +// OpenRenderBox + +#pragma once + +#include + +ORB_ASSUME_NONNULL_BEGIN + +ORB_EXTERN_C_BEGIN + +typedef enum ORBBlendMode : int32_t { + ORBBlendModeNormal = 0, + ORBBlendModeMultiply = 1, + ORBBlendModeScreen = 2, + ORBBlendModeOverlay = 3, + ORBBlendModeDarken = 4, + ORBBlendModeLighten = 5, + ORBBlendModeColorDodge = 6, + ORBBlendModeColorBurn = 7, + ORBBlendModeSoftLight = 8, + ORBBlendModeHardLight = 9, + ORBBlendModeDifference = 10, + ORBBlendModeExclusion = 11, + ORBBlendModeHue = 12, + ORBBlendModeSaturation = 13, + ORBBlendModeColor = 14, + ORBBlendModeLuminosity = 15, + ORBBlendModeClear = 16, + ORBBlendModeCopy = 17, + ORBBlendModeSourceIn = 18, + ORBBlendModeSourceOut = 19, + ORBBlendModeSourceAtop = 20, + ORBBlendModeDestinationOver = 21, + ORBBlendModeDestinationIn = 22, + ORBBlendModeDestinationOut = 23, + ORBBlendModeDestinationAtop = 24, + ORBBlendModeXOR = 25, + ORBBlendModePlusDarker = 26, + ORBBlendModePlusLighter = 27, + ORBBlendModeLinearDodge = 1000, + ORBBlendModeLinearBurn = 1001, + ORBBlendModeLinearLight = 1002, + ORBBlendModePinLight = 1003, + ORBBlendModeSubtract = 1004, + ORBBlendModeDivide = 1005, + ORBBlendModeMaximum = 1006, + ORBBlendModeAdd = 1007, + ORBBlendModeSubtractSource = 1008, + ORBBlendModeSubtractDestination = 1009, + ORBBlendModeDarkenSourceOver = 1010, + ORBBlendModeLightenSourceOver = 1011, + ORBBlendModeMinimum = 1012, + ORBBlendModeMinimumInverse = 1013, + ORBBlendModePassThrough = 2000, +} ORBBlendMode; + +ORB_EXTERN_C_END + +ORB_ASSUME_NONNULL_END diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayList.h b/Sources/OpenRenderBoxCxx/Render/ORBDisplayList.h similarity index 99% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayList.h rename to Sources/OpenRenderBoxCxx/Render/ORBDisplayList.h index 2fdc53b..e5d7572 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayList.h +++ b/Sources/OpenRenderBoxCxx/Render/ORBDisplayList.h @@ -8,7 +8,7 @@ #if ORB_OBJC_FOUNDATION -#include +#include #include #include #include diff --git a/Sources/OpenRenderBoxCxx/Render/ORBDisplayList.m b/Sources/OpenRenderBoxCxx/Render/ORBDisplayList.m index bd48800..5d25209 100644 --- a/Sources/OpenRenderBoxCxx/Render/ORBDisplayList.m +++ b/Sources/OpenRenderBoxCxx/Render/ORBDisplayList.m @@ -2,8 +2,8 @@ // ORBDisplayList.m // OpenRenderBox -#include -#include +#include +#include #if ORB_OBJC_FOUNDATION diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListContents.h b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListContents.h similarity index 90% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListContents.h rename to Sources/OpenRenderBoxCxx/Render/ORBDisplayListContents.h index 1003d14..22725b0 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListContents.h +++ b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListContents.h @@ -11,8 +11,8 @@ #if ORB_OBJC_FOUNDATION -#include -#include +#include +#include #include #include diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListInterpolator.h b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListInterpolator.h similarity index 95% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListInterpolator.h rename to Sources/OpenRenderBoxCxx/Render/ORBDisplayListInterpolator.h index 47bf8c6..d229499 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListInterpolator.h +++ b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListInterpolator.h @@ -8,7 +8,7 @@ #if ORB_OBJC_FOUNDATION -#include +#include #include #include diff --git a/Sources/OpenRenderBoxCxx/Render/ORBDisplayListInterpolator.m b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListInterpolator.m index c3a2e31..e24fd26 100644 --- a/Sources/OpenRenderBoxCxx/Render/ORBDisplayListInterpolator.m +++ b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListInterpolator.m @@ -2,7 +2,7 @@ // ORBDisplayListInterpolator.m // OpenRenderBox -#include +#include #if ORB_OBJC_FOUNDATION diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListPredicate.h b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListPredicate.h similarity index 90% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListPredicate.h rename to Sources/OpenRenderBoxCxx/Render/ORBDisplayListPredicate.h index 5bd3b22..32c7b35 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListPredicate.h +++ b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListPredicate.h @@ -9,7 +9,7 @@ #if ORB_OBJC_FOUNDATION #include -#include +#include #include ORB_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenRenderBoxCxx/Render/ORBDisplayListPredicate.m b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListPredicate.m index ec7b238..465179a 100644 --- a/Sources/OpenRenderBoxCxx/Render/ORBDisplayListPredicate.m +++ b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListPredicate.m @@ -2,7 +2,7 @@ // ORBDisplayListPredicate.m // OpenRenderBox -#include +#include #if ORB_OBJC_FOUNDATION diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListTransform.h b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListTransform.h similarity index 90% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListTransform.h rename to Sources/OpenRenderBoxCxx/Render/ORBDisplayListTransform.h index 948a93e..10aafdb 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDisplayListTransform.h +++ b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListTransform.h @@ -9,7 +9,7 @@ #if ORB_OBJC_FOUNDATION #include -#include +#include #include ORB_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenRenderBoxCxx/Render/ORBDisplayListTransform.m b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListTransform.m index cb5012a..5d9f4b0 100644 --- a/Sources/OpenRenderBoxCxx/Render/ORBDisplayListTransform.m +++ b/Sources/OpenRenderBoxCxx/Render/ORBDisplayListTransform.m @@ -2,7 +2,7 @@ // ORBDisplayListTransform.m // OpenRenderBox -#include +#include #if ORB_OBJC_FOUNDATION diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDrawableStatistics.h b/Sources/OpenRenderBoxCxx/Render/ORBDrawableStatistics.h similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBDrawableStatistics.h rename to Sources/OpenRenderBoxCxx/Render/ORBDrawableStatistics.h diff --git a/Sources/OpenRenderBoxCxx/Render/ORBDrawingState.h b/Sources/OpenRenderBoxCxx/Render/ORBDrawingState.h new file mode 100644 index 0000000..5626dea --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Render/ORBDrawingState.h @@ -0,0 +1,13 @@ +// +// ORBDrawingState.h +// OpenRenderBox + +#pragma once + +#include + +ORB_ASSUME_NONNULL_BEGIN + +typedef struct _ORBDrawingState *ORBDrawingState ORB_SWIFT_STRUCT; + +ORB_ASSUME_NONNULL_END diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBImageRenderer.h b/Sources/OpenRenderBoxCxx/Render/ORBImageRenderer.h similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBImageRenderer.h rename to Sources/OpenRenderBoxCxx/Render/ORBImageRenderer.h diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBLayer.h b/Sources/OpenRenderBoxCxx/Render/ORBLayer.h similarity index 92% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBLayer.h rename to Sources/OpenRenderBoxCxx/Render/ORBLayer.h index a33ba69..8dd6af4 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBLayer.h +++ b/Sources/OpenRenderBoxCxx/Render/ORBLayer.h @@ -4,16 +4,16 @@ #pragma once -#include "OpenRenderBox/ORBColorMode.h" +#include #include #if ORB_OBJC_FOUNDATION #include #include -#include -#include -#include +#include +#include +#include //#include "RBImageQueueLayer.h" //#include "RBSurfaceContentsLayer.h" diff --git a/Sources/OpenRenderBoxCxx/Render/ORBLayer.m b/Sources/OpenRenderBoxCxx/Render/ORBLayer.m index ef80da7..340374f 100644 --- a/Sources/OpenRenderBoxCxx/Render/ORBLayer.m +++ b/Sources/OpenRenderBoxCxx/Render/ORBLayer.m @@ -2,7 +2,7 @@ // ORBLayer.m // OpenRenderBox -#include +#include #if ORB_OBJC_FOUNDATION diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBLayerDelegate.h b/Sources/OpenRenderBoxCxx/Render/ORBLayerDelegate.h similarity index 83% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBLayerDelegate.h rename to Sources/OpenRenderBoxCxx/Render/ORBLayerDelegate.h index ce69846..202b9e2 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/ORBLayerDelegate.h +++ b/Sources/OpenRenderBoxCxx/Render/ORBLayerDelegate.h @@ -8,8 +8,8 @@ #if ORB_OBJC_FOUNDATION -#include -#include +#include +#include #include #include diff --git a/Sources/OpenRenderBoxCxx/Render/ORBSymbolRenderingMode.h b/Sources/OpenRenderBoxCxx/Render/ORBSymbolRenderingMode.h new file mode 100644 index 0000000..9b7d7f7 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Render/ORBSymbolRenderingMode.h @@ -0,0 +1,20 @@ +// +// ORBSymbolRenderingMode.h +// OpenRenderBox + +#pragma once + +#include + +typedef ORB_ENUM(uint32_t, ORBSymbolRenderingMode) { + ORBSymbolRenderingModePreferred = 0, + ORBSymbolRenderingModeMonochrome = 1, + ORBSymbolRenderingModeMulticolor = 2, + ORBSymbolRenderingModeHierarchical = 3, + ORBSymbolRenderingModePalette = 4, + ORBSymbolRenderingModeHierarchicalUnlessSlashed = 128, + ORBSymbolRenderingModeHierarchicalSlashBadge = 129, + ORBSymbolRenderingModePaletteSlashBadge = 130, + // No explicit mode. A symbol update keeps the animator's current mode. + ORBSymbolRenderingModeUnspecified = 255, +}; diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/Private/_ORBDisplayListContents.h b/Sources/OpenRenderBoxCxx/Render/Private/_ORBDisplayListContents.h similarity index 90% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/Private/_ORBDisplayListContents.h rename to Sources/OpenRenderBoxCxx/Render/Private/_ORBDisplayListContents.h index 211afa7..5ea2864 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/Private/_ORBDisplayListContents.h +++ b/Sources/OpenRenderBoxCxx/Render/Private/_ORBDisplayListContents.h @@ -11,7 +11,7 @@ #if ORB_OBJC_FOUNDATION -#include +#include #include ORB_ASSUME_NONNULL_BEGIN diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/Private/_ORBDrawableDelegate.h b/Sources/OpenRenderBoxCxx/Render/Private/_ORBDrawableDelegate.h similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Render/Private/_ORBDrawableDelegate.h rename to Sources/OpenRenderBoxCxx/Render/Private/_ORBDrawableDelegate.h diff --git a/Sources/OpenRenderBoxCxx/UUID/ORBUUID.h b/Sources/OpenRenderBoxCxx/UUID/ORBUUID.h new file mode 100644 index 0000000..ea386d6 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/UUID/ORBUUID.h @@ -0,0 +1,27 @@ +// +// ORBUUID.hpp +// OpenRenderBox + +#pragma once + +#include + +#if ORB_TARGET_OS_DARWIN && __OBJC__ +#include +#endif + +typedef struct ORBUUID { + uint8_t bytes[16]; +} ORBUUID; + +ORB_EXTERN_C_BEGIN + +#if ORB_TARGET_OS_DARWIN && __OBJC__ +ORB_EXPORT +ORBUUID ORBUUIDInitFromNSUUID(NSUUID *uuid) ORB_SWIFT_NAME(ORBUUID.init(uuid:)); +#endif + +ORB_EXPORT +ORBUUID ORBUUIDInitFromHash(uint64_t words0, uint64_t words1, uint32_t words2) ORB_SWIFT_NAME(ORBUUID.init(_:_:_:)); + +ORB_EXTERN_C_END diff --git a/Sources/OpenRenderBoxCxx/Util/assert.cpp b/Sources/OpenRenderBoxCxx/Util/assert.cpp index fbc20a9..f22544a 100644 --- a/Sources/OpenRenderBoxCxx/Util/assert.cpp +++ b/Sources/OpenRenderBoxCxx/Util/assert.cpp @@ -2,8 +2,8 @@ // assert.cpp // OpenRenderBox -#include -#include +#include "assert.hpp" +#include "log.hpp" static char* error_message = nullptr; diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Util/assert.hpp b/Sources/OpenRenderBoxCxx/Util/assert.hpp similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Util/assert.hpp rename to Sources/OpenRenderBoxCxx/Util/assert.hpp diff --git a/Sources/OpenRenderBoxCxx/Util/log.cpp b/Sources/OpenRenderBoxCxx/Util/log.cpp index ba6c674..962399a 100644 --- a/Sources/OpenRenderBoxCxx/Util/log.cpp +++ b/Sources/OpenRenderBoxCxx/Util/log.cpp @@ -2,7 +2,7 @@ // log.cpp // OpenRenderBox -#include +#include "log.hpp" #if ORB_TARGET_OS_DARWIN diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Util/log.hpp b/Sources/OpenRenderBoxCxx/Util/log.hpp similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Util/log.hpp rename to Sources/OpenRenderBoxCxx/Util/log.hpp diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Util/refcounted_ptr.hpp b/Sources/OpenRenderBoxCxx/Util/refcounted_ptr.hpp similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Util/refcounted_ptr.hpp rename to Sources/OpenRenderBoxCxx/Util/refcounted_ptr.hpp diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Vector/realloc_vector.hpp b/Sources/OpenRenderBoxCxx/Vector/realloc_vector.hpp similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Vector/realloc_vector.hpp rename to Sources/OpenRenderBoxCxx/Vector/realloc_vector.hpp diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Vector/vector.hpp b/Sources/OpenRenderBoxCxx/Vector/vector.hpp similarity index 100% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Vector/vector.hpp rename to Sources/OpenRenderBoxCxx/Vector/vector.hpp diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Vector/vector.tpp b/Sources/OpenRenderBoxCxx/Vector/vector.tpp similarity index 99% rename from Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Vector/vector.tpp rename to Sources/OpenRenderBoxCxx/Vector/vector.tpp index 0d989de..2e8dd7f 100644 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxCxx/Vector/vector.tpp +++ b/Sources/OpenRenderBoxCxx/Vector/vector.tpp @@ -5,8 +5,8 @@ // Status: Complete // Modified based Compute code -#include -#include +#include "vector.hpp" +#include "../Util/assert.hpp" #include #if ORB_TARGET_OS_DARWIN diff --git a/Sources/OpenRenderBoxCxx/Version/ORBVersion.h b/Sources/OpenRenderBoxCxx/Version/ORBVersion.h new file mode 100644 index 0000000..8c68275 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/Version/ORBVersion.h @@ -0,0 +1,13 @@ +// +// ORBVersion.h +// OpenRenderBox + +#pragma once + +#include + +#define ORB_RELEASE_2024 2024 + +#ifndef ORB_TARGET_RELEASE +#define ORB_TARGET_RELEASE 2024 +#endif diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/CFCGTypes.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/CFCGTypes.h deleted file mode 100644 index 84705fb..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/CFCGTypes.h +++ /dev/null @@ -1,128 +0,0 @@ -#if OPENRENDERBOX_CF_CGTYPES - -/* CFCGTypes.h - Copyright (c) 1998-2021, Apple Inc. and the Swift project authors - - Portions Copyright (c) 2014-2021, Apple Inc. and the Swift project authors - Licensed under Apache License v2.0 with Runtime Library Exception - See http://swift.org/LICENSE.txt for license information - See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors -*/ - -#if !defined(__COREFOUNDATION_CFCGTYPES__) -#define __COREFOUNDATION_CFCGTYPES__ 1 - -#include -#include -#include -#include - -#define CF_DEFINES_CG_TYPES - -#if defined(__has_attribute) && __has_attribute(objc_boxable) -# define CF_BOXABLE __attribute__((objc_boxable)) -#else -# define CF_BOXABLE -#endif - -/* Definition of `CGFLOAT_TYPE', `CGFLOAT_IS_DOUBLE', `CGFLOAT_MIN', and - * `CGFLOAT_MAX'. */ - - #if defined(__LP64__) && __LP64__ - # define CGFLOAT_TYPE double - # define CGFLOAT_IS_DOUBLE 1 - # define CGFLOAT_MIN DBL_MIN - # define CGFLOAT_MAX DBL_MAX - # define CGFLOAT_EPSILON DBL_EPSILON - #else - # define CGFLOAT_TYPE float - # define CGFLOAT_IS_DOUBLE 0 - # define CGFLOAT_MIN FLT_MIN - # define CGFLOAT_MAX FLT_MAX - # define CGFLOAT_EPSILON FLT_EPSILON - #endif - -/* Definition of the `CGFloat' type and `CGFLOAT_DEFINED'. */ - -typedef CGFLOAT_TYPE CGFloat; -#define CGFLOAT_DEFINED 1 - -/* Points. */ -struct -CGPoint { - CGFloat x; - CGFloat y; -}; -typedef struct CF_BOXABLE CGPoint CGPoint; - -/* Sizes. */ - -struct CGSize { - CGFloat width; - CGFloat height; -}; -typedef struct CF_BOXABLE CGSize CGSize; - -/* Vectors. */ - -#define CGVECTOR_DEFINED 1 - -struct CGVector { - CGFloat dx; - CGFloat dy; -}; -typedef struct CF_BOXABLE CGVector CGVector; - -/* Rectangles. */ - -struct CGRect { - CGPoint origin; - CGSize size; -}; -typedef struct CF_BOXABLE CGRect CGRect; - -/* Rectangle edges. */ - -typedef CF_CLOSED_ENUM(uint32_t, CGRectEdge) { - CGRectMinXEdge, CGRectMinYEdge, CGRectMaxXEdge, CGRectMaxYEdge -}; - -typedef struct CGAffineTransform CGAffineTransform; - -struct CGAffineTransform { - CGFloat a, b, c, d; - CGFloat tx, ty; -}; - -#define CF_DEFINES_CGAFFINETRANSFORMCOMPONENTS - -/* |------------------ CGAffineTransformComponents ----------------| - * - * | a b 0 | | sx 0 0 | | 1 0 0 | | cos(t) sin(t) 0 | | 1 0 0 | - * | c d 0 | = | 0 sy 0 | * | sh 1 0 | * |-sin(t) cos(t) 0 | * | 0 1 0 | - * | tx ty 1 | | 0 0 1 | | 0 0 1 | | 0 0 1 | | tx ty 1 | - * CGAffineTransform scale shear rotation translation - */ -typedef struct CGAffineTransformComponents CGAffineTransformComponents - CF_SWIFT_NAME(CGAffineTransform.Components); - -struct CGAffineTransformComponents { - - /* initial scaling in X and Y dimensions. {sx,sy} */ - /* Negative values indicate the image has been flipped in this dimension. */ - CGSize scale; - - /* shear distortion (sh). Turns rectangles to parallelograms. 0 for no shear. Typically 0. */ - CGFloat horizontalShear; - - /* Rotation angle in radians about the origin. (t) Sign convention for clockwise rotation */ - /* may differ between various Apple frameworks based on origin placement. Please see discussion. */ - CGFloat rotation; - - /* Displacement from the origin (ty, ty) */ - CGVector translation; -}; - -#endif /* ! __COREFOUNDATION_CFCGTYPES__ */ - -#endif /* OPENRENDERBOX_CF_CGTYPES */ \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/CFCGTypes.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/CFCGTypes.h new file mode 120000 index 0000000..82f9637 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/CFCGTypes.h @@ -0,0 +1 @@ +../../Base/CFCGTypes.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBAnimation.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBAnimation.h new file mode 120000 index 0000000..63d2138 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBAnimation.h @@ -0,0 +1 @@ +../../Animation/ORBAnimation.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBase.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBase.h deleted file mode 100644 index 5d3236d..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBase.h +++ /dev/null @@ -1,71 +0,0 @@ -// -// ORBBase.h -// OpenRenderBox - -#pragma once - -#if DEBUG -#define ORB_ASSERTION -#else -#undef ORB_ASSERTION -#endif - -#if __has_attribute(cold) -#define __cold __attribute__((__cold__)) -#else -#define __cold -#endif - -#if __has_attribute(noreturn) -#define __dead2 __attribute__((__noreturn__)) -#else -#define __dead2 -#endif - -#if defined(__cplusplus) -#define ORB_NOEXCEPT noexcept -#else -#define ORB_NOEXCEPT -#endif - -#if defined(__GNUC__) -#define ORB_INLINE __inline__ __attribute__((always_inline)) -#elif defined(__cplusplus) -#define ORB_INLINE inline -#else -#define ORB_INLINE -#endif - -#if defined(__cplusplus) -#define ORB_CONSTEXPR constexpr -#else -#define ORB_CONSTEXPR -#endif - -#include -#include -#include -#include "ORBSwiftSupport.h" -#include "ORBTargetConditionals.h" - -#define ORB_ENUM CF_ENUM -#define ORB_CLOSED_ENUM CF_CLOSED_ENUM -#define ORB_OPTIONS CF_OPTIONS -#define ORB_EXTERN_C_BEGIN CF_EXTERN_C_BEGIN -#define ORB_EXTERN_C_END CF_EXTERN_C_END -#define ORB_ASSUME_NONNULL_BEGIN CF_ASSUME_NONNULL_BEGIN -#define ORB_ASSUME_NONNULL_END CF_ASSUME_NONNULL_END -#define ORB_IMPLICIT_BRIDGING_ENABLED CF_IMPLICIT_BRIDGING_ENABLED -#define ORB_IMPLICIT_BRIDGING_DISABLED CF_IMPLICIT_BRIDGING_DISABLED -#define ORB_EXPORT CF_EXPORT -#define ORB_BRIDGED_TYPE CF_BRIDGED_TYPE - -#if ORB_TARGET_OS_DARWIN && __OBJC__ -#define ORB_OBJC_FOUNDATION 1 -#else -#define ORB_OBJC_FOUNDATION 0 -#endif /* TARGET_OS_DARWIN && __OBJC__ */ - -#if !ORB_TRRET_OS_DARWIN -#include "CFCGTypes.h" -#endif diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBase.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBase.h new file mode 120000 index 0000000..87c612b --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBase.h @@ -0,0 +1 @@ +../../Base/ORBBase.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBlendMode.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBlendMode.h deleted file mode 100644 index 5222d89..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBlendMode.h +++ /dev/null @@ -1,61 +0,0 @@ -// -// ORBBlendMode.h -// OpenRenderBox - -#pragma once - -#include - -ORB_ASSUME_NONNULL_BEGIN - -ORB_EXTERN_C_BEGIN - -typedef enum ORBBlendMode : int32_t { - ORBBlendModeNormal = 0, - ORBBlendModeMultiply = 1, - ORBBlendModeScreen = 2, - ORBBlendModeOverlay = 3, - ORBBlendModeDarken = 4, - ORBBlendModeLighten = 5, - ORBBlendModeColorDodge = 6, - ORBBlendModeColorBurn = 7, - ORBBlendModeSoftLight = 8, - ORBBlendModeHardLight = 9, - ORBBlendModeDifference = 10, - ORBBlendModeExclusion = 11, - ORBBlendModeHue = 12, - ORBBlendModeSaturation = 13, - ORBBlendModeColor = 14, - ORBBlendModeLuminosity = 15, - ORBBlendModeClear = 16, - ORBBlendModeCopy = 17, - ORBBlendModeSourceIn = 18, - ORBBlendModeSourceOut = 19, - ORBBlendModeSourceAtop = 20, - ORBBlendModeDestinationOver = 21, - ORBBlendModeDestinationIn = 22, - ORBBlendModeDestinationOut = 23, - ORBBlendModeDestinationAtop = 24, - ORBBlendModeXOR = 25, - ORBBlendModePlusDarker = 26, - ORBBlendModePlusLighter = 27, - ORBBlendModeLinearDodge = 1000, - ORBBlendModeLinearBurn = 1001, - ORBBlendModeLinearLight = 1002, - ORBBlendModePinLight = 1003, - ORBBlendModeSubtract = 1004, - ORBBlendModeDivide = 1005, - ORBBlendModeMaximum = 1006, - ORBBlendModeAdd = 1007, - ORBBlendModeSubtractSource = 1008, - ORBBlendModeSubtractDestination = 1009, - ORBBlendModeDarkenSourceOver = 1010, - ORBBlendModeLightenSourceOver = 1011, - ORBBlendModeMinimum = 1012, - ORBBlendModeMinimumInverse = 1013, - ORBBlendModePassThrough = 2000, -} ORBBlendMode; - -ORB_EXTERN_C_END - -ORB_ASSUME_NONNULL_END diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBlendMode.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBlendMode.h new file mode 120000 index 0000000..bf18f5b --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBBlendMode.h @@ -0,0 +1 @@ +../../Render/ORBBlendMode.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColor.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColor.h deleted file mode 100644 index 557ed27..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColor.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// ORBColor.h -// OpenRenderBox - -#pragma once - -#include -#include -#if ORB_TARGET_OS_DARWIN -#include -#endif - -ORB_ASSUME_NONNULL_BEGIN - -ORB_EXTERN_C_BEGIN - -typedef float ORBColorComponent; - -typedef struct ORBColor { - ORBColorComponent red; - ORBColorComponent green; - ORBColorComponent blue; - ORBColorComponent alpha; -} ORBColor; - -ORB_EXPORT const ORBColor ORBColorClear ORB_SWIFT_NAME(ORBColor.clear); -ORB_EXPORT const ORBColor ORBColorBlack ORB_SWIFT_NAME(ORBColor.black); -ORB_EXPORT const ORBColor ORBColorWhite ORB_SWIFT_NAME(ORBColor.white); -ORB_EXPORT const ORBColor ORBColorNull ORB_SWIFT_NAME(ORBColor.null); -ORB_EXPORT const ORBColorComponent ORBColorInvalidComponent ORB_SWIFT_NAME(ORBColor.invalidComponent); - -ORB_EXPORT ORBColor ORBColorMake(float red, float green, float blue, float alpha) ORB_SWIFT_NAME(ORBColor.init(red:green:blue:alpha:)); -ORB_EXPORT ORBColor ORBColorMakeLinear(float red, float green, float blue, float alpha) ORB_SWIFT_NAME(ORBColor.init(linearRed:green:blue:alpha:)); -ORB_EXPORT ORBColor ORBColorToLinear(ORBColor color) ORB_SWIFT_NAME(getter:ORBColor.linear(self:)); -ORB_EXPORT ORBColor ORBColorFromLinear(ORBColor color) ORB_SWIFT_NAME(ORBColor.fromLinear(self:)); -ORB_EXPORT bool ORBColorEqualToColor(ORBColor lhs, ORBColor rhs) ORB_SWIFT_NAME(ORBColor.isEqual(self:to:)); - -#if ORB_TARGET_OS_DARWIN - -// TODO: Verify the interface -ORB_EXPORT ORBColor ORBColorFromComponents(CGColorSpaceRef colorSpace, const CGFloat *components, bool premultiplied) ORB_SWIFT_NAME(ORBColor.init(colorSpace:components:premultiplied:)); -ORB_EXPORT ORBColor ORBColorFromComponents2(CGColorSpaceRef colorSpace, const CGFloat *components, size_t componentCount) ORB_SWIFT_NAME(ORBColor.init(colorSpace:components:componentCount:)); -ORB_EXPORT ORBColor ORBColorFromCGColor(CGColorRef color, bool premultiplied) ORB_SWIFT_NAME(ORBColor.init(_:premultiplied:)); -ORB_EXPORT ORBColor ORBColorFromCGColor2(CGColorRef color, size_t componentCount) ORB_SWIFT_NAME(ORBColor.init(_:componentCount:)); - -ORB_EXPORT CGColorRef _Nullable ORBColorCopyCGColor(ORBColor color, ORBColorSpace orbColorSpace) CF_RETURNS_RETAINED ORB_SWIFT_NAME(ORBColor.cgColor(self:colorSpace:)); - -#endif /* ORB_TARGET_OS_DARWIN */ - -ORB_EXTERN_C_END - -ORB_ASSUME_NONNULL_END - diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColor.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColor.h new file mode 120000 index 0000000..65340d1 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColor.h @@ -0,0 +1 @@ +../../Color/ORBColor.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorMode.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorMode.h deleted file mode 100644 index 2ead50c..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorMode.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// ORBColorMode.h -// OpenRenderBox - -#pragma once - -#include -#include - -ORB_ASSUME_NONNULL_BEGIN - -ORB_EXTERN_C_BEGIN - -typedef int32_t ORBColorMode ORB_SWIFT_STRUCT ORB_SWIFT_NAME(ORBColor.Mode); - -ORB_EXPORT ORBColorSpace ORBColorModeWorkingColorSpace(ORBColorMode mode) ORB_SWIFT_NAME(getter:ORBColorMode.workingColorSpace(self:)); -ORB_EXPORT bool ORBColorModeHasExtendedRange(ORBColorMode mode) ORB_SWIFT_NAME(getter:ORBColorMode.hasExtendedRange(self:)); - -ORB_EXTERN_C_END - -ORB_ASSUME_NONNULL_END diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorMode.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorMode.h new file mode 120000 index 0000000..49db764 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorMode.h @@ -0,0 +1 @@ +../../Color/ORBColorMode.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorSpace.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorSpace.h deleted file mode 100644 index 98e4e14..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorSpace.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// ORBColorSpace.h -// OpenRenderBox - -#pragma once - -#include - -ORB_ASSUME_NONNULL_BEGIN - -ORB_EXTERN_C_BEGIN - -typedef ORB_ENUM(uint32_t, ORBColorSpace) { - ORBColorSpaceDefault = 0, - ORBColorSpaceSRGB = 1, - ORBColorSpaceLinearSRGB = 2, - ORBColorSpaceDisplayP3 = 3, - ORBColorSpaceLinearDisplayP3 = 4, -} ORB_SWIFT_NAME(ORBColor.ColorSpace); - -ORB_EXTERN_C_END - -ORB_ASSUME_NONNULL_END - diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorSpace.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorSpace.h new file mode 120000 index 0000000..cc7b3ef --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBColorSpace.h @@ -0,0 +1 @@ +../../Color/ORBColorSpace.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDecodable.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDecodable.h new file mode 120000 index 0000000..ebb74d2 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDecodable.h @@ -0,0 +1 @@ +../../Encoding/ORBDecodable.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDecoderDelegate.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDecoderDelegate.h new file mode 120000 index 0000000..a3f7328 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDecoderDelegate.h @@ -0,0 +1 @@ +../../Encoding/ORBDecoderDelegate.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDevice.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDevice.h new file mode 120000 index 0000000..8190186 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDevice.h @@ -0,0 +1 @@ +../../Device/ORBDevice.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayList.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayList.h new file mode 120000 index 0000000..7b75983 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayList.h @@ -0,0 +1 @@ +../../Render/ORBDisplayList.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListContents.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListContents.h new file mode 120000 index 0000000..b4a0473 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListContents.h @@ -0,0 +1 @@ +../../Render/ORBDisplayListContents.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListInterpolator.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListInterpolator.h new file mode 120000 index 0000000..79f9f09 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListInterpolator.h @@ -0,0 +1 @@ +../../Render/ORBDisplayListInterpolator.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListPredicate.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListPredicate.h new file mode 120000 index 0000000..1e3dcfa --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListPredicate.h @@ -0,0 +1 @@ +../../Render/ORBDisplayListPredicate.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListTransform.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListTransform.h new file mode 120000 index 0000000..dc2795f --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDisplayListTransform.h @@ -0,0 +1 @@ +../../Render/ORBDisplayListTransform.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDrawableStatistics.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDrawableStatistics.h new file mode 120000 index 0000000..5960e55 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDrawableStatistics.h @@ -0,0 +1 @@ +../../Render/ORBDrawableStatistics.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDrawingState.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDrawingState.h deleted file mode 100644 index 5626dea..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDrawingState.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// ORBDrawingState.h -// OpenRenderBox - -#pragma once - -#include - -ORB_ASSUME_NONNULL_BEGIN - -typedef struct _ORBDrawingState *ORBDrawingState ORB_SWIFT_STRUCT; - -ORB_ASSUME_NONNULL_END diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDrawingState.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDrawingState.h new file mode 120000 index 0000000..7ca9ce4 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBDrawingState.h @@ -0,0 +1 @@ +../../Render/ORBDrawingState.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBEncodable.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBEncodable.h new file mode 120000 index 0000000..65b9e12 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBEncodable.h @@ -0,0 +1 @@ +../../Encoding/ORBEncodable.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBEncoderDelegate.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBEncoderDelegate.h new file mode 120000 index 0000000..69eb2ab --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBEncoderDelegate.h @@ -0,0 +1 @@ +../../Encoding/ORBEncoderDelegate.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBEncoderSet.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBEncoderSet.h new file mode 120000 index 0000000..12dd2f7 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBEncoderSet.h @@ -0,0 +1 @@ +../../Encoding/ORBEncoderSet.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBImageRenderer.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBImageRenderer.h new file mode 120000 index 0000000..22d3d63 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBImageRenderer.h @@ -0,0 +1 @@ +../../Render/ORBImageRenderer.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBLayer.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBLayer.h new file mode 120000 index 0000000..edbf89b --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBLayer.h @@ -0,0 +1 @@ +../../Render/ORBLayer.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBLayerDelegate.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBLayerDelegate.h new file mode 120000 index 0000000..5742746 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBLayerDelegate.h @@ -0,0 +1 @@ +../../Render/ORBLayerDelegate.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPath.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPath.h deleted file mode 100644 index b5af719..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPath.h +++ /dev/null @@ -1,131 +0,0 @@ -// -// ORBPath.h -// OpenRenderBox - -#pragma once - -#if OPENRENDERBOX_CF_CGTYPES - -#include - -#if ORB_TARGET_OS_DARWIN -#include -#endif - -ORB_ASSUME_NONNULL_BEGIN - -ORB_EXTERN_C_BEGIN - -/// Path element type for path enumeration -typedef ORB_ENUM(int32_t, ORBPathElement) { - ORBPathElementMoveToPoint = 0, - ORBPathElementAddLineToPoint = 1, - ORBPathElementAddQuadCurveToPoint = 2, - ORBPathElementAddCurveToPoint = 3, - ORBPathElementCloseSubpath = 4, - ORBPathElementRect = 5, - ORBPathElementRoundedRect = 6, - ORBPathElementFixedRoundedRectCircular = 8, - ORBPathElementFixedRoundedRectContinuous = 9, - - ORBPathElementInvalid = 25, -} ORB_SWIFT_NAME(ORBPath.Element); - -/// Defines the shape of a rounded rectangle's corners. -typedef ORB_ENUM(int32_t, ORBPathRoundedCornerStyle) { - /// Quarter-circle rounded rect corners. - ORBPathRoundedCornerStyleCircular = 0, - /// Continuous curvature rounded rect corners. - ORBPathRoundedCornerStyleContinuous = 1, -} ORB_SWIFT_NAME(ORBPath.RoundedCornerStyle); - -/// Callback type for path element enumeration -/// Returns true to stop enumeration, false to continue -typedef bool (*ORBPathApplyCallback)(void * info, ORBPathElement element, const CGFloat *points, const void * _Nullable userInfo); - -typedef struct ORBPathCallbacks ORBPathCallbacks ORB_SWIFT_NAME(ORBPath.ApplyCallback); - -typedef struct ORBPathStorage * ORBPathStorageRef ORB_SWIFT_STRUCT ORB_SWIFT_NAME(ORBPath.Storage); - -typedef struct ORBPath { - ORBPathStorageRef storage; - const ORBPathCallbacks * callbacks; -} ORBPath; - -/// Global empty path (storage = null, callbacks = &ORBPathEmptyCallbacks) -ORB_EXPORT -const ORBPath ORBPathEmpty ORB_SWIFT_NAME(ORBPath.empty); - -/// Global null path (storage = 0x1, callbacks = &ORBPathEmptyCallbacks) -ORB_EXPORT -const ORBPath ORBPathNull ORB_SWIFT_NAME(ORBPath.null); - -ORB_EXPORT -void ORBPathRetain(ORBPath path) ORB_SWIFT_NAME(ORBPath.retain(self:)); - -ORB_EXPORT -void ORBPathRelease(ORBPath path) ORB_SWIFT_NAME(ORBPath.release(self:)); - -// MARK: - Path Creation - -#if ORB_TARGET_OS_DARWIN -ORB_EXPORT -ORBPath ORBPathMakeWithCGPath(CGPathRef cgPath) ORB_SWIFT_NAME(ORBPath.init(cgPath:)); - -ORB_EXPORT -ORBPath ORBPathMakeRect(CGRect rect, const CGAffineTransform * _Nullable transform) ORB_SWIFT_NAME(ORBPath.init(rect:transform:)); - -ORB_EXPORT -ORBPath ORBPathMakeEllipse(CGRect rect, const CGAffineTransform * _Nullable transform) ORB_SWIFT_NAME(ORBPath.init(ellipseIn:transform:)); - -ORB_EXPORT -ORBPath ORBPathMakeRoundedRect(CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight, ORBPathRoundedCornerStyle style, const CGAffineTransform * _Nullable transform) ORB_SWIFT_NAME(ORBPath.init(roundedRect:cornerWidth:cornerHeight:style:transform:)); - -ORB_EXPORT -ORBPath ORBPathMakeUnevenRoundedRect(CGRect rect, CGFloat topLeftRadius, CGFloat bottomLeftRadius, CGFloat bottomRightRadius, CGFloat topRightRadius, ORBPathRoundedCornerStyle style, const CGAffineTransform * _Nullable transform) ORB_SWIFT_NAME(ORBPath.init(roundedRect:topLeftRadius:bottomLeftRadius:bottomRightRadius:topRightRadius:style:transform:)); -#endif - -#if ORB_TARGET_OS_DARWIN -// MARK: - Path Transformation - -ORB_EXPORT -ORBPath ORBPathCopyTransformedPath(ORBPath path, const CGAffineTransform *transform) ORB_SWIFT_NAME(ORBPath.copy(self:transform:)); - -static ORB_INLINE bool ORBPathIsNull(ORBPath path) ORB_SWIFT_NAME(getter:ORBPath.isNull(self:)) { - return path.storage == ORBPathNull.storage && path.callbacks == ORBPathNull.callbacks; -} - -#endif - -// MARK: - Path Operation - -ORB_EXPORT -bool ORBPathIsEmpty(ORBPath path) ORB_SWIFT_NAME(getter:ORBPath.isEmpty(self:)); - -ORB_EXPORT -bool ORBPathApplyElements(ORBPath path, void * info, _Nullable ORBPathApplyCallback callback) ORB_SWIFT_NAME(ORBPath.apply(self:info:callback:)); - -ORB_EXPORT -bool ORBPathEqualToPath(ORBPath lhs, ORBPath rhs) ORB_SWIFT_NAME(ORBPath.isEqual(self:to:)); - -// MARK: - CGPath Interoperability - -#if ORB_TARGET_OS_DARWIN -ORB_EXPORT -CGPathRef ORBPathCopyCGPath(ORBPath path) ORB_SWIFT_NAME(getter:ORBPath.cgPath(self:)); -#endif - -// MARK: - Point Containment -#if ORB_TARGET_OS_DARWIN -ORB_EXPORT -bool ORBPathContainsPoint(ORBPath path, CGPoint point, bool eoFill) ORB_SWIFT_NAME(ORBPath.contains(self:point:eoFill:)); - -ORB_EXPORT -bool ORBPathContainsPoints(ORBPath path, uint64_t count, const CGPoint *points, bool eoFill, const CGAffineTransform * _Nullable transform) ORB_SWIFT_NAME(ORBPath.containsPoints(self:count:points:eoFill:transform:)); -#endif - -ORB_EXTERN_C_END - -ORB_ASSUME_NONNULL_END - -#endif /* OPENRENDERBOX_CF_CGTYPES */ diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPath.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPath.h new file mode 120000 index 0000000..1c39440 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPath.h @@ -0,0 +1 @@ +../../Path/ORBPath.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathCallbacks.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathCallbacks.h deleted file mode 100644 index 76278d5..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathCallbacks.h +++ /dev/null @@ -1,112 +0,0 @@ -// -// ORBPathCallbacks.h -// OpenRenderBox -// -// Audited for 6.5.1 -// Status: Complete - -#pragma once - -#if OPENRENDERBOX_CF_CGTYPES - -#include -#include -#include -#if ORB_TARGET_OS_DARWIN -#include -#endif - -ORB_ASSUME_NONNULL_BEGIN - -ORB_EXTERN_C_BEGIN - -/// Flags for path callbacks -typedef struct ORB_SWIFT_NAME(ORBPath.CallbacksFlags) ORBPathCallbacksFlags { - uint8_t unknown0; - uint8_t unknown1; - bool isExtended; - uint8_t padding[5]; -} ORBPathCallbacksFlags; - -/// Callbacks structure for path operations -/// This allows different path storage types (CGPath, custom storage, etc.) to provide their own implementations -typedef struct ORB_SWIFT_NAME(ORBPath.Callbacks) ORBPathCallbacks { - ORBPathCallbacksFlags flags; - const void * _Nonnull (* _Nullable retain)(const void *object); - void (* _Nullable release)(const void *object); - bool (* _Nullable apply)(const void *object, void * info, ORBPathApplyCallback _Nullable callback); - bool (* _Nullable isEqual)(const void *object, const void *otherObject); - bool (* _Nullable isEmpty)(const void *object); - bool (* _Nullable isSingleElement)(const void *object); - uint32_t (* _Nullable bezierOrder)(const void *object); - CGRect (* _Nullable boundingRect)(const void *object); - #if ORB_TARGET_OS_DARWIN - CGPathRef _Nullable (* _Nullable cgPath)(const void *object); - #else - void * _Nullable (* _Nullable cgPath)(const void *object); - #endif - const struct ORBPathCallbacks * _Nullable (* _Nullable next)(const void *object); -} ORBPathCallbacks; - -// static_assert without message requires C23 or C++17 -#if defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) -static_assert(sizeof(struct ORBPathCallbacks) == 0x58); -static_assert(offsetof(struct ORBPathCallbacks, flags) == 0x00); -static_assert(offsetof(struct ORBPathCallbacks, retain) == 0x08); -static_assert(offsetof(struct ORBPathCallbacks, release) == 0x10); -static_assert(offsetof(struct ORBPathCallbacks, apply) == 0x18); -static_assert(offsetof(struct ORBPathCallbacks, isEqual) == 0x20); -static_assert(offsetof(struct ORBPathCallbacks, isEmpty) == 0x28); -static_assert(offsetof(struct ORBPathCallbacks, isSingleElement) == 0x30); -static_assert(offsetof(struct ORBPathCallbacks, bezierOrder) == 0x38); -static_assert(offsetof(struct ORBPathCallbacks, boundingRect) == 0x40); -static_assert(offsetof(struct ORBPathCallbacks, cgPath) == 0x48); -static_assert(offsetof(struct ORBPathCallbacks, next) == 0x50); -#endif - -/// Extended callbacks structure with additional extended callbacks argument -typedef struct ORB_SWIFT_NAME(ORBPath.CallbacksExtended) ORBPathCallbacksExtended { - ORBPathCallbacksFlags flags; - const void * _Nonnull (* _Nullable retain)(const void *object); - void (* _Nullable release)(const void *object); - bool (* _Nullable apply)(const void *object, void * info, ORBPathApplyCallback _Nullable callback, const struct ORBPathCallbacksExtended *extended); - bool (* _Nullable isEqual)(const void *object, const void *otherObject, const struct ORBPathCallbacksExtended *extended); - bool (* _Nullable isEmpty)(const void *object, const struct ORBPathCallbacksExtended *extended); - bool (* _Nullable isSingleElement)(const void *object, const struct ORBPathCallbacksExtended *extended); - uint32_t (* _Nullable bezierOrder)(const void *object, const struct ORBPathCallbacksExtended *extended); - CGRect (* _Nullable boundingRect)(const void *object, const struct ORBPathCallbacksExtended *extended); - #if ORB_TARGET_OS_DARWIN - CGPathRef _Nullable (* _Nullable cgPath)(const void *object, const struct ORBPathCallbacksExtended *extended); - #else - void * _Nullable (* _Nullable cgPath)(const void *object, const struct ORBPathCallbacksExtended *extended); - #endif - const struct ORBPathCallbacksExtended * _Nullable (* _Nullable next)(const void *object, const struct ORBPathCallbacksExtended *extended); -} ORBPathCallbacksExtended; - -// static_assert without message requires C23 or C++17 -#if defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) -static_assert(sizeof(struct ORBPathCallbacksExtended) == 0x58); -static_assert(offsetof(struct ORBPathCallbacksExtended, flags) == 0x00); -static_assert(offsetof(struct ORBPathCallbacksExtended, retain) == 0x08); -static_assert(offsetof(struct ORBPathCallbacksExtended, release) == 0x10); -static_assert(offsetof(struct ORBPathCallbacksExtended, apply) == 0x18); -static_assert(offsetof(struct ORBPathCallbacksExtended, isEqual) == 0x20); -static_assert(offsetof(struct ORBPathCallbacksExtended, isEmpty) == 0x28); -static_assert(offsetof(struct ORBPathCallbacksExtended, isSingleElement) == 0x30); -static_assert(offsetof(struct ORBPathCallbacksExtended, bezierOrder) == 0x38); -static_assert(offsetof(struct ORBPathCallbacksExtended, boundingRect) == 0x40); -static_assert(offsetof(struct ORBPathCallbacksExtended, cgPath) == 0x48); -static_assert(offsetof(struct ORBPathCallbacksExtended, next) == 0x50); -#endif - -#if ORB_TARGET_OS_DARWIN -/// Global callbacks for CGPath-backed paths -ORB_EXPORT -const ORBPathCallbacks ORBPathCGPathCallbacks ORB_SWIFT_NAME(ORBPathCallbacks.cgPath); -#endif - -ORB_EXTERN_C_END - -ORB_ASSUME_NONNULL_END - -#endif /* OPENRENDERBOX_CF_CGTYPES */ diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathCallbacks.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathCallbacks.h new file mode 120000 index 0000000..7b21633 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathCallbacks.h @@ -0,0 +1 @@ +../../Path/ORBPathCallbacks.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathStorage.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathStorage.h deleted file mode 100644 index 6bfd731..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathStorage.h +++ /dev/null @@ -1,65 +0,0 @@ -// -// ORBPathStorage.h -// OpenRenderBox -// -// Audited for 6.5.1 -// Status: Complete - -#pragma once - -#if OPENRENDERBOX_CF_CGTYPES - -#include -#include -#if ORB_TARGET_OS_DARWIN -#include -#endif - -ORB_ASSUME_NONNULL_BEGIN - -ORB_EXTERN_C_BEGIN - -ORB_EXPORT -void ORBPathStorageInit(ORBPathStorageRef dst, uint32_t capacity, ORBPathStorageRef _Nullable source) ORB_SWIFT_NAME(ORBPathStorageRef.initialize(self:capacity:source:)); - -ORB_EXPORT -void ORBPathStorageDestroy(ORBPathStorageRef storage) ORB_SWIFT_NAME(ORBPathStorageRef.destroy(self:)); - -ORB_EXPORT -void ORBPathStorageClear(ORBPathStorageRef storage) ORB_SWIFT_NAME(ORBPathStorageRef.clear(self:)); - -ORB_EXPORT -bool ORBPathStorageAppendElement(ORBPathStorageRef storage, ORBPathElement element, CGFloat const * points, const void * _Nullable userInfo) ORB_SWIFT_NAME(ORBPathStorageRef.append(self:element:points:userInfo:)); - -ORB_EXPORT -bool ORBPathStorageAppendPath(ORBPathStorageRef, ORBPath) ORB_SWIFT_NAME(ORBPathStorageRef.append(self:path:)); - -ORB_EXPORT -bool ORBPathStorageApplyElements(ORBPathStorageRef, void *info, ORBPathApplyCallback _Nullable callback) ORB_SWIFT_NAME(ORBPathStorageRef.apply(self:info:callback:)); - -ORB_EXPORT -bool ORBPathStorageIsEmpty(ORBPathStorageRef storage) ORB_SWIFT_NAME(getter:ORBPathStorageRef.isEmpty(self:)); - -ORB_EXPORT -bool ORBPathStorageEqualToStorage(ORBPathStorageRef lhs, ORBPathStorageRef rhs) ORB_SWIFT_NAME(ORBPathStorageRef.isEqual(self:to:)); - -ORB_EXPORT -bool ORBPathStorageIsSingleElement(ORBPathStorageRef storage) ORB_SWIFT_NAME(getter:ORBPathStorageRef.isSingleElement(self:)); - -ORB_EXPORT -uint32_t ORBPathStorageGetBezierOrder(ORBPathStorageRef storage) ORB_SWIFT_NAME(getter:ORBPathStorageRef.bezierOrder(self:)); - -#if ORB_TARGET_OS_DARWIN -ORB_EXPORT -CGRect ORBPathStorageGetBoundingRect(ORBPathStorageRef storage) ORB_SWIFT_NAME(getter:ORBPathStorageRef.boundingRect(self:)); - -ORB_EXPORT -CF_RETURNS_NOT_RETAINED -__nullable CGPathRef ORBPathStorageGetCGPath(ORBPathStorageRef storage) ORB_SWIFT_NAME(getter:ORBPathStorageRef.cgPath(self:)); -#endif - -ORB_EXTERN_C_END - -ORB_ASSUME_NONNULL_END - -#endif /* OPENRENDERBOX_CF_CGTYPES */ diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathStorage.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathStorage.h new file mode 120000 index 0000000..21b91b5 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBPathStorage.h @@ -0,0 +1 @@ +../../Path/ORBPathStorage.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSwiftSupport.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSwiftSupport.h deleted file mode 100644 index ee1726a..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSwiftSupport.h +++ /dev/null @@ -1,43 +0,0 @@ -// -// ORBSwiftSupport.h -// OpenRenderBox - -#pragma once - -#if __has_attribute(swift_name) -#define ORB_SWIFT_NAME(_name) __attribute__((swift_name(#_name))) -#else -#define ORB_SWIFT_NAME -#endif - -#if __has_attribute(swift_wrapper) -#define ORB_SWIFT_STRUCT __attribute__((swift_wrapper(struct))) -#else -#define ORB_SWIFT_STRUCT -#endif - -#if __has_attribute(swift_private) -#define ORB_REFINED_FOR_SWIFT __attribute__((swift_private)) -#else -#define ORB_REFINED_FOR_SWIFT -#endif - -// MARK: - Call Convension - -#define ORB_SWIFT_CC(CC) ORB_SWIFT_CC_##CC -// ORB_SWIFT_CC(c) is the C calling convention. -#define ORB_SWIFT_CC_c - -// ORB_SWIFT_CC(swift) is the Swift calling convention. -#if __has_attribute(swiftcall) -#define ORB_SWIFT_CC_swift __attribute__((swiftcall)) -#define ORB_SWIFT_CONTEXT __attribute__((swift_context)) -#define ORB_SWIFT_ERROR_RESULT __attribute__((swift_error_result)) -#define ORB_SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) -#else -#define ORB_SWIFT_CC_swift -#define ORB_SWIFT_CONTEXT -#define ORB_SWIFT_ERROR_RESULT -#define ORB_SWIFT_INDIRECT_RESULT -#endif - diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSwiftSupport.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSwiftSupport.h new file mode 120000 index 0000000..7af560b --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSwiftSupport.h @@ -0,0 +1 @@ +../../Base/ORBSwiftSupport.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimation.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimation.h deleted file mode 100644 index f1d558b..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimation.h +++ /dev/null @@ -1,79 +0,0 @@ -// -// ORBSymbolAnimation.h -// OpenRenderBox - -#pragma once - -#include - -ORB_EXTERN_C_BEGIN - -typedef ORB_ENUM(uint32_t, ORBSymbolAnimation) { - ORBSymbolAnimationVariableValue = 0, - ORBSymbolAnimationVariableColor = 1, - ORBSymbolAnimationPulse = 2, - ORBSymbolAnimationBounce = 3, - ORBSymbolAnimationScale = 4, - ORBSymbolAnimationAppear = 5, - ORBSymbolAnimationReplace = 6, - ORBSymbolAnimationInterpolate = 7, - ORBSymbolAnimationPush = 8, - ORBSymbolAnimationDisappear = 9, - ORBSymbolAnimationWiggle = 10, - ORBSymbolAnimationRotate = 11, - ORBSymbolAnimationBreathe = 12, -}; - -typedef ORB_ENUM(int32_t, ORBSymbolScaleLevel) { - ORBSymbolScaleLevelDown = -1, - ORBSymbolScaleLevelNormal = 0, - ORBSymbolScaleLevelUp = 1, -}; - -typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationBreatheFlags) { - ORBSymbolAnimationBreatheFlagsOnlyScale = 1 << 0, -} ORB_SWIFT_NAME(ORBSymbolAnimation.BreatheOptions); - -typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationBounceFlags) { - ORBSymbolAnimationBounceFlagsUp = 1 << 0, - ORBSymbolAnimationBounceFlagsDown = 1 << 1, - ORBSymbolAnimationBounceFlagsContinuous = 1 << 4, -} ORB_SWIFT_NAME(ORBSymbolAnimation.BounceOptions); - -typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationWiggleFlags) { - ORBSymbolAnimationWiggleFlagsLocalized = 0x1, - ORBSymbolAnimationWiggleFlagsRotational = 0x3, - ORBSymbolAnimationWiggleFlagsForward = 0x10, - ORBSymbolAnimationWiggleFlagsBackward = 0x20, - ORBSymbolAnimationWiggleFlagsDirectionMask = 0xF0, - ORBSymbolAnimationWiggleFlagsContinuous = 0x100, -} ORB_SWIFT_NAME(ORBSymbolAnimation.WiggleOptions); - -typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationRotateFlags) { - ORBSymbolAnimationRotateFlagsClockwise = 1 << 0, - ORBSymbolAnimationRotateFlagsCounterClockwise = 1 << 1, - ORBSymbolAnimationRotateFlagsContinuous = 1 << 4, -} ORB_SWIFT_NAME(ORBSymbolAnimation.RotateOptions); - -typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationVariableColorFlags) { - ORBSymbolAnimationVariableColorFlagsIterative = 1 << 0, - ORBSymbolAnimationVariableColorFlagsHideInactiveLayers = 1 << 1, - ORBSymbolAnimationVariableColorFlagsReversing = 1 << 3, -} ORB_SWIFT_NAME(ORBSymbolAnimation.VariableColorOptions); - -typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationAppearDisappearFlags) { - ORBSymbolAnimationAppearDisappearFlagsDown = 0x2, - ORBSymbolAnimationAppearDisappearFlagsUp = 0x3, - ORBSymbolAnimationAppearDisappearFlagsWholeSymbol = 0x10, -} ORB_SWIFT_NAME(ORBSymbolAnimation.AppearDisappearOptions); - -typedef ORB_OPTIONS(uint32_t, ORBSymbolAnimationReplaceFlags) { - ORBSymbolAnimationReplaceFlagsDown = 0x2, - ORBSymbolAnimationReplaceFlagsUp = 0x3, - ORBSymbolAnimationReplaceFlagsOffUp = 0x4, - ORBSymbolAnimationReplaceFlagsWholeSymbol = 0x10, - ORBSymbolAnimationReplaceFlagsNoSlashes = 0x20, - ORBSymbolAnimationReplaceFlagsNoBadges = 0x40, -} ORB_SWIFT_NAME(ORBSymbolAnimation.ReplaceOptions); - -ORB_EXTERN_C_END diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimation.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimation.h new file mode 120000 index 0000000..ae0d831 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimation.h @@ -0,0 +1 @@ +../../Animation/ORBSymbolAnimation.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimator.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimator.h new file mode 120000 index 0000000..8dd036d --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimator.h @@ -0,0 +1 @@ +../../Animation/ORBSymbolAnimator.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimatorObserver.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimatorObserver.h new file mode 120000 index 0000000..4410eff --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolAnimatorObserver.h @@ -0,0 +1 @@ +../../Animation/ORBSymbolAnimatorObserver.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolRenderingMode.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolRenderingMode.h deleted file mode 100644 index 9b7d7f7..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolRenderingMode.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// ORBSymbolRenderingMode.h -// OpenRenderBox - -#pragma once - -#include - -typedef ORB_ENUM(uint32_t, ORBSymbolRenderingMode) { - ORBSymbolRenderingModePreferred = 0, - ORBSymbolRenderingModeMonochrome = 1, - ORBSymbolRenderingModeMulticolor = 2, - ORBSymbolRenderingModeHierarchical = 3, - ORBSymbolRenderingModePalette = 4, - ORBSymbolRenderingModeHierarchicalUnlessSlashed = 128, - ORBSymbolRenderingModeHierarchicalSlashBadge = 129, - ORBSymbolRenderingModePaletteSlashBadge = 130, - // No explicit mode. A symbol update keeps the animator's current mode. - ORBSymbolRenderingModeUnspecified = 255, -}; diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolRenderingMode.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolRenderingMode.h new file mode 120000 index 0000000..b1e5294 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolRenderingMode.h @@ -0,0 +1 @@ +../../Render/ORBSymbolRenderingMode.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolUpdate.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolUpdate.h deleted file mode 100644 index d8de26b..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolUpdate.h +++ /dev/null @@ -1,75 +0,0 @@ -// -// ORBSymbolUpdate.h -// OpenRenderBox - -#pragma once - -#include -#include -#include -#include -#include - -#if ORB_OBJC_FOUNDATION -#include -#endif - -ORB_ASSUME_NONNULL_BEGIN - -typedef ORB_OPTIONS(uint32_t, ORBSymbolUpdateFlags) { - ORBSymbolUpdateFlagsSwapAxes = 1 << 0, - ORBSymbolUpdateFlagsFlipX = 1 << 1, - ORBSymbolUpdateFlagsFlipY = 1 << 2, - ORBSymbolUpdateFlagsMergeLayers = 1 << 4, - // Apply the glyph's vertical alignment offset to each layer transform. - ORBSymbolUpdateFlagsApplyVerticalOffset = 1 << 5, -}; - -typedef ORB_OPTIONS(uint32_t, ORBSymbolUpdateLayerFlags) { - ORBSymbolUpdateLayerFlagsIncludeClips = 1 << 0, -}; - -typedef ORB_ENUM(uint32_t, ORBSymbolStyle) { - ORBSymbolStylePrimary = 0, - ORBSymbolStyleSecondary = 5, - ORBSymbolStyleTertiary = 6, - ORBSymbolStyleQuaternary = 7, - ORBSymbolStyleQuinary = 8, - ORBSymbolStyleNamedColor = 9, -}; - -typedef struct _ORBSymbolUpdate *ORBSymbolUpdate ORB_SWIFT_STRUCT; - -// The update owns all layer data. A layer is valid until endUpdate:. -typedef struct ORBSymbolUpdateLayer { - ORBSymbolUpdate update; - intptr_t group; - intptr_t index; -} ORBSymbolUpdateLayer; - -#if ORB_OBJC_FOUNDATION - -ORB_EXTERN_C_BEGIN - -ORB_EXPORT double ORBSymbolUpdateNextTime(ORBSymbolUpdate update) ORB_SWIFT_NAME(getter:ORBSymbolUpdate.nextTime(self:)); -ORB_EXPORT uint32_t ORBSymbolUpdateStyleMask(ORBSymbolUpdate update) ORB_SWIFT_NAME(getter:ORBSymbolUpdate.styleMask(self:)); -ORB_EXPORT intptr_t ORBSymbolUpdateGroupCount(ORBSymbolUpdate update) ORB_SWIFT_NAME(getter:ORBSymbolUpdate.groupCount(self:)); -ORB_EXPORT intptr_t ORBSymbolUpdateGroupSize(ORBSymbolUpdate update, intptr_t group) ORB_SWIFT_NAME(ORBSymbolUpdate.groupSize(self:group:)); -ORB_EXPORT CGImageRef _Nullable ORBSymbolUpdateTemplateImage(ORBSymbolUpdate update, double * _Nullable scale, float * _Nullable opacity) CF_RETURNS_NOT_RETAINED ORB_SWIFT_NAME(ORBSymbolUpdate.templateImage(self:scale:opacity:)); -ORB_EXPORT void ORBSymbolUpdateDrawWithStyleResolver(ORBSymbolUpdate update, ORBDrawingState state, ORBColor (^resolver)(ORBSymbolStyle, NSString * _Nullable)) ORB_SWIFT_NAME(ORBSymbolUpdate.draw(self:in:resolver:)); - -ORB_EXPORT float ORBSymbolUpdateLayerDrawingOpacity(ORBSymbolUpdateLayer layer) ORB_SWIFT_NAME(getter:ORBSymbolUpdateLayer.drawingOpacity(self:)); -ORB_EXPORT ORBSymbolStyle ORBSymbolUpdateLayerStyle(ORBSymbolUpdateLayer layer) ORB_SWIFT_NAME(getter:ORBSymbolUpdateLayer.style(self:)); -ORB_EXPORT NSString * _Nullable ORBSymbolUpdateLayerColorName(ORBSymbolUpdateLayer layer) ORB_SWIFT_NAME(getter:ORBSymbolUpdateLayer.colorName(self:)); -ORB_EXPORT CGColorRef _Nullable ORBSymbolUpdateLayerDefaultColor(ORBSymbolUpdateLayer layer) CF_RETURNS_NOT_RETAINED ORB_SWIFT_NAME(getter:ORBSymbolUpdateLayer.defaultColor(self:)); -// The update owns the returned path. Copy it before the update ends. -#if OPENRENDERBOX_CF_CGTYPES -ORB_EXPORT ORBPath ORBSymbolUpdateLayerPath(ORBSymbolUpdateLayer layer, CGAffineTransform *transform, ORBSymbolUpdateLayerFlags flags) ORB_SWIFT_NAME(ORBSymbolUpdateLayer.path(self:transform:flags:)); -#endif -ORB_EXPORT void ORBSymbolUpdateLayerDraw(ORBSymbolUpdateLayer layer, ORBDrawingState state, ORBColor color, float opacity, ORBBlendMode blendMode, ORBSymbolUpdateLayerFlags flags) ORB_SWIFT_NAME(ORBSymbolUpdateLayer.draw(self:in:color:opacity:blendMode:flags:)); - -ORB_EXTERN_C_END - -#endif /* ORB_OBJC_FOUNDATION */ - -ORB_ASSUME_NONNULL_END diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolUpdate.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolUpdate.h new file mode 120000 index 0000000..c80de9f --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBSymbolUpdate.h @@ -0,0 +1 @@ +../../Animation/ORBSymbolUpdate.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTargetConditionals.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTargetConditionals.h deleted file mode 100644 index bd07a73..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTargetConditionals.h +++ /dev/null @@ -1,275 +0,0 @@ -// This source file is part of the Swift.org open source project -// -// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors -// Licensed under Apache License v2.0 with Runtime Library Exception -// -// See http://swift.org/LICENSE.txt for license information -// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors -// - -/* - File: ORBTargetConditionals.h - - Contains: Autoconfiguration of TARGET_ conditionals for Mac OS X and iPhone - - Note: OpenSwiftUITargetConditionals.h in 3.4 Universal Interfaces works - with all compilers. This header only recognizes compilers - known to run on Mac OS X. - -*/ - -#pragma once -/**************************************************************************************************** - - TARGET_CPU_* - These conditionals specify which microprocessor instruction set is being - generated. At most one of these is true, the rest are false. - - TARGET_CPU_PPC - Compiler is generating PowerPC instructions for 32-bit mode - TARGET_CPU_PPC64 - Compiler is generating PowerPC instructions for 64-bit mode - TARGET_CPU_68K - Compiler is generating 680x0 instructions - TARGET_CPU_X86 - Compiler is generating x86 instructions - TARGET_CPU_ARM - Compiler is generating ARM instructions - TARGET_CPU_MIPS - Compiler is generating MIPS instructions - TARGET_CPU_SPARC - Compiler is generating Sparc instructions - TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions - TARGET_CPU_WASM32 - Compiler is generating WebAssembly instructions for 32-bit mode - - - TARGET_OS_* - These conditionals specify in which Operating System the generated code will - run. Indention is used to show which conditionals are evolutionary subclasses. - - The MAC/WIN32/UNIX conditionals are mutually exclusive. - The IOS/TV/WATCH conditionals are mutually exclusive. - - - TARGET_OS_WIN32 - Generated code will run under 32-bit Windows - TARGET_OS_UNIX - Generated code will run under some Unix (not OSX) - TARGET_OS_CYGWIN - Generated code will run under 64-bit Cygwin - TARGET_OS_WASI - Generated code will run under WebAssembly System Interface - TARGET_OS_MAC - Generated code will run under Mac OS X variant - TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator - TARGET_OS_IOS - Generated code will run under iOS - TARGET_OS_TV - Generated code will run under Apple TV OS - TARGET_OS_WATCH - Generated code will run under Apple Watch OS - TARGET_OS_SIMULATOR - Generated code will run under a simulator - TARGET_OS_EMBEDDED - Generated code for firmware - - TARGET_IPHONE_SIMULATOR - DEPRECATED: Same as TARGET_OS_SIMULATOR - TARGET_OS_NANO - DEPRECATED: Same as TARGET_OS_WATCH - - TARGET_RT_* - These conditionals specify in which runtime the generated code will - run. This is needed when the OS and CPU support more than one runtime - (e.g. Mac OS X supports CFM and mach-o). - - TARGET_RT_LITTLE_ENDIAN - Generated code uses little endian format for integers - TARGET_RT_BIG_ENDIAN - Generated code uses big endian format for integers - TARGET_RT_64_BIT - Generated code uses 64-bit pointers - TARGET_RT_MAC_CFM - TARGET_OS_MAC is true and CFM68K or PowerPC CFM (TVectors) are used - TARGET_RT_MAC_MACHO - TARGET_OS_MAC is true and Mach-O/dlyd runtime is used - - -****************************************************************************************************/ - -#if __APPLE__ -#define ORB_TARGET_OS_DARWIN 1 -#define ORB_TARGET_OS_LINUX 0 -#define ORB_TARGET_OS_WINDOWS 0 -#define ORB_TARGET_OS_BSD 0 -#define ORB_TARGET_OS_ANDROID 0 -#define ORB_TARGET_OS_CYGWIN 0 -#define ORB_TARGET_OS_WASI 0 -#elif __ANDROID__ -#define ORB_TARGET_OS_DARWIN 0 -#define ORB_TARGET_OS_LINUX 1 -#define ORB_TARGET_OS_WINDOWS 0 -#define ORB_TARGET_OS_BSD 0 -#define ORB_TARGET_OS_ANDROID 1 -#define ORB_TARGET_OS_CYGWIN 0 -#define ORB_TARGET_OS_WASI 0 -#elif __linux__ -#define ORB_TARGET_OS_DARWIN 0 -#define ORB_TARGET_OS_LINUX 1 -#define ORB_TARGET_OS_WINDOWS 0 -#define ORB_TARGET_OS_BSD 0 -#define ORB_TARGET_OS_ANDROID 0 -#define ORB_TARGET_OS_CYGWIN 0 -#define ORB_TARGET_OS_WASI 0 -#elif __CYGWIN__ -#define ORB_TARGET_OS_DARWIN 0 -#define ORB_TARGET_OS_LINUX 1 -#define ORB_TARGET_OS_WINDOWS 0 -#define ORB_TARGET_OS_BSD 0 -#define ORB_TARGET_OS_ANDROID 0 -#define ORB_TARGET_OS_CYGWIN 1 -#define ORB_TARGET_OS_WASI 0 -#elif _WIN32 || _WIN64 -#define ORB_TARGET_OS_DARWIN 0 -#define ORB_TARGET_OS_LINUX 0 -#define ORB_TARGET_OS_WINDOWS 1 -#define ORB_TARGET_OS_BSD 0 -#define ORB_TARGET_OS_ANDROID 0 -#define ORB_TARGET_OS_CYGWIN 0 -#define ORB_TARGET_OS_WASI 0 -#elif __unix__ -#define ORB_TARGET_OS_DARWIN 0 -#define ORB_TARGET_OS_LINUX 0 -#define ORB_TARGET_OS_WINDOWS 0 -#define ORB_TARGET_OS_BSD 1 -#define ORB_TARGET_OS_ANDROID 0 -#define ORB_TARGET_OS_CYGWIN 0 -#define ORB_TARGET_OS_WASI 0 -#elif __wasi__ -#define ORB_TARGET_OS_DARWIN 0 -#define ORB_TARGET_OS_LINUX 0 -#define ORB_TARGET_OS_WINDOWS 0 -#define ORB_TARGET_OS_BSD 0 -#define ORB_TARGET_OS_ANDROID 0 -#define ORB_TARGET_OS_CYGWIN 0 -#define ORB_TARGET_OS_WASI 1 -#else -#error unknown operating system -#endif - -#define ORB_TARGET_OS_WIN32 ORB_TARGET_OS_WINDOWS -#define ORB_TARGET_OS_MAC ORB_TARGET_OS_DARWIN -#define ORB_TARGET_OS_OSX ORB_TARGET_OS_DARWIN - -// iOS, watchOS, and tvOS are not supported -#define ORB_TARGET_OS_IPHONE 0 -#define ORB_TARGET_OS_IOS 0 -#define ORB_TARGET_OS_WATCH 0 -#define ORB_TARGET_OS_TV 0 - -#if __x86_64__ -#define ORB_TARGET_CPU_PPC 0 -#define ORB_TARGET_CPU_PPC64 0 -#define ORB_TARGET_CPU_X86 0 -#define ORB_TARGET_CPU_X86_64 1 -#define ORB_TARGET_CPU_ARM 0 -#define ORB_TARGET_CPU_ARM64 0 -#define ORB_TARGET_CPU_MIPS 0 -#define ORB_TARGET_CPU_MIPS64 0 -#define ORB_TARGET_CPU_S390X 0 -#define ORB_TARGET_CPU_WASM32 0 -#elif __arm64__ || __aarch64__ -#define ORB_TARGET_CPU_PPC 0 -#define ORB_TARGET_CPU_PPC64 0 -#define ORB_TARGET_CPU_X86 0 -#define ORB_TARGET_CPU_X86_64 0 -#define ORB_TARGET_CPU_ARM 0 -#define ORB_TARGET_CPU_ARM64 1 -#define ORB_TARGET_CPU_MIPS 0 -#define ORB_TARGET_CPU_MIPS64 0 -#define ORB_TARGET_CPU_S390X 0 -#define ORB_TARGET_CPU_WASM32 0 -#elif __mips64__ -#define ORB_TARGET_CPU_PPC 0 -#define ORB_TARGET_CPU_PPC64 0 -#define ORB_TARGET_CPU_X86 0 -#define ORB_TARGET_CPU_X86_64 0 -#define ORB_TARGET_CPU_ARM 0 -#define ORB_TARGET_CPU_ARM64 0 -#define ORB_TARGET_CPU_MIPS 0 -#define ORB_TARGET_CPU_MIPS64 1 -#define ORB_TARGET_CPU_S390X 0 -#define ORB_TARGET_CPU_WASM32 0 -#elif __powerpc64__ -#define ORB_TARGET_CPU_PPC 0 -#define ORB_TARGET_CPU_PPC64 1 -#define ORB_TARGET_CPU_X86 0 -#define ORB_TARGET_CPU_X86_64 0 -#define ORB_TARGET_CPU_ARM 0 -#define ORB_TARGET_CPU_ARM64 0 -#define ORB_TARGET_CPU_MIPS 0 -#define ORB_TARGET_CPU_MIPS64 0 -#define ORB_TARGET_CPU_S390X 0 -#define ORB_TARGET_CPU_WASM32 0 -#elif __i386__ -#define ORB_TARGET_CPU_PPC 0 -#define ORB_TARGET_CPU_PPC64 0 -#define ORB_TARGET_CPU_X86 1 -#define ORB_TARGET_CPU_X86_64 0 -#define ORB_TARGET_CPU_ARM 0 -#define ORB_TARGET_CPU_ARM64 0 -#define ORB_TARGET_CPU_MIPS 0 -#define ORB_TARGET_CPU_MIPS64 0 -#define ORB_TARGET_CPU_S390X 0 -#define ORB_TARGET_CPU_WASM32 0 -#elif __arm__ -#define ORB_TARGET_CPU_PPC 0 -#define ORB_TARGET_CPU_PPC64 0 -#define ORB_TARGET_CPU_X86 0 -#define ORB_TARGET_CPU_X86_64 0 -#define ORB_TARGET_CPU_ARM 1 -#define ORB_TARGET_CPU_ARM64 0 -#define ORB_TARGET_CPU_MIPS 0 -#define ORB_TARGET_CPU_MIPS64 0 -#define ORB_TARGET_CPU_S390X 0 -#define ORB_TARGET_CPU_WASM32 0 -#elif __mips__ -#define ORB_TARGET_CPU_PPC 0 -#define ORB_TARGET_CPU_PPC64 0 -#define ORB_TARGET_CPU_X86 0 -#define ORB_TARGET_CPU_X86_64 0 -#define ORB_TARGET_CPU_ARM 0 -#define ORB_TARGET_CPU_ARM64 0 -#define ORB_TARGET_CPU_MIPS 1 -#define ORB_TARGET_CPU_MIPS64 0 -#define ORB_TARGET_CPU_S390X 0 -#define ORB_TARGET_CPU_WASM32 0 -#elif __powerpc__ -#define ORB_TARGET_CPU_PPC 1 -#define ORB_TARGET_CPU_PPC64 0 -#define ORB_TARGET_CPU_X86 0 -#define ORB_TARGET_CPU_X86_64 0 -#define ORB_TARGET_CPU_ARM 0 -#define ORB_TARGET_CPU_ARM64 0 -#define ORB_TARGET_CPU_MIPS 0 -#define ORB_TARGET_CPU_MIPS64 0 -#define ORB_TARGET_CPU_S390X 0 -#define ORB_TARGET_CPU_WASM32 0 -#elif __s390x__ -#define ORB_TARGET_CPU_PPC 0 -#define ORB_TARGET_CPU_PPC64 0 -#define ORB_TARGET_CPU_X86 0 -#define ORB_TARGET_CPU_X86_64 0 -#define ORB_TARGET_CPU_ARM 0 -#define ORB_TARGET_CPU_ARM64 0 -#define ORB_TARGET_CPU_MIPS 0 -#define ORB_TARGET_CPU_MIPS64 0 -#define ORB_TARGET_CPU_S390X 1 -#define ORB_TARGET_CPU_WASM32 0 -#elif __wasm32__ -#define ORB_TARGET_CPU_PPC 0 -#define ORB_TARGET_CPU_PPC64 0 -#define ORB_TARGET_CPU_X86 0 -#define ORB_TARGET_CPU_X86_64 0 -#define ORB_TARGET_CPU_ARM 0 -#define ORB_TARGET_CPU_ARM64 0 -#define ORB_TARGET_CPU_MIPS 0 -#define ORB_TARGET_CPU_MIPS64 0 -#define ORB_TARGET_CPU_S390X 0 -#define ORB_TARGET_CPU_WASM32 1 -#else -#error unknown architecture -#endif - -#if __LITTLE_ENDIAN__ -#define ORB_TARGET_RT_LITTLE_ENDIAN 1 -#define ORB_TARGET_RT_BIG_ENDIAN 0 -#elif __BIG_ENDIAN__ -#define ORB_TARGET_RT_LITTLE_ENDIAN 0 -#define ORB_TARGET_RT_BIG_ENDIAN 1 -#else -#error unknown endian -#endif - -#if __LP64__ || __LLP64__ || __POINTER_WIDTH__-0 == 64 -#define ORB_TARGET_RT_64_BIT 1 -#else -#define ORB_TARGET_RT_64_BIT 0 -#endif - diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTargetConditionals.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTargetConditionals.h new file mode 120000 index 0000000..6325981 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTargetConditionals.h @@ -0,0 +1 @@ +../../Base/ORBTargetConditionals.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTransition.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTransition.h deleted file mode 100644 index bd57342..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTransition.h +++ /dev/null @@ -1,61 +0,0 @@ -// -// ORBTransition.h -// OpenRenderBox - -#pragma once - -#include - -ORB_ASSUME_NONNULL_BEGIN - -ORB_EXTERN_C_BEGIN - -typedef ORB_ENUM(uint32_t, ORBTransitionMethod) { - ORBTransitionMethodEmpty = 0, - ORBTransitionMethodDiff = 1, - ORBTransitionMethodForwards = 2, - ORBTransitionMethodBackwards = 3, - ORBTransitionMethodPrefix = 4, - ORBTransitionMethodSuffix = 5, - ORBTransitionMethodBinary = 6, - ORBTransitionMethodNone = 7, - ORBTransitionMethodPrefixAndSuffix = 8, -}; - -typedef ORB_OPTIONS(uint32_t, ORBTransitionEvents) { - ORBTransitionEventsAdd = 1 << 0, - ORBTransitionEventsRemove = 1 << 1, - ORBTransitionEventsAddRemove = ORBTransitionEventsAdd | ORBTransitionEventsRemove, -}; - -typedef ORB_OPTIONS(uint32_t, ORBTransitionEffectFlags) { - ORBTransitionEffectFlagsRemoveInverts = 1 << 0, -}; - -typedef ORB_ENUM(uint32_t, ORBTransitionEffectType) { - ORBTransitionEffectTypeNone = 0, - ORBTransitionEffectTypeAlpha = 1, - ORBTransitionEffectTypeScaleCenter = 2, - ORBTransitionEffectTypeTranslation = 3, - ORBTransitionEffectTypeBlur = 4, - ORBTransitionEffectTypeMatchMove = 5, - ORBTransitionEffectTypeScaleOrigin = 6, - ORBTransitionEffectTypeAnchorLeft = 7, - ORBTransitionEffectTypeAnchorRight = 8, - ORBTransitionEffectTypeAnchorUp = 9, - ORBTransitionEffectTypeAnchorDown = 10, - ORBTransitionEffectTypeSequenceLeft = 11, - ORBTransitionEffectTypeSequenceRight = 12, - ORBTransitionEffectTypeSequenceUp = 13, - ORBTransitionEffectTypeSequenceDown = 14, - ORBTransitionEffectTypeRelativeTranslation = 15, - ORBTransitionEffectTypeRelativeBlur = 16, - ORBTransitionEffectTypeAppearDisappear = 17, - ORBTransitionEffectTypeReplace = 18, - ORBTransitionEffectTypeSequenceForwards = 19, - ORBTransitionEffectTypeSequenceBackwards = 20, -}; - -ORB_EXTERN_C_END - -ORB_ASSUME_NONNULL_END diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTransition.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTransition.h new file mode 120000 index 0000000..f0c5ff8 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBTransition.h @@ -0,0 +1 @@ +../../Animation/ORBTransition.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBUUID.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBUUID.h deleted file mode 100644 index 69fd007..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBUUID.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// ORBUUID.hpp -// OpenRenderBox - -#pragma once - -#include - -#if ORB_TARGET_OS_DARWIN && __OBJC__ -#include -#endif - -typedef struct ORBUUID { - uint8_t bytes[16]; -} ORBUUID; - -ORB_EXTERN_C_BEGIN - -#if ORB_TARGET_OS_DARWIN && __OBJC__ -ORB_EXPORT -ORBUUID ORBUUIDInitFromNSUUID(NSUUID *uuid) ORB_SWIFT_NAME(ORBUUID.init(uuid:)); -#endif - -ORB_EXPORT -ORBUUID ORBUUIDInitFromHash(uint64_t words0, uint64_t words1, uint32_t words2) ORB_SWIFT_NAME(ORBUUID.init(_:_:_:)); - -ORB_EXTERN_C_END - diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBUUID.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBUUID.h new file mode 120000 index 0000000..6911af3 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBUUID.h @@ -0,0 +1 @@ +../../UUID/ORBUUID.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBVersion.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBVersion.h deleted file mode 100644 index 8c68275..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBVersion.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// ORBVersion.h -// OpenRenderBox - -#pragma once - -#include - -#define ORB_RELEASE_2024 2024 - -#ifndef ORB_TARGET_RELEASE -#define ORB_TARGET_RELEASE 2024 -#endif diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBVersion.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBVersion.h new file mode 120000 index 0000000..91979a1 --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/ORBVersion.h @@ -0,0 +1 @@ +../../Version/ORBVersion.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/OpenRenderBox.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/OpenRenderBox.h deleted file mode 100644 index ad56eb4..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/OpenRenderBox.h +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -ORB_EXPORT double OpenRenderBoxVersionNumber; -ORB_EXPORT const unsigned char OpenRenderBoxVersionString[]; diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBox/OpenRenderBox.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/OpenRenderBox.h new file mode 120000 index 0000000..cdc03fd --- /dev/null +++ b/Sources/OpenRenderBoxCxx/include/OpenRenderBox/OpenRenderBox.h @@ -0,0 +1 @@ +../../OpenRenderBox.h \ No newline at end of file diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBSymbolAnimation.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBSymbolAnimation.h deleted file mode 100644 index c7b5de9..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBSymbolAnimation.h +++ /dev/null @@ -1,39 +0,0 @@ -// -// ORBSymbolAnimation.h -// OpenRenderBox - -#pragma once - -#include - -#if ORB_OBJC_FOUNDATION - -#include - -ORB_ASSUME_NONNULL_BEGIN - -typedef NSString *ORBSymbolAnimationOptionKey NS_TYPED_EXTENSIBLE_ENUM ORB_SWIFT_NAME(ORBSymbolAnimation.OptionKey); - -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationTiming; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationSpeed; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationClampsSpeed; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationRepeatCount; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationRepeatDelay; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationPriority; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationByLayer; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationOnCompletion; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationSymbolDefaults; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationBreatheOptions; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationPulseOptions; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationBounceOptions; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationWiggleOptions; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationWiggleAngle; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationRotateOptions; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationVariableColorOptions; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationAppearDisappearOptions; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationReplaceOptions; -ORB_EXPORT ORBSymbolAnimationOptionKey const ORBSymbolAnimationInterpolateOptions; - -ORB_ASSUME_NONNULL_END - -#endif /* ORB_OBJC_FOUNDATION */ diff --git a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBTransition.h b/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBTransition.h deleted file mode 100644 index a0918ff..0000000 --- a/Sources/OpenRenderBoxCxx/include/OpenRenderBoxObjC/Animation/ORBTransition.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// ORBTransition.h -// OpenRenderBox - -#pragma once - -#include - -#if ORB_OBJC_FOUNDATION - -#include -#include - -ORB_ASSUME_NONNULL_BEGIN - -@interface ORBTransitionEffect : NSObject - -@property (nonatomic) ORBTransitionEffectType type; -@property (nonatomic) ORBTransitionEffectFlags flags; -@property (nonatomic) ORBTransitionEvents events; -@property (nonatomic) float beginTime; -@property (nonatomic) float duration; -@property (nonatomic) NSUInteger animationIndex; -@property (nonatomic) NSUInteger insertAnimationIndex; -@property (nonatomic) NSUInteger removeAnimationIndex; - -- (float)argumentValueAtIndex:(NSUInteger)index; -- (void)setArgumentValue:(float)value atIndex:(NSUInteger)index; -- (uint32_t)integerArgumentValueAtIndex:(NSUInteger)index; -- (void)setIntegerArgumentValue:(uint32_t)value atIndex:(NSUInteger)index; - -@end - -@interface ORBTransition : NSObject - -@property (class, readonly, nonatomic) ORBTransition *defaultTransition; -@property (nonatomic) ORBTransitionMethod method; -@property (nonatomic, strong, nullable) ORBAnimation *animation; -@property (nonatomic) uint32_t maxChanges; -@property (nonatomic, getter=isReplaceable) BOOL replaceable; -@property (readonly, nonatomic, copy) NSArray *effects; -@property (nonatomic) float addRemoveDuration; - -- (void)addEffect:(nullable ORBTransitionEffect *)effect; - -@end - -ORB_ASSUME_NONNULL_END - -#endif /* ORB_OBJC_FOUNDATION */ diff --git a/Sources/OpenRenderBoxCxx/include/module.modulemap b/Sources/OpenRenderBoxCxx/include/module.modulemap index 70a6662..c1389b4 100644 --- a/Sources/OpenRenderBoxCxx/include/module.modulemap +++ b/Sources/OpenRenderBoxCxx/include/module.modulemap @@ -3,36 +3,80 @@ module OpenRenderBoxCxx { } module OpenRenderBoxCxx.C { - umbrella header "OpenRenderBox/OpenRenderBox.h" + header "OpenRenderBox/OpenRenderBox.h" + header "OpenRenderBox/ORBSymbolAnimation.h" + header "OpenRenderBox/ORBSymbolUpdate.h" + header "OpenRenderBox/ORBTransition.h" + header "OpenRenderBox/CFCGTypes.h" + header "OpenRenderBox/ORBBase.h" + header "OpenRenderBox/ORBSwiftSupport.h" + header "OpenRenderBox/ORBTargetConditionals.h" + header "OpenRenderBox/ORBColor.h" + header "OpenRenderBox/ORBColorMode.h" + header "OpenRenderBox/ORBColorSpace.h" + header "OpenRenderBox/ORBPath.h" + header "OpenRenderBox/ORBPathCallbacks.h" + header "OpenRenderBox/ORBPathStorage.h" + header "OpenRenderBox/ORBBlendMode.h" + header "OpenRenderBox/ORBDrawingState.h" + header "OpenRenderBox/ORBSymbolRenderingMode.h" + header "OpenRenderBox/ORBUUID.h" + header "OpenRenderBox/ORBVersion.h" export * } module OpenRenderBoxCxx.Color { requires cplusplus - umbrella "OpenRenderBoxCxx/Color" + header "../Color/ColorSpace.hpp" export * } module OpenRenderBoxCxx.Animation { requires cplusplus - umbrella "OpenRenderBoxCxx/Animation" + header "../Animation/Animation.hpp" + header "../Animation/Transition.hpp" + header "../Vector/vector.hpp" + header "../Vector/realloc_vector.hpp" + textual header "../Vector/vector.tpp" export * } module OpenRenderBoxCxx.Path { requires cplusplus - umbrella "OpenRenderBoxCxx/Path" + header "../Path/NestedCallbacks.hpp" + header "../Path/Storage.hpp" export * } module OpenRenderBoxCxx.Util { requires cplusplus - umbrella "OpenRenderBoxCxx/Util" + header "../Util/assert.hpp" + header "../Util/log.hpp" + header "../Util/refcounted_ptr.hpp" export * } module OpenRenderBoxCxx.ObjC { requires objc - umbrella "OpenRenderBoxObjC" + header "OpenRenderBox/ORBAnimation.h" + header "OpenRenderBox/ORBSymbolAnimator.h" + header "OpenRenderBox/ORBSymbolAnimatorObserver.h" + header "OpenRenderBox/ORBDevice.h" + header "OpenRenderBox/ORBDecodable.h" + header "OpenRenderBox/ORBDecoderDelegate.h" + header "OpenRenderBox/ORBEncodable.h" + header "OpenRenderBox/ORBEncoderDelegate.h" + header "OpenRenderBox/ORBEncoderSet.h" + header "OpenRenderBox/ORBDisplayList.h" + header "OpenRenderBox/ORBDisplayListContents.h" + header "OpenRenderBox/ORBDisplayListInterpolator.h" + header "OpenRenderBox/ORBDisplayListPredicate.h" + header "OpenRenderBox/ORBDisplayListTransform.h" + header "OpenRenderBox/ORBDrawableStatistics.h" + header "OpenRenderBox/ORBImageRenderer.h" + header "OpenRenderBox/ORBLayer.h" + header "OpenRenderBox/ORBLayerDelegate.h" + header "../Render/Private/_ORBDisplayListContents.h" + header "../Render/Private/_ORBDrawableDelegate.h" export * } diff --git a/Tuist.swift b/Tuist.swift new file mode 100644 index 0000000..b08c1f1 --- /dev/null +++ b/Tuist.swift @@ -0,0 +1,11 @@ +import ProjectDescription + +let tuist = Tuist( + project: .tuist( + generationOptions: .options( + optionalAuthentication: true, + enableCaching: false + ), + cacheOptions: .options(storages: [.local]) + ) +)