From f07d1a7f2198f37681dc3ec5dee1fac329bb5267 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Mon, 13 Jan 2025 03:48:22 +0100 Subject: [PATCH] Add the CompositorServices framework Part of https://github.com/madsmtm/objc2/issues/668. --- .github/workflows/ci.yml | 2 +- Cargo.lock | 11 +++ crates/header-translator/src/rust_type.rs | 4 +- .../header-translator/src/unexposed_attr.rs | 8 +- .../src/topics/about_generated/CHANGELOG.md | 1 + .../src/topics/about_generated/list_data.md | 1 + crates/test-frameworks/Cargo.toml | 5 ++ .../objc2-compositor-services/Cargo.toml | 89 +++++++++++++++++++ .../objc2-compositor-services/README.md | 14 +++ .../objc2-compositor-services/src/generated | 1 + .../objc2-compositor-services/src/lib.rs | 20 +++++ .../translation-config.toml | 9 ++ generated | 2 +- 13 files changed, 162 insertions(+), 5 deletions(-) create mode 100644 framework-crates/objc2-compositor-services/Cargo.toml create mode 100644 framework-crates/objc2-compositor-services/README.md create mode 120000 framework-crates/objc2-compositor-services/src/generated create mode 100644 framework-crates/objc2-compositor-services/src/lib.rs create mode 100644 framework-crates/objc2-compositor-services/translation-config.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b820afe9..b86569e11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ env: FRAMEWORKS_IOS_17: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-tracking-transparency --package=objc2-ar-kit --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-text --package=objc2-core-video --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-event-kit-ui --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-home-kit --package=objc2-identity-lookup --package=objc2-io-surface --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-message-ui --package=objc2-messages --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-scene-kit --package=objc2-security --package=objc2-sensitive-content-analysis --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-video-toolbox --package=objc2-vision --package=objc2-watch-connectivity --package=objc2-web-kit FRAMEWORKS_TVOS_17: --package=objc2-accessibility --package=objc2-ad-support --package=objc2-app-tracking-transparency --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-avf-audio --package=objc2-background-tasks --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-core-audio --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-text --package=objc2-core-video --package=objc2-data-detection --package=objc2-device-check --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-home-kit --package=objc2-io-surface --package=objc2-link-presentation --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-network-extension --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-scene-kit --package=objc2-security --package=objc2-sound-analysis --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-video-toolbox --package=objc2-vision FRAMEWORKS_MAC_CATALYST_17: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-kit --package=objc2-app-tracking-transparency --package=objc2-ar-kit --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-text --package=objc2-core-video --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-disk-arbitration --package=objc2-event-kit --package=objc2-event-kit-ui --package=objc2-exception-handling --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider-ui --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-home-kit --package=objc2-identity-lookup --package=objc2-io-surface --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-message-ui --package=objc2-messages --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-open-directory --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-scene-kit --package=objc2-security --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-video-toolbox --package=objc2-vision --package=objc2-watch-connectivity --package=objc2-web-kit - FRAMEWORKS_VISIONOS_1: --package=objc2-accessibility --package=objc2-ad-services --package=objc2-app-tracking-transparency --package=objc2-ar-kit --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-text --package=objc2-core-video --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-event-kit-ui --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-home-kit --package=objc2-identity-lookup --package=objc2-io-surface --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-message-ui --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-network-extension --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-scene-kit --package=objc2-security --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-video-toolbox --package=objc2-vision --package=objc2-watch-connectivity --package=objc2-web-kit + FRAMEWORKS_VISIONOS_1: --package=objc2-accessibility --package=objc2-ad-services --package=objc2-app-tracking-transparency --package=objc2-ar-kit --package=objc2-audio-toolbox --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-av-routing --package=objc2-avf-audio --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-compositor-services --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-text --package=objc2-core-video --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-event-kit-ui --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-home-kit --package=objc2-identity-lookup --package=objc2-io-surface --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-message-ui --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metal-performance-shaders --package=objc2-metal-performance-shaders-graph --package=objc2-metric-kit --package=objc2-model-io --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-network-extension --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-scene-kit --package=objc2-security --package=objc2-sound-analysis --package=objc2-speech --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-configuration --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-video-toolbox --package=objc2-vision --package=objc2-watch-connectivity --package=objc2-web-kit FRAMEWORKS_WATCHOS_10: --package=objc2-accessibility --package=objc2-authentication-services --package=objc2-av-foundation --package=objc2-av-kit --package=objc2-avf-audio --package=objc2-call-kit --package=objc2-cloud-kit --package=objc2-color-sync --package=objc2-contacts --package=objc2-core-audio --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-graphics --package=objc2-core-location --package=objc2-core-media --package=objc2-core-midi --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-text --package=objc2-core-video --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-extension-kit --package=objc2-foundation --package=objc2-game-kit --package=objc2-health-kit --package=objc2-home-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-photos-ui --package=objc2-scene-kit --package=objc2-security --package=objc2-sound-analysis --package=objc2-sprite-kit --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-watch-connectivity FRAMEWORKS_GNUSTEP: --package=objc2-app-kit --package=objc2-foundation # END AUTOMATICALLY GENERATED diff --git a/Cargo.lock b/Cargo.lock index 1451ffc10..6d4f748fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -646,6 +646,16 @@ dependencies = [ "objc2-core-foundation", ] +[[package]] +name = "objc2-compositor-services" +version = "0.2.2" +dependencies = [ + "bitflags", + "objc2", + "objc2-core-foundation", + "objc2-metal", +] + [[package]] name = "objc2-contacts" version = "0.2.2" @@ -1852,6 +1862,7 @@ dependencies = [ "objc2-class-kit", "objc2-cloud-kit", "objc2-color-sync", + "objc2-compositor-services", "objc2-contacts", "objc2-contacts-ui", "objc2-core-audio", diff --git a/crates/header-translator/src/rust_type.rs b/crates/header-translator/src/rust_type.rs index 69e20c84b..3c845d464 100644 --- a/crates/header-translator/src/rust_type.rs +++ b/crates/header-translator/src/rust_type.rs @@ -240,12 +240,12 @@ pub enum Primitive { Float, Double, /// Not yet supported by `rustc` - /// https://github.com/rust-lang/rust/issues/116909 + /// F16, F32, F64, /// Not yet supported by `rustc` - /// https://github.com/rust-lang/rust/issues/116909 + /// F128, I8, U8, diff --git a/crates/header-translator/src/unexposed_attr.rs b/crates/header-translator/src/unexposed_attr.rs index 2a4113493..dcc96734a 100644 --- a/crates/header-translator/src/unexposed_attr.rs +++ b/crates/header-translator/src/unexposed_attr.rs @@ -52,7 +52,7 @@ impl UnexposedAttr { let _ = get_arguments(); Some(Self::ClosedEnum) } - "NS_ERROR_ENUM" => { + "NS_ERROR_ENUM" | "CF_ERROR_ENUM" => { let _ = get_arguments(); // TODO: Add error domain here Some(Self::ErrorEnum) @@ -306,6 +306,7 @@ impl UnexposedAttr { "CF_REFINED_FOR_SWIFT" | "DISPATCH_REFINED_FOR_SWIFT" | "NS_REFINED_FOR_SWIFT" + | "AR_REFINED_FOR_SWIFT" | "NS_SWIFT_DISABLE_ASYNC" => None, // Possibly interesting? "DISPATCH_COLD" => None, @@ -321,6 +322,11 @@ impl UnexposedAttr { "objc_non_runtime_protocol" => None, // Emits unavailability attributes on `new` and `init` methods "AV_INIT_UNAVAILABLE" => None, + // Helper used to easy declare @interface in CompositorServices. + "CP_OBJECT_DECL" => { + let _ = get_arguments(); + None + } // Irrelevant, we don't emit dispatch_object_t anyhow. "DISPATCH_TRANSPARENT_UNION" => None, _ => return Err(()), diff --git a/crates/objc2/src/topics/about_generated/CHANGELOG.md b/crates/objc2/src/topics/about_generated/CHANGELOG.md index 65c7695b2..3b371113b 100644 --- a/crates/objc2/src/topics/about_generated/CHANGELOG.md +++ b/crates/objc2/src/topics/about_generated/CHANGELOG.md @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - `AVFAudio` / `objc2-avf-audio`. - `AVFoundation` / `objc2-av-foundation`. - `AVRouting` / `objc2-av-routing`. + - `CompositorServices` / `objc2-compositor-services`. - `CoreAudioTypes` / `objc2-core-audio-types`. - `CoreAudio` / `objc2-core-audio`. - `ColorSync` / `objc2-color-sync`. diff --git a/crates/objc2/src/topics/about_generated/list_data.md b/crates/objc2/src/topics/about_generated/list_data.md index bf707afba..17eea02bb 100644 --- a/crates/objc2/src/topics/about_generated/list_data.md +++ b/crates/objc2/src/topics/about_generated/list_data.md @@ -22,6 +22,7 @@ | `ClassKit` | [![`objc2-class-kit`](https://badgen.net/crates/v/objc2-class-kit)](https://crates.io/crates/objc2-class-kit) | [![docs.rs](https://docs.rs/objc2-class-kit/badge.svg)](https://docs.rs/objc2-class-kit/) | | `CloudKit` | [![`objc2-cloud-kit`](https://badgen.net/crates/v/objc2-cloud-kit)](https://crates.io/crates/objc2-cloud-kit) | [![docs.rs](https://docs.rs/objc2-cloud-kit/badge.svg)](https://docs.rs/objc2-cloud-kit/) | | `ColorSync` | [![`objc2-color-sync`](https://badgen.net/crates/v/objc2-color-sync)](https://crates.io/crates/objc2-color-sync) | [![docs.rs](https://docs.rs/objc2-color-sync/badge.svg)](https://docs.rs/objc2-color-sync/) | +| `CompositorServices` | [![`objc2-compositor-services`](https://badgen.net/crates/v/objc2-compositor-services)](https://crates.io/crates/objc2-compositor-services) | [![docs.rs](https://docs.rs/objc2-compositor-services/badge.svg)](https://docs.rs/objc2-compositor-services/) | | `Contacts` | [![`objc2-contacts`](https://badgen.net/crates/v/objc2-contacts)](https://crates.io/crates/objc2-contacts) | [![docs.rs](https://docs.rs/objc2-contacts/badge.svg)](https://docs.rs/objc2-contacts/) | | `ContactsUI` | [![`objc2-contacts-ui`](https://badgen.net/crates/v/objc2-contacts-ui)](https://crates.io/crates/objc2-contacts-ui) | [![docs.rs](https://docs.rs/objc2-contacts-ui/badge.svg)](https://docs.rs/objc2-contacts-ui/) | | `CoreAudio` | [![`objc2-core-audio`](https://badgen.net/crates/v/objc2-core-audio)](https://crates.io/crates/objc2-core-audio) | [![docs.rs](https://docs.rs/objc2-core-audio/badge.svg)](https://docs.rs/objc2-core-audio/) | diff --git a/crates/test-frameworks/Cargo.toml b/crates/test-frameworks/Cargo.toml index 6bc020ddb..8561f7861 100644 --- a/crates/test-frameworks/Cargo.toml +++ b/crates/test-frameworks/Cargo.toml @@ -56,6 +56,8 @@ test-frameworks = [ "objc2-cloud-kit/all", "dep:objc2-color-sync", "objc2-color-sync/all", + "dep:objc2-compositor-services", + "objc2-compositor-services/all", "dep:objc2-contacts", "objc2-contacts/all", "dep:objc2-contacts-ui", @@ -348,6 +350,9 @@ objc2-event-kit = { path = "../../framework-crates/objc2-event-kit", optional = objc2-health-kit = { path = "../../framework-crates/objc2-health-kit", optional = true } objc2-local-authentication = { path = "../../framework-crates/objc2-local-authentication", optional = true } +[target.'cfg(target_os = "visionos")'.dependencies] +objc2-compositor-services = { path = "../../framework-crates/objc2-compositor-services", optional = true } + [target.'cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))'.dependencies] objc2-home-kit = { path = "../../framework-crates/objc2-home-kit", optional = true } objc2-ui-kit = { path = "../../framework-crates/objc2-ui-kit", optional = true } diff --git a/framework-crates/objc2-compositor-services/Cargo.toml b/framework-crates/objc2-compositor-services/Cargo.toml new file mode 100644 index 000000000..cc4f8dfb5 --- /dev/null +++ b/framework-crates/objc2-compositor-services/Cargo.toml @@ -0,0 +1,89 @@ +# This file has been automatically generated by `objc2`'s `header-translator`. +# DO NOT EDIT + +[package] +name = "objc2-compositor-services" +version.workspace = true +description = "Bindings to the CompositorServices framework" +edition.workspace = true +rust-version.workspace = true +keywords = ["cocoa", "apple", "framework"] +categories.workspace = true +repository.workspace = true +license.workspace = true + +[lints] +workspace = true + +[dependencies] +bitflags = { version = "2.5.0", default-features = false, optional = true } +objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false, optional = true, features = ["std"] } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-metal = { path = "../objc2-metal", version = "0.2.2", default-features = false, optional = true } + +[package.metadata.docs.rs] +default-target = "aarch64-apple-visionos" +features = ["all"] +rustc-args = ["--cfg", "docsrs"] # Fix cross-crate link to objc2::topics +targets = [ + "aarch64-apple-visionos", + "aarch64-apple-visionos-sim", +] + +[features] +default = ["std"] +std = ["alloc", "bitflags?/std"] +alloc = [] +bitflags = ["dep:bitflags", "objc2-core-foundation?/bitflags", "objc2-metal?/bitflags"] +objc2 = ["dep:objc2", "objc2-core-foundation?/objc2"] +objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-metal?/objc2-core-foundation"] +objc2-metal = ["dep:objc2-metal"] + +all = [ + "bitflags", + "cp_base", + "cp_error", + "cp_types", + "drawable", + "frame", + "frame_timing", + "layer_renderer", + "layer_renderer_capabilities", + "layer_renderer_configuration", + "layer_renderer_layout", + "layer_renderer_properties", + "objc2", + "objc2-core-foundation", + "objc2-metal", + "view", +] +cp_base = [] +cp_error = [ + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFError", +] +cp_types = ["objc2-core-foundation?/CFDate"] +drawable = [ + "objc2-metal?/MTLAllocation", + "objc2-metal?/MTLCommandBuffer", + "objc2-metal?/MTLRasterizationRate", + "objc2-metal?/MTLResource", + "objc2-metal?/MTLTexture", +] +frame = [] +frame_timing = [] +layer_renderer = ["objc2-metal?/MTLDevice"] +layer_renderer_capabilities = [ + "bitflags", + "objc2-metal?/MTLPixelFormat", +] +layer_renderer_configuration = [ + "objc2-metal?/MTLPixelFormat", + "objc2-metal?/MTLTexture", +] +layer_renderer_layout = [] +layer_renderer_properties = [ + "objc2-core-foundation?/CFError", + "objc2-metal?/MTLTexture", +] +view = ["objc2-metal?/MTLRenderCommandEncoder"] diff --git a/framework-crates/objc2-compositor-services/README.md b/framework-crates/objc2-compositor-services/README.md new file mode 100644 index 000000000..66b7ecda1 --- /dev/null +++ b/framework-crates/objc2-compositor-services/README.md @@ -0,0 +1,14 @@ +# `objc2-compositor-services` + +[![Latest version](https://badgen.net/crates/v/objc2-compositor-services)](https://crates.io/crates/objc2-compositor-services) +[![License](https://badgen.net/badge/license/MIT/blue)](../LICENSE.txt) +[![Documentation](https://docs.rs/objc2-compositor-services/badge.svg)](https://docs.rs/objc2-compositor-services/) +[![CI](https://github.com/madsmtm/objc2/actions/workflows/ci.yml/badge.svg)](https://github.com/madsmtm/objc2/actions/workflows/ci.yml) + +Rust bindings to Apple's framework CompositorServices. + +This README is kept intentionally small to consolidate the documentation, see +[the Rust docs](https://docs.rs/objc2-compositor-services/) for more details on this crate. + +This crate is part of the [`objc2` project](https://github.com/madsmtm/objc2), +see that for related crates. diff --git a/framework-crates/objc2-compositor-services/src/generated b/framework-crates/objc2-compositor-services/src/generated new file mode 120000 index 000000000..5a82d67f7 --- /dev/null +++ b/framework-crates/objc2-compositor-services/src/generated @@ -0,0 +1 @@ +../../../generated/CompositorServices \ No newline at end of file diff --git a/framework-crates/objc2-compositor-services/src/lib.rs b/framework-crates/objc2-compositor-services/src/lib.rs new file mode 100644 index 000000000..0621883ab --- /dev/null +++ b/framework-crates/objc2-compositor-services/src/lib.rs @@ -0,0 +1,20 @@ +//! # Bindings to the `CompositorServices` framework +//! +//! See [Apple's docs][apple-doc] and [the general docs on framework crates][framework-crates] for more information. +//! +//! [apple-doc]: https://developer.apple.com/documentation/compositorservices/ +//! [framework-crates]: https://docs.rs/objc2/latest/objc2/topics/about_generated/index.html +#![no_std] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +// Update in Cargo.toml as well. +#![doc(html_root_url = "https://docs.rs/objc2-compositor-services/0.2.2")] + +#[cfg(feature = "alloc")] +extern crate alloc; + +#[cfg(feature = "std")] +extern crate std; + +mod generated; +#[allow(unused_imports, unreachable_pub)] +pub use self::generated::*; diff --git a/framework-crates/objc2-compositor-services/translation-config.toml b/framework-crates/objc2-compositor-services/translation-config.toml new file mode 100644 index 000000000..d3e94cf8a --- /dev/null +++ b/framework-crates/objc2-compositor-services/translation-config.toml @@ -0,0 +1,9 @@ +framework = "CompositorServices" +crate = "objc2-compositor-services" +required-crates = ["objc2"] # Currently +visionos = "1.0" + +# ARKit is generated for iOS, and does not include +# the visionOS module required here. +fn.cp_drawable_set_device_anchor.skipped = true +fn.cp_drawable_get_device_anchor.skipped = true diff --git a/generated b/generated index 1db2d50bd..411f8b5d0 160000 --- a/generated +++ b/generated @@ -1 +1 @@ -Subproject commit 1db2d50bd59fddb9babb233d27bb6de1f3f7a305 +Subproject commit 411f8b5d0dddc144bc122575feafc312e61cc9db