Skip to content

Commit

Permalink
Add the ModelIO framework
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Jan 13, 2025
1 parent 2b087bc commit e233645
Show file tree
Hide file tree
Showing 16 changed files with 279 additions and 57 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crates/header-translator/src/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,7 @@ impl Stmt {
res.extend(Self::parse(&entity, context));
}
EntityKind::PackedAttr => packed = true,
EntityKind::VisibilityAttr => {}
_ => error!(?entity, "unknown struct/union child"),
});

Expand Down
1 change: 1 addition & 0 deletions crates/objc2/src/topics/about_generated/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `IOSurface` / `objc2-io-surface`.
- `Messages` / `objc2-messages`.
- `MessageUI` / `objc2-message-ui`.
- `ModelIO` / `objc2-model-io`.
- `MetalPerformanceShaders` / `objc2-metal-performance-shaders`.
- `MetalPerformanceShadersGraph` / `objc2-metal-performance-shaders-graph`.
- `OpenDirectory` / `objc2-open-directory`.
Expand Down
1 change: 1 addition & 0 deletions crates/objc2/src/topics/about_generated/list_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
| `MetalPerformanceShaders` | [![`objc2-metal-performance-shaders`](https://badgen.net/crates/v/objc2-metal-performance-shaders)](https://crates.io/crates/objc2-metal-performance-shaders) | [![docs.rs](https://docs.rs/objc2-metal-performance-shaders/badge.svg)](https://docs.rs/objc2-metal-performance-shaders/) |
| `MetalPerformanceShadersGraph` | [![`objc2-metal-performance-shaders-graph`](https://badgen.net/crates/v/objc2-metal-performance-shaders-graph)](https://crates.io/crates/objc2-metal-performance-shaders-graph) | [![docs.rs](https://docs.rs/objc2-metal-performance-shaders-graph/badge.svg)](https://docs.rs/objc2-metal-performance-shaders-graph/) |
| `MetricKit` | [![`objc2-metric-kit`](https://badgen.net/crates/v/objc2-metric-kit)](https://crates.io/crates/objc2-metric-kit) | [![docs.rs](https://docs.rs/objc2-metric-kit/badge.svg)](https://docs.rs/objc2-metric-kit/) |
| `ModelIO` | [![`objc2-model-io`](https://badgen.net/crates/v/objc2-model-io)](https://crates.io/crates/objc2-model-io) | [![docs.rs](https://docs.rs/objc2-model-io/badge.svg)](https://docs.rs/objc2-model-io/) |
| `MultipeerConnectivity` | [![`objc2-multipeer-connectivity`](https://badgen.net/crates/v/objc2-multipeer-connectivity)](https://crates.io/crates/objc2-multipeer-connectivity) | [![docs.rs](https://docs.rs/objc2-multipeer-connectivity/badge.svg)](https://docs.rs/objc2-multipeer-connectivity/) |
| `NaturalLanguage` | [![`objc2-natural-language`](https://badgen.net/crates/v/objc2-natural-language)](https://crates.io/crates/objc2-natural-language) | [![docs.rs](https://docs.rs/objc2-natural-language/badge.svg)](https://docs.rs/objc2-natural-language/) |
| `NearbyInteraction` | [![`objc2-nearby-interaction`](https://badgen.net/crates/v/objc2-nearby-interaction)](https://crates.io/crates/objc2-nearby-interaction) | [![docs.rs](https://docs.rs/objc2-nearby-interaction/badge.svg)](https://docs.rs/objc2-nearby-interaction/) |
Expand Down
3 changes: 3 additions & 0 deletions crates/test-frameworks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ test-frameworks = [
"objc2-metal-performance-shaders-graph/all",
"dep:objc2-metric-kit",
"objc2-metric-kit/all",
"dep:objc2-model-io",
"objc2-model-io/all",
"dep:objc2-multipeer-connectivity",
"objc2-multipeer-connectivity/all",
"dep:objc2-natural-language",
Expand Down Expand Up @@ -327,6 +329,7 @@ objc2-metal = { path = "../../framework-crates/objc2-metal", optional = true }
objc2-metal-kit = { path = "../../framework-crates/objc2-metal-kit", optional = true }
objc2-metal-performance-shaders = { path = "../../framework-crates/objc2-metal-performance-shaders", optional = true }
objc2-metal-performance-shaders-graph = { path = "../../framework-crates/objc2-metal-performance-shaders-graph", optional = true }
objc2-model-io = { path = "../../framework-crates/objc2-model-io", optional = true }
objc2-multipeer-connectivity = { path = "../../framework-crates/objc2-multipeer-connectivity", optional = true }
objc2-photos = { path = "../../framework-crates/objc2-photos", optional = true }
objc2-quartz-core = { path = "../../framework-crates/objc2-quartz-core", optional = true }
Expand Down
17 changes: 14 additions & 3 deletions framework-crates/objc2-metal-kit/Cargo.toml

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

21 changes: 0 additions & 21 deletions framework-crates/objc2-metal-kit/translation-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,3 @@ class.MTKMeshBuffer.skipped-protocols = ["MDLMeshBuffer", "MDLNamed"]

# error: unknown error result type
class.MTKTextureLoader.methods."newTexturesWithContentsOfURLs:options:error:".skipped = true

# Needs `MDLMeshBufferZone` from ModelIO framework
class.MTKMeshBuffer.methods.zone.skipped = true

# Needs `MDLMeshBufferType` from ModelIO framework
class.MTKMeshBuffer.methods.type.skipped = true

# Needs `MDLVertexFormat` from ModelIO framework
fn.MTKModelIOVertexFormatFromMetal.skipped = true
fn.MTKMetalVertexFormatFromModelIO.skipped = true

# Needs `ModelIO` framework
class.MTKMesh.methods."initWithMesh:device:error:".skipped = true
class.MTKMesh.methods."newMeshesFromAsset:device:sourceMeshes:error:".skipped = true
class.MTKMesh.methods.vertexDescriptor.skipped = true
fn.MTKModelIOVertexDescriptorFromMetal.skipped = true
fn.MTKModelIOVertexDescriptorFromMetalWithError.skipped = true
fn.MTKMetalVertexDescriptorFromModelIO.skipped = true
fn.MTKMetalVertexDescriptorFromModelIOWithError.skipped = true
class.MTKTextureLoader.methods."newTextureWithMDLTexture:options:completionHandler:".skipped = true
class.MTKTextureLoader.methods."newTextureWithMDLTexture:options:error:".skipped = true
170 changes: 170 additions & 0 deletions framework-crates/objc2-model-io/Cargo.toml

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

14 changes: 14 additions & 0 deletions framework-crates/objc2-model-io/README.md

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

1 change: 1 addition & 0 deletions framework-crates/objc2-model-io/src/generated

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

20 changes: 20 additions & 0 deletions framework-crates/objc2-model-io/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//! # Bindings to the `ModelIO` 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/modelio/
//! [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-model-io/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::*;
11 changes: 11 additions & 0 deletions framework-crates/objc2-model-io/translation-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
framework = "ModelIO"
crate = "objc2-model-io"
required-crates = ["objc2", "objc2-foundation"]
macos = "10.11"
maccatalyst = "13.0"
ios = "9.0"
tvos = "9.0"
visionos = "1.0"

# error: unknown error result type
class.MDLAsset.methods."initWithURL:vertexDescriptor:bufferAllocator:preserveTopology:error:".skipped = true
Loading

0 comments on commit e233645

Please sign in to comment.