From bfd660061e14a5f1807c015ef5fe6790f21ec3c7 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Tue, 10 Dec 2024 04:14:57 +0100 Subject: [PATCH] Add the CoreText framework --- .github/workflows/ci.yml | 26 +-- Cargo.lock | 12 ++ crates/header-translator/src/expr.rs | 3 +- crates/header-translator/src/stmt.rs | 28 +-- .../header-translator/src/unexposed_attr.rs | 7 + .../src/topics/about_generated/CHANGELOG.md | 1 + .../src/topics/about_generated/list_data.md | 1 + .../objc2-app-kit/translation-config.toml | 2 +- framework-crates/objc2-core-text/Cargo.toml | 182 ++++++++++++++++++ framework-crates/objc2-core-text/README.md | 14 ++ .../objc2-core-text/src/generated | 1 + .../objc2-core-text/src/invalid.rs | 25 +++ framework-crates/objc2-core-text/src/lib.rs | 37 ++++ .../objc2-core-text/src/sfnt_lookup_header.rs | 46 +++++ .../objc2-core-text/translation-config.toml | 47 +++++ .../objc2-ui-kit/translation-config.toml | 2 +- generated | 2 +- 17 files changed, 406 insertions(+), 30 deletions(-) create mode 100644 framework-crates/objc2-core-text/Cargo.toml create mode 100644 framework-crates/objc2-core-text/README.md create mode 120000 framework-crates/objc2-core-text/src/generated create mode 100644 framework-crates/objc2-core-text/src/invalid.rs create mode 100644 framework-crates/objc2-core-text/src/lib.rs create mode 100644 framework-crates/objc2-core-text/src/sfnt_lookup_header.rs create mode 100644 framework-crates/objc2-core-text/translation-config.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f8b26ee1..fe82f1266 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-graphics --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-graphics --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-graphics --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-graphics --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-graphics --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-graphics --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-graphics --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-graphics --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-graphics --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-graphics --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-graphics --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-graphics --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-graphics --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_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-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-text --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-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-text --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-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-ml --package=objc2-core-motion --package=objc2-core-text --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-graphics --package=objc2-core-image --package=objc2-core-location --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-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-graphics --package=objc2-core-image --package=objc2-core-location --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-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-graphics --package=objc2-core-image --package=objc2-core-location --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-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-graphics --package=objc2-core-image --package=objc2-core-location --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-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-graphics --package=objc2-core-image --package=objc2-core-location --package=objc2-core-motion --package=objc2-core-text --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-graphics --package=objc2-core-image --package=objc2-core-location --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-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-graphics --package=objc2-core-image --package=objc2-core-location --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-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-graphics --package=objc2-core-image --package=objc2-core-location --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-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-graphics --package=objc2-core-image --package=objc2-core-location --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-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-graphics --package=objc2-core-location --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-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 a4d7e923a..d42cbf1b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -665,6 +665,18 @@ dependencies = [ "objc2-foundation", ] +[[package]] +name = "objc2-core-text" +version = "0.2.2" +dependencies = [ + "bitflags", + "block2", + "libc", + "objc2", + "objc2-core-foundation", + "objc2-core-graphics", +] + [[package]] name = "objc2-core-video" version = "0.2.2" diff --git a/crates/header-translator/src/expr.rs b/crates/header-translator/src/expr.rs index a9361e787..a7183f499 100644 --- a/crates/header-translator/src/expr.rs +++ b/crates/header-translator/src/expr.rs @@ -74,8 +74,9 @@ impl Expr { (EntityKind::BinaryOperator, [_, _]) => Self::parse_from_tokens(entity, context), (EntityKind::IntegerLiteral, []) => Self::parse_from_tokens(entity, context), (EntityKind::FloatingLiteral, []) => Self::parse_from_tokens(entity, context), - // Remove unnecessary cast + // Remove unnecessary casts (EntityKind::CStyleCastExpr, [_type, child]) => Self::parse(child, context), + (EntityKind::CStyleCastExpr, [child]) => Self::parse_from_tokens(child, context), (EntityKind::UnexposedExpr, _) => Self::parse_from_tokens(entity, context), (EntityKind::CharacterLiteral, []) => Self::parse_from_tokens(entity, context), (_, children) => panic!("unknown expr: {entity:?}, {children:#?}"), diff --git a/crates/header-translator/src/stmt.rs b/crates/header-translator/src/stmt.rs index bedd4e4dc..91ea09c9d 100644 --- a/crates/header-translator/src/stmt.rs +++ b/crates/header-translator/src/stmt.rs @@ -1018,6 +1018,17 @@ impl Stmt { EntityKind::TypedefDecl => { let id = ItemIdentifier::new(entity, context); let availability = Availability::parse(entity, context); + + if context + .library(id.library_name()) + .typedef_data + .get(&id.name) + .map(|data| data.skipped) + .unwrap_or_default() + { + return vec![]; + } + let mut kind = None; immediate_children(entity, |entity, _span| match entity.get_kind() { @@ -1040,20 +1051,11 @@ impl Stmt { | EntityKind::ObjCProtocolRef | EntityKind::TypeRef | EntityKind::ParmDecl - | EntityKind::EnumDecl => {} + | EntityKind::EnumDecl + | EntityKind::IntegerLiteral => {} _ => error!("unknown"), }); - if context - .library(id.library_name()) - .typedef_data - .get(&id.name) - .map(|data| data.skipped) - .unwrap_or_default() - { - return vec![]; - } - let ty = entity .get_typedef_underlying_type() .expect("typedef underlying type"); @@ -1417,11 +1419,11 @@ impl Stmt { } EntityKind::UnionDecl => { let id = ItemIdentifier::new_optional(entity, context); - error!( + warn!( ?id, has_attributes = ?entity.has_attributes(), children = ?entity.get_children(), - "union", + "skipping union", ); vec![] } diff --git a/crates/header-translator/src/unexposed_attr.rs b/crates/header-translator/src/unexposed_attr.rs index d4cdb0e87..409851a10 100644 --- a/crates/header-translator/src/unexposed_attr.rs +++ b/crates/header-translator/src/unexposed_attr.rs @@ -136,6 +136,13 @@ impl UnexposedAttr { | "CIKL_DEPRECATED" | "CK_UNAVAILABLE" | "CK_NEWLY_UNAVAILABLE" + | "CT_AVAILABLE" + | "CT_DEPRECATED" + | "CT_DEPRECATED_WITH_REPLACEMENT" + | "CT_ENUM_AVAILABLE" + | "CT_ENUM_DEPRECATED" + | "CT_ENUM_UNAVAILABLE" + | "CT_UNAVAILABLE" | "COREVIDEO_GL_DEPRECATED" | "FPUI_AVAILABLE" | "MLCOMPUTE_AVAILABLE_STARTING" diff --git a/crates/objc2/src/topics/about_generated/CHANGELOG.md b/crates/objc2/src/topics/about_generated/CHANGELOG.md index 2374ec68f..fa53b801e 100644 --- a/crates/objc2/src/topics/about_generated/CHANGELOG.md +++ b/crates/objc2/src/topics/about_generated/CHANGELOG.md @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - `CoreAudioTypes` / `objc2-core-audio-types`. - `CoreGraphics` / `objc2-core-graphics`. - `CoreFoundation` / `objc2-core-foundation`. + - `CoreText` / `objc2-core-text`. - `CoreVideo` / `objc2-core-video`. - `ScreenSaver` / `objc2-screen-saver`. diff --git a/crates/objc2/src/topics/about_generated/list_data.md b/crates/objc2/src/topics/about_generated/list_data.md index fe0d5c914..d8894d1b8 100644 --- a/crates/objc2/src/topics/about_generated/list_data.md +++ b/crates/objc2/src/topics/about_generated/list_data.md @@ -27,6 +27,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/) | +| `CoreText` | [![`objc2-core-text`](https://badgen.net/crates/v/objc2-core-text)](https://crates.io/crates/objc2-core-text) | [![docs.rs](https://docs.rs/objc2-core-text/badge.svg)](https://docs.rs/objc2-core-text/) | | `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/) | diff --git a/framework-crates/objc2-app-kit/translation-config.toml b/framework-crates/objc2-app-kit/translation-config.toml index 4354852b8..47b16cb12 100644 --- a/framework-crates/objc2-app-kit/translation-config.toml +++ b/framework-crates/objc2-app-kit/translation-config.toml @@ -99,7 +99,7 @@ class.NSWorkspaceOpenConfiguration.methods."setArchitecture:".skipped = true # Needs INIntent from Intents protocol.NSApplicationDelegate.methods."application:handlerForIntent:".skipped = true -# Needs CoreText +# We don't really want objc2-app-kit to depend on objc2-core-text class.NSAdaptiveImageGlyph.skipped-protocols = ["CTAdaptiveImageProviding"] # header-translator crashes when trying to figure out the return type of this. diff --git a/framework-crates/objc2-core-text/Cargo.toml b/framework-crates/objc2-core-text/Cargo.toml new file mode 100644 index 000000000..09abee552 --- /dev/null +++ b/framework-crates/objc2-core-text/Cargo.toml @@ -0,0 +1,182 @@ +# This file has been automatically generated by `objc2`'s `header-translator`. +# DO NOT EDIT + +[package] +name = "objc2-core-text" +version.workspace = true +description = "Bindings to the CoreText 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 } +libc = { version = "0.2.80", 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-graphics = { path = "../objc2-core-graphics", 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", "libc?/std", "objc2/std", "objc2-core-foundation?/std", "objc2-core-graphics?/std"] +alloc = ["block2?/alloc", "objc2/alloc", "objc2-core-foundation?/alloc", "objc2-core-graphics?/alloc"] +bitflags = ["dep:bitflags", "objc2-core-foundation?/bitflags", "objc2-core-graphics?/bitflags"] +block2 = ["dep:block2", "objc2-core-foundation?/block2", "objc2-core-graphics?/block2"] +libc = ["dep:libc", "objc2-core-foundation?/libc", "objc2-core-graphics?/libc"] +objc2-core-foundation = ["dep:objc2-core-foundation", "objc2-core-graphics?/objc2-core-foundation"] +objc2-core-graphics = ["dep:objc2-core-graphics"] + +CTDefines = [] +CTFont = [ + "bitflags", + "objc2-core-foundation?/CFArray", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFCGTypes", + "objc2-core-foundation?/CFCharacterSet", + "objc2-core-foundation?/CFData", + "objc2-core-foundation?/CFDictionary", + "objc2-core-foundation?/CFString", + "objc2-core-graphics?/CGContext", + "objc2-core-graphics?/CGFont", + "objc2-core-graphics?/CGPath", +] +CTFontCollection = [ + "bitflags", + "objc2-core-foundation?/CFArray", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", + "objc2-core-foundation?/CFSet", +] +CTFontDescriptor = [ + "objc2-core-foundation?/CFArray", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFCGTypes", + "objc2-core-foundation?/CFDictionary", + "objc2-core-foundation?/CFNumber", + "objc2-core-foundation?/CFSet", +] +CTFontManager = [ + "objc2-core-foundation?/CFArray", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFBundle", + "objc2-core-foundation?/CFData", + "objc2-core-foundation?/CFDictionary", + "objc2-core-foundation?/CFError", + "objc2-core-foundation?/CFRunLoop", + "objc2-core-foundation?/CFURL", + "objc2-core-graphics?/CGFont", +] +CTFontManagerErrors = ["objc2-core-foundation?/CFBase"] +CTFontTraits = [ + "bitflags", + "objc2-core-foundation?/CFBase", +] +CTFrame = [ + "objc2-core-foundation?/CFArray", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFCGTypes", + "objc2-core-foundation?/CFDictionary", + "objc2-core-graphics?/CGContext", + "objc2-core-graphics?/CGPath", +] +CTFramesetter = [ + "objc2-core-foundation?/CFAttributedString", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFCGTypes", + "objc2-core-foundation?/CFDictionary", + "objc2-core-graphics?/CGPath", +] +CTGlyphInfo = [ + "objc2-core-foundation?/CFBase", + "objc2-core-graphics?/CGFont", +] +CTLine = [ + "bitflags", + "objc2-core-foundation?/CFArray", + "objc2-core-foundation?/CFAttributedString", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFCGTypes", + "objc2-core-graphics?/CGContext", +] +CTParagraphStyle = ["objc2-core-foundation?/CFBase"] +CTRubyAnnotation = [ + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFCGTypes", + "objc2-core-foundation?/CFDictionary", +] +CTRun = [ + "bitflags", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFCGTypes", + "objc2-core-foundation?/CFDictionary", + "objc2-core-graphics?/CGContext", + "objc2-core-graphics?/CGFont", +] +CTRunDelegate = [ + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFCGTypes", + "objc2-core-graphics?/CGImage", +] +CTStringAttributes = [ + "bitflags", + "objc2-core-foundation?/CFBase", +] +CTTextTab = [ + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", +] +CTTypesetter = [ + "objc2-core-foundation?/CFAttributedString", + "objc2-core-foundation?/CFBase", + "objc2-core-foundation?/CFDictionary", +] +SFNTLayoutTypes = [] +SFNTTypes = [] +all = [ + "CTDefines", + "CTFont", + "CTFontCollection", + "CTFontDescriptor", + "CTFontManager", + "CTFontManagerErrors", + "CTFontTraits", + "CTFrame", + "CTFramesetter", + "CTGlyphInfo", + "CTLine", + "CTParagraphStyle", + "CTRubyAnnotation", + "CTRun", + "CTRunDelegate", + "CTStringAttributes", + "CTTextTab", + "CTTypesetter", + "SFNTLayoutTypes", + "SFNTTypes", + "bitflags", + "block2", + "libc", + "objc2-core-foundation", + "objc2-core-graphics", +] diff --git a/framework-crates/objc2-core-text/README.md b/framework-crates/objc2-core-text/README.md new file mode 100644 index 000000000..536ae895b --- /dev/null +++ b/framework-crates/objc2-core-text/README.md @@ -0,0 +1,14 @@ +# `objc2-core-text` + +[![Latest version](https://badgen.net/crates/v/objc2-core-text)](https://crates.io/crates/objc2-core-text) +[![License](https://badgen.net/badge/license/MIT/blue)](../LICENSE.txt) +[![Documentation](https://docs.rs/objc2-core-text/badge.svg)](https://docs.rs/objc2-core-text/) +[![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 CoreText. + +This README is kept intentionally small to consolidate the documentation, see +[the Rust docs](https://docs.rs/objc2-core-text/) 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-text/src/generated b/framework-crates/objc2-core-text/src/generated new file mode 120000 index 000000000..e2614f9f0 --- /dev/null +++ b/framework-crates/objc2-core-text/src/generated @@ -0,0 +1 @@ +../../../generated/CoreText \ No newline at end of file diff --git a/framework-crates/objc2-core-text/src/invalid.rs b/framework-crates/objc2-core-text/src/invalid.rs new file mode 100644 index 000000000..fb613c874 --- /dev/null +++ b/framework-crates/objc2-core-text/src/invalid.rs @@ -0,0 +1,25 @@ +#![allow(non_upper_case_globals)] + +#[cfg(feature = "CTFont")] +impl crate::CTFontUIFontType { + pub const kCTFontUIFontNone: Self = Self(u32::MAX); +} + +#[cfg(feature = "CTRubyAnnotation")] +impl crate::CTRubyAlignment { + pub const kCTRubyAlignmentInvalid: Self = Self(u8::MAX); +} + +#[cfg(feature = "CTRubyAnnotation")] +impl crate::CTRubyOverhang { + pub const kCTRubyOverhangInvalid: Self = Self(u8::MAX); +} + +#[cfg(feature = "SFNTLayoutTypes")] +pub const kMORTLigLastAction: core::ffi::c_int = 0x80000000u32 as _; + +#[cfg(feature = "SFNTLayoutTypes")] +pub const kMORXCoverVertical: core::ffi::c_int = 0x80000000u32 as _; + +#[cfg(feature = "SFNTLayoutTypes")] +pub const kKERXVertical: core::ffi::c_int = 0x80000000u32 as _; diff --git a/framework-crates/objc2-core-text/src/lib.rs b/framework-crates/objc2-core-text/src/lib.rs new file mode 100644 index 000000000..fabde4310 --- /dev/null +++ b/framework-crates/objc2-core-text/src/lib.rs @@ -0,0 +1,37 @@ +//! # Bindings to the `CoreText` 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/coretext/ +//! [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-text/0.2.2")] + +#[cfg(feature = "alloc")] +extern crate alloc; + +#[cfg(feature = "std")] +extern crate std; + +mod generated; +mod invalid; +#[cfg(feature = "SFNTLayoutTypes")] +mod sfnt_lookup_header; + +#[allow(unused_imports, unreachable_pub)] +pub use self::generated::*; +#[cfg(feature = "SFNTLayoutTypes")] +pub use self::invalid::{kKERXVertical, kMORTLigLastAction, kMORXCoverVertical}; +#[cfg(feature = "SFNTLayoutTypes")] +pub use self::sfnt_lookup_header::SFNTLookupFormatSpecificHeader; + +#[allow(dead_code)] +pub(crate) type Fixed = i32; +#[allow(dead_code)] +pub(crate) type FourCharCode = u32; +#[allow(dead_code)] +pub(crate) type ConstStr255Param = *const core::ffi::c_char; +#[allow(dead_code)] +pub(crate) type UniChar = u16; diff --git a/framework-crates/objc2-core-text/src/sfnt_lookup_header.rs b/framework-crates/objc2-core-text/src/sfnt_lookup_header.rs new file mode 100644 index 000000000..943db5f02 --- /dev/null +++ b/framework-crates/objc2-core-text/src/sfnt_lookup_header.rs @@ -0,0 +1,46 @@ +use core::{fmt, ptr}; + +use objc2::encode::{Encode, Encoding}; + +use crate::{ + SFNTLookupArrayHeader, SFNTLookupSegmentHeader, SFNTLookupSingleHeader, + SFNTLookupTrimmedArrayHeader, SFNTLookupVectorHeader, +}; + +#[repr(C)] +#[derive(Clone, Copy)] +pub union SFNTLookupFormatSpecificHeader { + the_array: SFNTLookupArrayHeader, + segment: SFNTLookupSegmentHeader, + single: SFNTLookupSingleHeader, + trimmed_array: SFNTLookupTrimmedArrayHeader, + vector: SFNTLookupVectorHeader, +} + +impl fmt::Debug for SFNTLookupFormatSpecificHeader { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("SFNTLookupFormatSpecificHeader") + .finish_non_exhaustive() + } +} + +impl PartialEq for SFNTLookupFormatSpecificHeader { + fn eq(&self, other: &Self) -> bool { + // This is probably wrong, but it's difficult to + // implement a more correct comparison. + ptr::eq(self, other) + } +} + +unsafe impl Encode for SFNTLookupFormatSpecificHeader { + const ENCODING: Encoding = Encoding::Union( + "SFNTLookupFormatSpecificHeader", + &[ + ::ENCODING, + ::ENCODING, + ::ENCODING, + ::ENCODING, + ::ENCODING, + ], + ); +} diff --git a/framework-crates/objc2-core-text/translation-config.toml b/framework-crates/objc2-core-text/translation-config.toml new file mode 100644 index 000000000..70e8c3958 --- /dev/null +++ b/framework-crates/objc2-core-text/translation-config.toml @@ -0,0 +1,47 @@ +framework = "CoreText" +crate = "objc2-core-text" +required-dependencies = [] +custom-lib-rs = true +macos = "10.8" +maccatalyst = "13.0" +ios = "3.2" +tvos = "9.0" +watchos = "2.0" +visionos = "1.0" + +# Typedef'd to a union +typedef.SFNTLookupFormatSpecificHeader.skipped = true # Manually defined +typedef.MortSpecificSubtable.skipped = true +typedef.MorxSpecificSubtable.skipped = true +typedef.KernFormatSpecificHeader.skipped = true +typedef.KerxFormatSpecificHeader.skipped = true +typedef.BslnFormatUnion.skipped = true + +# Uses the above unions +struct.MortSubtable.skipped = true +struct.MorxSubtable.skipped = true +struct.KernVersion0SubtableHeader.skipped = true +struct.KernSubtableHeader.skipped = true +typedef.KernSubtableHeaderPtr.skipped = true +struct.KerxSubtableHeader.skipped = true +typedef.KerxSubtableHeaderPtr.skipped = true +struct.BslnTable.skipped = true +typedef.BslnTablePtr.skipped = true + +# Unknown calling convention / ABI +fn.CTRubyAnnotationCreate.skipped = true +typedef.BslnBaselineRecord.skipped = true + +# Needs ATSFontRef from ATS framework +fn.CTFontGetPlatformFont.skipped = true +fn.CTFontCreateWithPlatformFont.skipped = true + +# Emits -1 on an unsigned type, manually defined +enum.CTFontUIFontType.constants.kCTFontUIFontNone.skipped = true +enum.CTRubyAlignment.constants.kCTRubyAlignmentInvalid.skipped = true +enum.CTRubyOverhang.constants.kCTRubyOverhangInvalid.skipped = true + +# Emits 0x80000000 on an int, manually defined +enum.anonymous.constants.kMORTLigLastAction.skipped = true +enum.anonymous.constants.kMORXCoverVertical.skipped = true +enum.anonymous.constants.kKERXVertical.skipped = true diff --git a/framework-crates/objc2-ui-kit/translation-config.toml b/framework-crates/objc2-ui-kit/translation-config.toml index 195dc9620..55e2a32a8 100644 --- a/framework-crates/objc2-ui-kit/translation-config.toml +++ b/framework-crates/objc2-ui-kit/translation-config.toml @@ -123,7 +123,7 @@ class.UITraitTypesettingLanguage.main-thread-only = true class.UITraitSceneCaptureState.main-thread-only = true class.UITraitListEnvironment.main-thread-only = true -# Needs CoreText +# We don't really want objc2-ui-kit to depend on objc2-core-text class.NSAdaptiveImageGlyph.skipped-protocols = ["CTAdaptiveImageProviding"] # Needs `INPerson` diff --git a/generated b/generated index a2280fca4..29a98876c 160000 --- a/generated +++ b/generated @@ -1 +1 @@ -Subproject commit a2280fca42606e09a6a5815309a0b138b3841926 +Subproject commit 29a98876c485b2e0ab0f8b0b95c56d5b6ab39e6f