From 71be5dcc672b49b7e4e78029e6b3d4862a3f5050 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Tue, 10 Dec 2024 00:32:03 +0100 Subject: [PATCH] Add the CoreVideo framework --- .github/workflows/ci.yml | 26 ++-- Cargo.lock | 14 ++ crates/header-translator/src/rust_type.rs | 24 ++- crates/header-translator/src/stmt.rs | 26 ++-- .../header-translator/src/unexposed_attr.rs | 20 ++- crates/header-translator/system-config.toml | 8 - .../src/topics/about_generated/CHANGELOG.md | 1 + .../src/topics/about_generated/list_data.md | 1 + framework-crates/objc2-core-image/Cargo.toml | 31 +++- .../objc2-core-image/translation-config.toml | 17 --- framework-crates/objc2-core-ml/Cargo.toml | 19 ++- .../objc2-core-ml/translation-config.toml | 6 - framework-crates/objc2-core-video/Cargo.toml | 138 ++++++++++++++++++ framework-crates/objc2-core-video/README.md | 14 ++ .../objc2-core-video/src/generated | 1 + framework-crates/objc2-core-video/src/lib.rs | 25 ++++ .../objc2-core-video/translation-config.toml | 52 +++++++ framework-crates/objc2-vision/Cargo.toml | 26 +++- .../objc2-vision/translation-config.toml | 8 +- generated | 2 +- 20 files changed, 377 insertions(+), 82 deletions(-) create mode 100644 framework-crates/objc2-core-video/Cargo.toml create mode 100644 framework-crates/objc2-core-video/README.md create mode 120000 framework-crates/objc2-core-video/src/generated create mode 100644 framework-crates/objc2-core-video/src/lib.rs create mode 100644 framework-crates/objc2-core-video/translation-config.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ff34f67a..457f83aec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,19 +45,19 @@ env: --package=objc2-exception-helper # BEGIN AUTOMATICALLY GENERATED - FRAMEWORKS_MACOS_10_12: --package=objc2-accounts --package=objc2-automator --package=objc2-av-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-wlan --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-input-method-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-web-kit - FRAMEWORKS_MACOS_10_13: --package=objc2-accounts --package=objc2-automator --package=objc2-av-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-wlan --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-external-accessory --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-input-method-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-vision --package=objc2-web-kit - FRAMEWORKS_MACOS_11: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-support --package=objc2-app-kit --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-business-chat --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit - FRAMEWORKS_MACOS_12: --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-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-business-chat --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit - FRAMEWORKS_MACOS_13: --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-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit - FRAMEWORKS_MACOS_14: --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-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit - FRAMEWORKS_MACOS_15: --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-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit - FRAMEWORKS_IOS_10: --package=objc2-accounts --package=objc2-ad-support --package=objc2-av-kit --package=objc2-call-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-motion --package=objc2-event-kit --package=objc2-external-accessory --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-social --package=objc2-speech --package=objc2-store-kit --package=objc2-ui-kit --package=objc2-user-notifications - FRAMEWORKS_IOS_17: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-kit --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-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --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-identity-lookup --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-metric-kit --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-sensitive-content-analysis --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-vision --package=objc2-web-kit - FRAMEWORKS_TVOS_17: --package=objc2-accessibility --package=objc2-ad-support --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-av-kit --package=objc2-background-tasks --package=objc2-cloud-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --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-link-presentation --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-ml-compute --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-sound-analysis --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --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-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --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-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --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-identity-lookup --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --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-sensitive-content-analysis --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-vision --package=objc2-web-kit - FRAMEWORKS_VISIONOS_1: --package=objc2-accessibility --package=objc2-ad-services --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-kit --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --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-identity-lookup --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --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-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-vision --package=objc2-web-kit - FRAMEWORKS_WATCHOS_10: --package=objc2-accessibility --package=objc2-authentication-services --package=objc2-av-kit --package=objc2-call-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --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-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-sound-analysis --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications + FRAMEWORKS_MACOS_10_12: --package=objc2-accounts --package=objc2-automator --package=objc2-av-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-video --package=objc2-core-wlan --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-input-method-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-web-kit + FRAMEWORKS_MACOS_10_13: --package=objc2-accounts --package=objc2-automator --package=objc2-av-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-video --package=objc2-core-wlan --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-external-accessory --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-input-method-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-store-kit --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_MACOS_11: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-support --package=objc2-app-kit --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-business-chat --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-video --package=objc2-core-wlan --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_MACOS_12: --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-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-business-chat --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-video --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_MACOS_13: --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-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-video --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_MACOS_14: --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-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-video --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_MACOS_15: --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-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --package=objc2-background-assets --package=objc2-business-chat --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-video --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --package=objc2-exception-handling --package=objc2-extension-kit --package=objc2-external-accessory --package=objc2-file-provider --package=objc2-file-provider-ui --package=objc2-finder-sync --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-identity-lookup --package=objc2-input-method-kit --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-mail-kit --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --package=objc2-multipeer-connectivity --package=objc2-natural-language --package=objc2-nearby-interaction --package=objc2-network-extension --package=objc2-osa-kit --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-screen-capture-kit --package=objc2-screen-saver --package=objc2-sensitive-content-analysis --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-system-extensions --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-virtualization --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_IOS_10: --package=objc2-accounts --package=objc2-ad-support --package=objc2-av-kit --package=objc2-call-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-motion --package=objc2-core-video --package=objc2-event-kit --package=objc2-external-accessory --package=objc2-foundation --package=objc2-game-controller --package=objc2-game-kit --package=objc2-health-kit --package=objc2-local-authentication --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-multipeer-connectivity --package=objc2-network-extension --package=objc2-photos --package=objc2-photos-ui --package=objc2-quartz-core --package=objc2-social --package=objc2-speech --package=objc2-store-kit --package=objc2-ui-kit --package=objc2-user-notifications + FRAMEWORKS_IOS_17: --package=objc2-accessibility --package=objc2-accounts --package=objc2-ad-services --package=objc2-ad-support --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-kit --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-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-video --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --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-identity-lookup --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-metric-kit --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-sensitive-content-analysis --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_TVOS_17: --package=objc2-accessibility --package=objc2-ad-support --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-av-kit --package=objc2-background-tasks --package=objc2-cloud-kit --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --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-link-presentation --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-kit --package=objc2-ml-compute --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-sound-analysis --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --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-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-automator --package=objc2-av-kit --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-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-video --package=objc2-core-wlan --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --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-identity-lookup --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --package=objc2-ml-compute --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-sensitive-content-analysis --package=objc2-service-management --package=objc2-social --package=objc2-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_VISIONOS_1: --package=objc2-accessibility --package=objc2-ad-services --package=objc2-app-tracking-transparency --package=objc2-authentication-services --package=objc2-automatic-assessment-configuration --package=objc2-av-kit --package=objc2-background-assets --package=objc2-background-tasks --package=objc2-call-kit --package=objc2-class-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-contacts-ui --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-video --package=objc2-data-detection --package=objc2-device-check --package=objc2-event-kit --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-identity-lookup --package=objc2-link-presentation --package=objc2-local-authentication --package=objc2-local-authentication-embedded-ui --package=objc2-map-kit --package=objc2-media-player --package=objc2-metal --package=objc2-metal-fx --package=objc2-metal-kit --package=objc2-metric-kit --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-sound-analysis --package=objc2-speech --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications --package=objc2-vision --package=objc2-web-kit + FRAMEWORKS_WATCHOS_10: --package=objc2-accessibility --package=objc2-authentication-services --package=objc2-av-kit --package=objc2-call-kit --package=objc2-cloud-kit --package=objc2-contacts --package=objc2-core-audio-types --package=objc2-core-bluetooth --package=objc2-core-data --package=objc2-core-foundation --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --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-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-sound-analysis --package=objc2-store-kit --package=objc2-symbols --package=objc2-ui-kit --package=objc2-uniform-type-identifiers --package=objc2-user-notifications FRAMEWORKS_GNUSTEP: --package=objc2-app-kit --package=objc2-foundation # END AUTOMATICALLY GENERATED diff --git a/Cargo.lock b/Cargo.lock index bed272423..c4651768e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -610,6 +610,7 @@ dependencies = [ "block2", "objc2", "objc2-core-foundation", + "objc2-core-video", "objc2-foundation", "objc2-metal", ] @@ -631,6 +632,7 @@ dependencies = [ "bitflags", "block2", "objc2", + "objc2-core-video", "objc2-foundation", "objc2-metal", ] @@ -646,6 +648,17 @@ dependencies = [ "objc2-foundation", ] +[[package]] +name = "objc2-core-video" +version = "0.2.2" +dependencies = [ + "bitflags", + "block2", + "objc2", + "objc2-core-foundation", + "objc2-metal", +] + [[package]] name = "objc2-core-wlan" version = "0.2.2" @@ -1202,6 +1215,7 @@ dependencies = [ "objc2-core-foundation", "objc2-core-image", "objc2-core-ml", + "objc2-core-video", "objc2-foundation", ] diff --git a/crates/header-translator/src/rust_type.rs b/crates/header-translator/src/rust_type.rs index f8e6b4e49..0d2f633b3 100644 --- a/crates/header-translator/src/rust_type.rs +++ b/crates/header-translator/src/rust_type.rs @@ -473,6 +473,12 @@ impl Ty { // Ignored for now; these are usually also emitted on the method/property, // which is where they will be useful in any case. } + Some(UnexposedAttr::ReturnsRetained) => { + lifetime = Lifetime::Strong; + } + Some(UnexposedAttr::ReturnsNotRetained) => { + lifetime = Lifetime::Autoreleasing; + } Some(attr) => error!(?attr, "unknown attribute on type"), None => {} } @@ -1804,7 +1810,23 @@ impl Ty { ty } - pub(crate) fn parse_function_argument(ty: Type<'_>, context: &Context<'_>) -> Self { + pub(crate) fn parse_function_argument( + ty: Type<'_>, + attr: Option, + context: &Context<'_>, + ) -> Self { + match attr { + Some(UnexposedAttr::NoEscape) => { + // TODO: Use this if mapping `fn + context ptr` to closure. + } + Some(UnexposedAttr::ReturnsRetained) => { + // TODO: Massage this into a lifetime + } + Some(attr) => { + error!(?attr, "unknown attribute in function argument"); + } + None => {} + } Self::parse_method_argument(ty, None, None, false, context) } diff --git a/crates/header-translator/src/stmt.rs b/crates/header-translator/src/stmt.rs index 6c6670f64..c4a9b9719 100644 --- a/crates/header-translator/src/stmt.rs +++ b/crates/header-translator/src/stmt.rs @@ -535,16 +535,16 @@ pub enum Stmt { }, } -fn parse_fn_param_children(entity: &Entity<'_>, context: &Context<'_>) { - immediate_children(entity, |entity, _span| match entity.get_kind() { +fn parse_fn_param_children(parent: &Entity<'_>, context: &Context<'_>) -> Option { + let mut ret = None; + + immediate_children(parent, |entity, _span| match entity.get_kind() { EntityKind::UnexposedAttr => { if let Some(attr) = UnexposedAttr::parse(&entity, context) { - match attr { - UnexposedAttr::NoEscape => { - // TODO: Use this if mapping `fn + context ptr` to closure. - } - _ => error!(?attr, "unknown attribute on fn param"), + if ret.is_some() { + error!("found multiple attributes {ret:?} and {attr:?} on fn param"); } + ret = Some(attr); } } EntityKind::ObjCClassRef @@ -554,8 +554,10 @@ fn parse_fn_param_children(entity: &Entity<'_>, context: &Context<'_>) { EntityKind::NSConsumed => { error!("found NSConsumed, which requires manual handling"); } - kind => error!(?kind, "unknown"), + kind => error!(?parent, ?kind, "unknown"), }); + + ret } pub(crate) fn new_enum_id( @@ -1025,6 +1027,7 @@ impl Stmt { match attr { // TODO UnexposedAttr::Sendable => warn!("sendable typedef"), + UnexposedAttr::NonSendable => warn!("non-sendable typedef"), UnexposedAttr::UIActor => warn!("main-thread-only typedef"), _ => kind = Some(attr), } @@ -1363,7 +1366,8 @@ impl Stmt { UnexposedAttr::UIActor => { warn!("unhandled UIActor on function declaration") } - UnexposedAttr::ReturnsRetained => { + UnexposedAttr::ReturnsRetained + | UnexposedAttr::ReturnsNotRetained => { // TODO: Ignore for now, but at some point handle in a similar way to in methods } _ => error!(?attr, "unknown attribute on function"), @@ -1374,11 +1378,11 @@ impl Stmt { | EntityKind::TypeRef | EntityKind::ObjCProtocolRef => {} EntityKind::ParmDecl => { - parse_fn_param_children(&entity, context); + let attr = parse_fn_param_children(&entity, context); // Could also be retrieved via `get_arguments` let name = entity.get_name().unwrap_or_else(|| "_".into()); let ty = entity.get_type().expect("function argument type"); - let ty = Ty::parse_function_argument(ty, context); + let ty = Ty::parse_function_argument(ty, attr, context); arguments.push((name, ty)) } EntityKind::VisibilityAttr => { diff --git a/crates/header-translator/src/unexposed_attr.rs b/crates/header-translator/src/unexposed_attr.rs index 998e04a15..6f729b9e6 100644 --- a/crates/header-translator/src/unexposed_attr.rs +++ b/crates/header-translator/src/unexposed_attr.rs @@ -65,7 +65,10 @@ impl UnexposedAttr { "NS_SWIFT_BRIDGED_TYPEDEF" | "CF_SWIFT_BRIDGED_TYPEDEF" => Some(Self::BridgedTypedef), "CF_BRIDGED_TYPE" => Some(Self::Bridged), "CF_BRIDGED_MUTABLE_TYPE" => Some(Self::BridgedMutable), - "NS_RETURNS_RETAINED" | "CF_RETURNS_RETAINED" => Some(Self::ReturnsRetained), + "NS_RETURNS_RETAINED" + | "CF_RETURNS_RETAINED" + | "CV_RETURNS_RETAINED" + | "CV_RETURNS_RETAINED_PARAMETER" => Some(Self::ReturnsRetained), "NS_RETURNS_NOT_RETAINED" | "CF_RETURNS_NOT_RETAINED" => Some(Self::ReturnsNotRetained), "NS_RETURNS_INNER_POINTER" => None, // This has two arguments: `sendability` and `nullability`. @@ -76,8 +79,8 @@ impl UnexposedAttr { let _ = get_arguments(); None } - "NS_SWIFT_SENDABLE" | "AS_SWIFT_SENDABLE" => Some(Self::Sendable), - "NS_SWIFT_NONSENDABLE" => Some(Self::NonSendable), + "NS_SWIFT_SENDABLE" | "AS_SWIFT_SENDABLE" | "CV_SWIFT_SENDABLE" => Some(Self::Sendable), + "NS_SWIFT_NONSENDABLE" | "CV_SWIFT_NONSENDABLE" => Some(Self::NonSendable), "NS_SWIFT_UI_ACTOR" | "WK_SWIFT_UI_ACTOR" => Some(Self::UIActor), "NS_SWIFT_NONISOLATED" | "UIKIT_SWIFT_ACTOR_INDEPENDENT" => Some(Self::NonIsolated), // TODO @@ -106,6 +109,7 @@ impl UnexposedAttr { | "__IOS_AVAILABLE" | "__IOS_DEPRECATED" | "__OSX_AVAILABLE" + | "__OSX_AVAILABLE_BUT_DEPRECATED" | "__OSX_AVAILABLE_STARTING" | "__OSX_DEPRECATED" | "__TVOS_AVAILABLE" @@ -132,6 +136,7 @@ impl UnexposedAttr { | "CIKL_DEPRECATED" | "CK_UNAVAILABLE" | "CK_NEWLY_UNAVAILABLE" + | "COREVIDEO_GL_DEPRECATED" | "FPUI_AVAILABLE" | "MLCOMPUTE_AVAILABLE_STARTING" | "MLCOMPUTE_AVAILABLE_STARTING_BUT_DEPRECATED_MACOS14" @@ -190,7 +195,6 @@ impl UnexposedAttr { "AS_API_AVAILABLE" | "AS_HEADER_AUDIT_BEGIN" => None, "__IOS_PROHIBITED" | "__IOS_UNAVAILABLE" - | "__OSX_AVAILABLE_BUT_DEPRECATED" | "__OSX_UNAVAILABLE" | "__TVOS_PROHIBITED" | "__TVOS_UNAVAILABLE" @@ -231,6 +235,14 @@ impl UnexposedAttr { | "NS_REFINED_FOR_SWIFT" | "NS_SWIFT_DISABLE_ASYNC" | "NS_SWIFT_NOTHROW" => None, + "CF_CONSUMED" + | "CF_RELEASES_ARGUMENT" + | "NS_RELEASES_ARGUMENT" + | "CM_RELEASES_ARGUMENT" + | "CV_RELEASES_ARGUMENT" => { + error!(?s, "attribute that requires manual handling. Mark it as skipped in translation-config.toml"); + None + } _ => return Err(()), }) } diff --git a/crates/header-translator/system-config.toml b/crates/header-translator/system-config.toml index b38967e11..3f214c0bf 100644 --- a/crates/header-translator/system-config.toml +++ b/crates/header-translator/system-config.toml @@ -21,14 +21,6 @@ class.NSObject.methods.release.skipped = true fn.IOServiceGetMatchingService.skipped = true fn.IOServiceGetMatchingServices.skipped = true fn.IOServiceAddMatchingNotification.skipped = true -fn.CVOpenGLBufferRelease.skipped = true -fn.CVDisplayLinkRelease.skipped = true -fn.CVOpenGLBufferPoolRelease.skipped = true -fn.CVOpenGLTextureRelease.skipped = true -fn.CVPixelBufferPoolRelease.skipped = true -fn.CVPixelBufferRelease.skipped = true -fn.CVOpenGLTextureCacheRelease.skipped = true -fn.CVBufferRelease.skipped = true # + a few methods from DriverKit.framework and Kernel.framework, but those # are written in C++, so we're not going to ever handle them anyhow. diff --git a/crates/objc2/src/topics/about_generated/CHANGELOG.md b/crates/objc2/src/topics/about_generated/CHANGELOG.md index 20cf8b7a5..98b08ac08 100644 --- a/crates/objc2/src/topics/about_generated/CHANGELOG.md +++ b/crates/objc2/src/topics/about_generated/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Added new framework crates: - `CoreAudioTypes` / `objc2-core-audio-types`. - `CoreFoundation` / `objc2-core-foundation`. + - `CoreVideo` / `objc2-core-video`. - `ScreenSaver` / `objc2-screen-saver`. ### Changed diff --git a/crates/objc2/src/topics/about_generated/list_data.md b/crates/objc2/src/topics/about_generated/list_data.md index 69f399f2c..e2da3a23e 100644 --- a/crates/objc2/src/topics/about_generated/list_data.md +++ b/crates/objc2/src/topics/about_generated/list_data.md @@ -26,6 +26,7 @@ | `CoreLocation` | [![`objc2-core-location`](https://badgen.net/crates/v/objc2-core-location)](https://crates.io/crates/objc2-core-location) | [![docs.rs](https://docs.rs/objc2-core-location/badge.svg)](https://docs.rs/objc2-core-location/) | | `CoreML` | [![`objc2-core-ml`](https://badgen.net/crates/v/objc2-core-ml)](https://crates.io/crates/objc2-core-ml) | [![docs.rs](https://docs.rs/objc2-core-ml/badge.svg)](https://docs.rs/objc2-core-ml/) | | `CoreMotion` | [![`objc2-core-motion`](https://badgen.net/crates/v/objc2-core-motion)](https://crates.io/crates/objc2-core-motion) | [![docs.rs](https://docs.rs/objc2-core-motion/badge.svg)](https://docs.rs/objc2-core-motion/) | +| `CoreVideo` | [![`objc2-core-video`](https://badgen.net/crates/v/objc2-core-video)](https://crates.io/crates/objc2-core-video) | [![docs.rs](https://docs.rs/objc2-core-video/badge.svg)](https://docs.rs/objc2-core-video/) | | `CoreWLAN` | [![`objc2-core-wlan`](https://badgen.net/crates/v/objc2-core-wlan)](https://crates.io/crates/objc2-core-wlan) | [![docs.rs](https://docs.rs/objc2-core-wlan/badge.svg)](https://docs.rs/objc2-core-wlan/) | | `DataDetection` | [![`objc2-data-detection`](https://badgen.net/crates/v/objc2-data-detection)](https://crates.io/crates/objc2-data-detection) | [![docs.rs](https://docs.rs/objc2-data-detection/badge.svg)](https://docs.rs/objc2-data-detection/) | | `DeviceCheck` | [![`objc2-device-check`](https://badgen.net/crates/v/objc2-device-check)](https://crates.io/crates/objc2-device-check) | [![docs.rs](https://docs.rs/objc2-device-check/badge.svg)](https://docs.rs/objc2-device-check/) | diff --git a/framework-crates/objc2-core-image/Cargo.toml b/framework-crates/objc2-core-image/Cargo.toml index 47a0c1cf3..5920b90ee 100644 --- a/framework-crates/objc2-core-image/Cargo.toml +++ b/framework-crates/objc2-core-image/Cargo.toml @@ -19,6 +19,7 @@ workspace = true block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } +objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } objc2-metal = { path = "../objc2-metal", version = "0.2.2", default-features = false, optional = true } @@ -37,17 +38,18 @@ targets = [ default = ["std"] # Currently not possible to turn off, put here for forwards compatibility. -std = ["alloc", "block2?/std", "objc2/std", "objc2-core-foundation?/std", "objc2-foundation/std", "objc2-metal?/std"] -alloc = ["block2?/alloc", "objc2/alloc", "objc2-core-foundation?/alloc", "objc2-foundation/alloc", "objc2-metal?/alloc"] +std = ["alloc", "block2?/std", "objc2/std", "objc2-core-foundation?/std", "objc2-core-video?/std", "objc2-foundation/std", "objc2-metal?/std"] +alloc = ["block2?/alloc", "objc2/alloc", "objc2-core-foundation?/alloc", "objc2-core-video?/alloc", "objc2-foundation/alloc", "objc2-metal?/alloc"] apple = [] gnustep-1-7 = ["objc2/gnustep-1-7", "block2?/gnustep-1-7", "objc2-foundation/gnustep-1-7"] gnustep-1-8 = ["gnustep-1-7", "objc2/gnustep-1-8", "block2?/gnustep-1-8", "objc2-foundation/gnustep-1-8"] gnustep-1-9 = ["gnustep-1-8", "objc2/gnustep-1-9", "block2?/gnustep-1-9", "objc2-foundation/gnustep-1-9"] gnustep-2-0 = ["gnustep-1-9", "objc2/gnustep-2-0", "block2?/gnustep-2-0", "objc2-foundation/gnustep-2-0"] gnustep-2-1 = ["gnustep-2-0", "objc2/gnustep-2-1", "block2?/gnustep-2-1", "objc2-foundation/gnustep-2-1"] -block2 = ["dep:block2", "objc2-core-foundation?/block2", "objc2-foundation/block2", "objc2-metal?/block2"] -objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-foundation/objc2-core-foundation", "objc2-metal?/objc2-core-foundation"] -objc2-metal = ["dep:objc2-metal"] +block2 = ["dep:block2", "objc2-core-foundation?/block2", "objc2-core-video?/block2", "objc2-foundation/block2", "objc2-metal?/block2"] +objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-core-video?/objc2-core-foundation", "objc2-foundation/objc2-core-foundation", "objc2-metal?/objc2-core-foundation"] +objc2-core-video = ["dep:objc2-core-video"] +objc2-metal = ["dep:objc2-metal", "objc2-core-video?/objc2-metal"] CIBarcodeDescriptor = [ "objc2-foundation/NSData", @@ -61,6 +63,9 @@ CIColor = [ ] CIContext = [ "objc2-core-foundation?/CFCGTypes", + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSData", "objc2-foundation/NSDictionary", "objc2-foundation/NSError", @@ -102,6 +107,9 @@ CIFilterShape = [ ] CIImage = [ "objc2-core-foundation?/CFCGTypes", + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSArray", "objc2-foundation/NSData", "objc2-foundation/NSDictionary", @@ -115,6 +123,9 @@ CIImage = [ CIImageAccumulator = ["objc2-core-foundation?/CFCGTypes"] CIImageProcessor = [ "objc2-core-foundation?/CFCGTypes", + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSArray", "objc2-foundation/NSDictionary", "objc2-foundation/NSError", @@ -137,6 +148,9 @@ CIPlugIn = ["objc2-foundation/NSURL"] CIPlugInInterface = [] CIRAWFilter = [ "objc2-core-foundation?/CFCGTypes", + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSArray", "objc2-foundation/NSData", "objc2-foundation/NSDictionary", @@ -145,6 +159,9 @@ CIRAWFilter = [ "objc2-foundation/NSURL", ] CIRAWFilter_Deprecated = [ + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSArray", "objc2-foundation/NSData", "objc2-foundation/NSDictionary", @@ -153,6 +170,9 @@ CIRAWFilter_Deprecated = [ ] CIRenderDestination = [ "objc2-core-foundation?/CFCGTypes", + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSDate", "objc2-foundation/NSError", "objc2-metal?/MTLAllocation", @@ -199,5 +219,6 @@ all = [ "CoreImageDefines", "block2", "objc2-core-foundation", + "objc2-core-video", "objc2-metal", ] diff --git a/framework-crates/objc2-core-image/translation-config.toml b/framework-crates/objc2-core-image/translation-config.toml index 57c610fa8..d01ffe386 100644 --- a/framework-crates/objc2-core-image/translation-config.toml +++ b/framework-crates/objc2-core-image/translation-config.toml @@ -107,20 +107,3 @@ class.CIRenderDestination.methods."setColorSpace:".skipped = true class.CIVector.methods."vectorWithCGAffineTransform:".skipped = true class.CIVector.methods."initWithCGAffineTransform:".skipped = true class.CIVector.methods.CGAffineTransformValue.skipped = true - -# Needs CoreVideo -class.CIContext.methods."render:toCVPixelBuffer:".skipped = true -class.CIImage.methods."imageWithCVImageBuffer:".skipped = true -class.CIImage.methods."imageWithCVImageBuffer:options:".skipped = true -class.CIImage.methods."imageWithCVPixelBuffer:".skipped = true -class.CIImage.methods."imageWithCVPixelBuffer:options:".skipped = true -class.CIImage.methods."initWithCVImageBuffer:".skipped = true -class.CIImage.methods."initWithCVImageBuffer:options:".skipped = true -class.CIImage.methods."initWithCVPixelBuffer:".skipped = true -class.CIImage.methods."initWithCVPixelBuffer:options:".skipped = true -class.CIImage.methods.pixelBuffer.skipped = true -protocol.CIImageProcessorInput.methods.pixelBuffer.skipped = true -protocol.CIImageProcessorOutput.methods.pixelBuffer.skipped = true -class.CIFilter.methods."filterWithCVPixelBuffer:properties:options:".skipped = true -class.CIRAWFilter.methods."filterWithCVPixelBuffer:properties:".skipped = true -class.CIRenderDestination.methods."initWithPixelBuffer:".skipped = true diff --git a/framework-crates/objc2-core-ml/Cargo.toml b/framework-crates/objc2-core-ml/Cargo.toml index 807a7b6db..47a25681a 100644 --- a/framework-crates/objc2-core-ml/Cargo.toml +++ b/framework-crates/objc2-core-ml/Cargo.toml @@ -19,6 +19,7 @@ workspace = true bitflags = { version = "2.5.0", default-features = false, optional = true } block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } +objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [target.'cfg(not(target_os = "watchos"))'.dependencies] @@ -40,11 +41,12 @@ targets = [ default = ["std"] # Currently not possible to turn off, put here for forwards compatibility. -std = ["alloc", "bitflags?/std", "block2?/std", "objc2/std", "objc2-foundation/std", "objc2-metal?/std"] -alloc = ["block2?/alloc", "objc2/alloc", "objc2-foundation/alloc", "objc2-metal?/alloc"] -bitflags = ["dep:bitflags", "objc2-foundation/bitflags", "objc2-metal?/bitflags"] -block2 = ["dep:block2", "objc2-foundation/block2", "objc2-metal?/block2"] -objc2-metal = ["dep:objc2-metal"] +std = ["alloc", "bitflags?/std", "block2?/std", "objc2/std", "objc2-core-video?/std", "objc2-foundation/std", "objc2-metal?/std"] +alloc = ["block2?/alloc", "objc2/alloc", "objc2-core-video?/alloc", "objc2-foundation/alloc", "objc2-metal?/alloc"] +bitflags = ["dep:bitflags", "objc2-core-video?/bitflags", "objc2-foundation/bitflags", "objc2-metal?/bitflags"] +block2 = ["dep:block2", "objc2-core-video?/block2", "objc2-foundation/block2", "objc2-metal?/block2"] +objc2-core-video = ["dep:objc2-core-video"] +objc2-metal = ["dep:objc2-metal", "objc2-core-video?/objc2-metal"] MLAllComputeDevices = ["objc2-foundation/NSArray"] MLArrayBatchProvider = [ @@ -98,6 +100,9 @@ MLFeatureProvider = [ ] MLFeatureType = [] MLFeatureValue = [ + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSDictionary", "objc2-foundation/NSError", "objc2-foundation/NSObject", @@ -200,6 +205,9 @@ MLModel_MLModelCompilation = [ ] MLModel_MLState = ["objc2-foundation/NSError"] MLMultiArray = [ + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSArray", "objc2-foundation/NSError", "objc2-foundation/NSObject", @@ -340,5 +348,6 @@ all = [ "MLWritable", "bitflags", "block2", + "objc2-core-video", "objc2-metal", ] diff --git a/framework-crates/objc2-core-ml/translation-config.toml b/framework-crates/objc2-core-ml/translation-config.toml index db275ff5b..5d8fda049 100644 --- a/framework-crates/objc2-core-ml/translation-config.toml +++ b/framework-crates/objc2-core-ml/translation-config.toml @@ -8,12 +8,6 @@ tvos = "11.0" watchos = "4.0" visionos = "1.0" -# Needs CoreVideo -class.MLFeatureValue.methods.imageBufferValue.skipped = true -class.MLFeatureValue.methods."featureValueWithPixelBuffer:".skipped = true -class.MLMultiArray.methods.pixelBuffer.skipped = true -class.MLMultiArray.methods."initWithPixelBuffer:shape:".skipped = true - # Needs CoreGraphics class.MLFeatureValue.methods."featureValueWithCGImage:pixelsWide:pixelsHigh:pixelFormatType:options:error:".skipped = true class.MLFeatureValue.methods."featureValueWithCGImage:constraint:options:error:".skipped = true diff --git a/framework-crates/objc2-core-video/Cargo.toml b/framework-crates/objc2-core-video/Cargo.toml new file mode 100644 index 000000000..98dbcb47c --- /dev/null +++ b/framework-crates/objc2-core-video/Cargo.toml @@ -0,0 +1,138 @@ +# This file has been automatically generated by `objc2`'s `header-translator`. +# DO NOT EDIT + +[package] +name = "objc2-core-video" +version.workspace = true +description = "Bindings to the CoreVideo framework" +edition.workspace = true +rust-version.workspace = true +keywords = ["cocoa", "apple", "framework", "macos", "ios"] +categories.workspace = true +repository.workspace = true +license.workspace = true + +[lints] +workspace = true + +[dependencies] +bitflags = { version = "2.5.0", default-features = false, optional = true } +block2 = { path = "../../crates/block2", version = "0.5.1", default-features = false, optional = true } +objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = false } +objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } + +[target.'cfg(not(target_os = "watchos"))'.dependencies] +objc2-metal = { path = "../objc2-metal", version = "0.2.2", default-features = false, optional = true } + +[package.metadata.docs.rs] +default-target = "aarch64-apple-darwin" +features = ["all"] +targets = [ + "aarch64-apple-darwin", + "x86_64-apple-darwin", + "aarch64-apple-ios", + "aarch64-apple-tvos", + "aarch64-apple-watchos", + "aarch64-apple-ios-macabi", +] + +[features] +default = ["std"] + +# Currently not possible to turn off, put here for forwards compatibility. +std = ["alloc", "bitflags?/std", "block2?/std", "objc2/std", "objc2-core-foundation?/std", "objc2-metal?/std"] +alloc = ["block2?/alloc", "objc2/alloc", "objc2-core-foundation?/alloc", "objc2-metal?/alloc"] +bitflags = ["dep:bitflags", "objc2-core-foundation?/bitflags", "objc2-metal?/bitflags"] +block2 = ["dep:block2", "objc2-core-foundation?/block2", "objc2-metal?/block2"] +objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-metal?/objc2-core-foundation"] +objc2-metal = ["dep:objc2-metal"] + +CVBase = ["bitflags"] +CVBuffer = [ + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", +] +CVDisplayLink = ["objc2-core-foundation?/CFBase"] +CVHostTime = [] +CVImageBuffer = [ + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFCGTypes", +] +CVMetalBuffer = [ + "objc2-core-foundation?/CFBase", + "objc2-metal?/MTLAllocation", + "objc2-metal?/MTLBuffer", + "objc2-metal?/MTLResource", +] +CVMetalBufferCache = [ + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", + "objc2-metal?/MTLDevice", +] +CVMetalTexture = [ + "objc2-core-foundation?/CFBase", + "objc2-metal?/MTLAllocation", + "objc2-metal?/MTLResource", + "objc2-metal?/MTLTexture", +] +CVMetalTextureCache = [ + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", + "objc2-metal?/MTLDevice", + "objc2-metal?/MTLPixelFormat", +] +CVOpenGLBuffer = [ + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", +] +CVOpenGLBufferPool = [ + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", +] +CVOpenGLTexture = ["objc2-core-foundation?/CFBase"] +CVOpenGLTextureCache = [ + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", +] +CVPixelBuffer = [ + "bitflags", + "objc2-core-foundation?/CFArray", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", +] +CVPixelBufferIOSurface = ["objc2-core-foundation?/CFBase"] +CVPixelBufferPool = [ + "bitflags", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", +] +CVPixelFormatDescription = [ + "objc2-core-foundation?/CFArray", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", +] +CVReturn = [] +all = [ + "CVBase", + "CVBuffer", + "CVDisplayLink", + "CVHostTime", + "CVImageBuffer", + "CVMetalBuffer", + "CVMetalBufferCache", + "CVMetalTexture", + "CVMetalTextureCache", + "CVOpenGLBuffer", + "CVOpenGLBufferPool", + "CVOpenGLTexture", + "CVOpenGLTextureCache", + "CVPixelBuffer", + "CVPixelBufferIOSurface", + "CVPixelBufferPool", + "CVPixelFormatDescription", + "CVReturn", + "bitflags", + "block2", + "objc2-core-foundation", + "objc2-metal", +] diff --git a/framework-crates/objc2-core-video/README.md b/framework-crates/objc2-core-video/README.md new file mode 100644 index 000000000..36e743f68 --- /dev/null +++ b/framework-crates/objc2-core-video/README.md @@ -0,0 +1,14 @@ +# `objc2-core-video` + +[![Latest version](https://badgen.net/crates/v/objc2-core-video)](https://crates.io/crates/objc2-core-video) +[![License](https://badgen.net/badge/license/MIT/blue)](../LICENSE.txt) +[![Documentation](https://docs.rs/objc2-core-video/badge.svg)](https://docs.rs/objc2-core-video/) +[![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 CoreVideo. + +This README is kept intentionally small to consolidate the documentation, see +[the Rust docs](https://docs.rs/objc2-core-video/) 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-core-video/src/generated b/framework-crates/objc2-core-video/src/generated new file mode 120000 index 000000000..61ef153c5 --- /dev/null +++ b/framework-crates/objc2-core-video/src/generated @@ -0,0 +1 @@ +../../../generated/CoreVideo \ No newline at end of file diff --git a/framework-crates/objc2-core-video/src/lib.rs b/framework-crates/objc2-core-video/src/lib.rs new file mode 100644 index 000000000..ef1e3f9e0 --- /dev/null +++ b/framework-crates/objc2-core-video/src/lib.rs @@ -0,0 +1,25 @@ +//! # Bindings to the `CoreVideo` 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/corevideo/ +//! [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-core-video/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::*; + +#[allow(dead_code)] +pub(crate) type Boolean = u8; +#[allow(dead_code)] +pub(crate) type OSType = u32; diff --git a/framework-crates/objc2-core-video/translation-config.toml b/framework-crates/objc2-core-video/translation-config.toml new file mode 100644 index 000000000..46c7a7643 --- /dev/null +++ b/framework-crates/objc2-core-video/translation-config.toml @@ -0,0 +1,52 @@ +framework = "CoreVideo" +crate = "objc2-core-video" +required-dependencies = [] +custom-lib-rs = true +macos = "10.4" +maccatalyst = "13.0" +ios = "4.0" +tvos = "9.0" +watchos = "4.0" +visionos = "1.0" + +# `cf_consumed`, requires manual handling +fn.CVOpenGLBufferRelease.skipped = true +fn.CVDisplayLinkRelease.skipped = true +fn.CVOpenGLBufferPoolRelease.skipped = true +fn.CVOpenGLTextureRelease.skipped = true +fn.CVPixelBufferPoolRelease.skipped = true +fn.CVPixelBufferRelease.skipped = true +fn.CVOpenGLTextureCacheRelease.skipped = true +fn.CVBufferRelease.skipped = true + +# Needs CGLContextObj, CGLPixelFormatObj etc. from OpenGL +fn.CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext.skipped = true +fn.CVOpenGLBufferAttach.skipped = true +fn.CVOpenGLTextureCacheCreate.skipped = true +fn.CVOpenGLTextureGetTarget.skipped = true +fn.CVOpenGLTextureGetName.skipped = true + +# Needs OpenGLES +typedef.CVEAGLContext.skipped = true +fn.CVOpenGLESTextureCacheCreate.skipped = true +fn.CVOpenGLESTextureCacheCreateTextureFromImage.skipped = true +fn.CVOpenGLESTextureGetTarget.skipped = true +fn.CVOpenGLESTextureGetName.skipped = true + +# Needs CoreGraphics +fn.CVDisplayLinkCreateWithOpenGLDisplayMask.skipped = true +fn.CVDisplayLinkCreateWithCGDisplays.skipped = true +fn.CVDisplayLinkCreateWithCGDisplay.skipped = true +fn.CVDisplayLinkSetCurrentCGDisplay.skipped = true +fn.CVDisplayLinkGetCurrentCGDisplay.skipped = true +fn.CVImageBufferGetColorSpace.skipped = true +fn.CVImageBufferCreateColorSpaceFromAttachments.skipped = true + +# Needs IOSurfaceRef from IOSurface +fn.CVPixelBufferGetIOSurface.skipped = true +fn.CVPixelBufferCreateWithIOSurface.skipped = true + +# Unknown how to handle the calling convention here? +fn.CVMetalTextureGetCleanTexCoords.skipped = true +fn.CVOpenGLTextureGetCleanTexCoords.skipped = true +fn.CVOpenGLESTextureGetCleanTexCoords.skipped = true diff --git a/framework-crates/objc2-vision/Cargo.toml b/framework-crates/objc2-vision/Cargo.toml index 25c130e34..584014af8 100644 --- a/framework-crates/objc2-vision/Cargo.toml +++ b/framework-crates/objc2-vision/Cargo.toml @@ -21,6 +21,7 @@ objc2 = { path = "../../crates/objc2", version = "0.5.2", default-features = fal objc2-core-foundation = { path = "../objc2-core-foundation", version = "0.2.2", default-features = false, optional = true } objc2-core-image = { path = "../objc2-core-image", version = "0.2.2", default-features = false, optional = true } objc2-core-ml = { path = "../objc2-core-ml", version = "0.2.2", default-features = false, optional = true } +objc2-core-video = { path = "../objc2-core-video", version = "0.2.2", default-features = false, optional = true } objc2-foundation = { path = "../objc2-foundation", version = "0.2.2", default-features = false } [package.metadata.docs.rs] @@ -38,12 +39,13 @@ targets = [ default = ["std"] # Currently not possible to turn off, put here for forwards compatibility. -std = ["alloc", "block2?/std", "objc2/std", "objc2-core-foundation?/std", "objc2-core-image?/std", "objc2-core-ml?/std", "objc2-foundation/std"] -alloc = ["block2?/alloc", "objc2/alloc", "objc2-core-foundation?/alloc", "objc2-core-image?/alloc", "objc2-core-ml?/alloc", "objc2-foundation/alloc"] -block2 = ["dep:block2", "objc2-core-foundation?/block2", "objc2-core-image?/block2", "objc2-core-ml?/block2", "objc2-foundation/block2"] -objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-core-image?/objc2-core-foundation", "objc2-foundation/objc2-core-foundation"] +std = ["alloc", "block2?/std", "objc2/std", "objc2-core-foundation?/std", "objc2-core-image?/std", "objc2-core-ml?/std", "objc2-core-video?/std", "objc2-foundation/std"] +alloc = ["block2?/alloc", "objc2/alloc", "objc2-core-foundation?/alloc", "objc2-core-image?/alloc", "objc2-core-ml?/alloc", "objc2-core-video?/alloc", "objc2-foundation/alloc"] +block2 = ["dep:block2", "objc2-core-foundation?/block2", "objc2-core-image?/block2", "objc2-core-ml?/block2", "objc2-core-video?/block2", "objc2-foundation/block2"] +objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-core-image?/objc2-core-foundation", "objc2-core-video?/objc2-core-foundation", "objc2-foundation/objc2-core-foundation"] objc2-core-image = ["dep:objc2-core-image"] objc2-core-ml = ["dep:objc2-core-ml"] +objc2-core-video = ["dep:objc2-core-video", "objc2-core-image?/objc2-core-video", "objc2-core-ml?/objc2-core-video"] VNCalculateImageAestheticsScoresRequest = [ "objc2-foundation/NSArray", @@ -182,6 +184,9 @@ VNGenerateObjectnessBasedSaliencyImageRequest = [ ] VNGenerateOpticalFlowRequest = [ "objc2-core-image?/CIImage", + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSArray", "objc2-foundation/NSData", "objc2-foundation/NSDictionary", @@ -218,6 +223,9 @@ VNHumanBodyRecognizedPoint3D = [ ] VNImageRegistrationRequest = [ "objc2-core-image?/CIImage", + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSArray", "objc2-foundation/NSData", "objc2-foundation/NSDictionary", @@ -231,6 +239,9 @@ VNObservation = [ "objc2-core-image?/CIBarcodeDescriptor", "objc2-core-ml?/MLFeatureValue", "objc2-core-ml?/MLMultiArray", + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSArray", "objc2-foundation/NSData", "objc2-foundation/NSDictionary", @@ -271,6 +282,9 @@ VNRequest = [ ] VNRequestHandler = [ "objc2-core-image?/CIImage", + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSArray", "objc2-foundation/NSData", "objc2-foundation/NSDictionary", @@ -285,6 +299,9 @@ VNStatefulRequest = [ ] VNTargetedImageRequest = [ "objc2-core-image?/CIImage", + "objc2-core-video?/CVBuffer", + "objc2-core-video?/CVImageBuffer", + "objc2-core-video?/CVPixelBuffer", "objc2-foundation/NSData", "objc2-foundation/NSDictionary", "objc2-foundation/NSError", @@ -386,4 +403,5 @@ all = [ "objc2-core-foundation", "objc2-core-image", "objc2-core-ml", + "objc2-core-video", ] diff --git a/framework-crates/objc2-vision/translation-config.toml b/framework-crates/objc2-vision/translation-config.toml index b35ebc773..657c85722 100644 --- a/framework-crates/objc2-vision/translation-config.toml +++ b/framework-crates/objc2-vision/translation-config.toml @@ -40,16 +40,10 @@ class.VNTargetedImageRequest.methods."initWithTargetedCMSampleBuffer:options:com class.VNVideoProcessor.methods."analyzeTimeRange:error:".skipped = true class.VNVideoProcessor.methods."analyzeWithTimeRange:error:".skipped = true -# Needs CoreVideo -class.VNTargetedImageRequest.methods."initWithTargetedCVPixelBuffer:options:".skipped = true -class.VNTargetedImageRequest.methods."initWithTargetedCVPixelBuffer:options:completionHandler:".skipped = true -class.VNPixelBufferObservation.methods.pixelBuffer.skipped = true -class.VNInstanceMaskObservation.methods.instanceMask.skipped = true +# Needs CoreVideo to have proper retain semantics class.VNInstanceMaskObservation.methods."generateMaskForInstances:error:".skipped = true class.VNInstanceMaskObservation.methods."generateMaskedImageOfInstances:fromRequestHandler:croppedToInstancesExtent:error:".skipped = true class.VNInstanceMaskObservation.methods."generateScaledMaskForImageForInstances:fromRequestHandler:error:".skipped = true -class.VNImageRequestHandler.methods."initWithCVPixelBuffer:options:".skipped = true -class.VNSequenceRequestHandler.methods."performRequests:onCVPixelBuffer:error:".skipped = true # Needs CoreGraphics class.VNContour.methods.normalizedPath.skipped = true diff --git a/generated b/generated index daed81afc..87f300566 160000 --- a/generated +++ b/generated @@ -1 +1 @@ -Subproject commit daed81afc74c1482c156e7af5f07dcf0784d76fe +Subproject commit 87f3005663f84e93726cb06bca6cc5e2304d4487