Skip to content

Commit

Permalink
Add the IOSurface framework
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Dec 10, 2024
1 parent 146f44f commit 62b6b79
Show file tree
Hide file tree
Showing 20 changed files with 204 additions and 58 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions Cargo.lock

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

8 changes: 3 additions & 5 deletions crates/header-translator/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,9 @@ impl Location {
}

pub fn assert_file(&self, file_name: &str) {
assert_eq!(
self.file_name(),
Some(file_name),
"expected {self:?} to be in {file_name:?}"
);
if self.file_name() != Some(file_name) {
error!(?self, ?file_name, "expected to be in file");
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/header-translator/src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl Library {
current = match current.submodules.entry(p.to_string()) {
Entry::Occupied(entry) => entry.into_mut(),
Entry::Vacant(entry) => {
error!(?location, "expected module to be available in library");
warn!(?location, "expected module to be available in library");
entry.insert(Default::default())
}
};
Expand Down
3 changes: 3 additions & 0 deletions crates/header-translator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ fn main() -> Result<(), BoxError> {
let includes = tempdir.join(platform_header);

let mut includes_file = fs::File::create(&includes).unwrap();
// Make sure that we pick the IOSurfaceRef that IOSurface defines,
// instead of the one that CoreGraphics defines.
writeln!(&mut includes_file, "#import <IOSurface/IOSurface.h>")?;
for lib in config.libraries.values() {
if !platform_config_filter(lib) {
continue;
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 @@ -43,6 +43,7 @@
| `GameController` | [![`objc2-game-controller`](https://badgen.net/crates/v/objc2-game-controller)](https://crates.io/crates/objc2-game-controller) | [![docs.rs](https://docs.rs/objc2-game-controller/badge.svg)](https://docs.rs/objc2-game-controller/) |
| `GameKit` | [![`objc2-game-kit`](https://badgen.net/crates/v/objc2-game-kit)](https://crates.io/crates/objc2-game-kit) | [![docs.rs](https://docs.rs/objc2-game-kit/badge.svg)](https://docs.rs/objc2-game-kit/) |
| `HealthKit` | [![`objc2-health-kit`](https://badgen.net/crates/v/objc2-health-kit)](https://crates.io/crates/objc2-health-kit) | [![docs.rs](https://docs.rs/objc2-health-kit/badge.svg)](https://docs.rs/objc2-health-kit/) |
| `IOSurface` | [![`objc2-io-surface`](https://badgen.net/crates/v/objc2-io-surface)](https://crates.io/crates/objc2-io-surface) | [![docs.rs](https://docs.rs/objc2-io-surface/badge.svg)](https://docs.rs/objc2-io-surface/) |
| `IdentityLookup` | [![`objc2-identity-lookup`](https://badgen.net/crates/v/objc2-identity-lookup)](https://crates.io/crates/objc2-identity-lookup) | [![docs.rs](https://docs.rs/objc2-identity-lookup/badge.svg)](https://docs.rs/objc2-identity-lookup/) |
| `InputMethodKit` | [![`objc2-input-method-kit`](https://badgen.net/crates/v/objc2-input-method-kit)](https://crates.io/crates/objc2-input-method-kit) | [![docs.rs](https://docs.rs/objc2-input-method-kit/badge.svg)](https://docs.rs/objc2-input-method-kit/) |
| `LinkPresentation` | [![`objc2-link-presentation`](https://badgen.net/crates/v/objc2-link-presentation)](https://crates.io/crates/objc2-link-presentation) | [![docs.rs](https://docs.rs/objc2-link-presentation/badge.svg)](https://docs.rs/objc2-link-presentation/) |
Expand Down
15 changes: 10 additions & 5 deletions framework-crates/objc2-core-graphics/Cargo.toml

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

5 changes: 1 addition & 4 deletions framework-crates/objc2-core-graphics/translation-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ fn.CGColorSpaceRelease.skipped = true

# CoreGraphics defines this for some reason?
typedef.IOSurfaceRef.skipped = true

# Needs IOSurfaceRef from IOSurface
typedef.CGDisplayStreamFrameAvailableHandler.skipped = true
fn.CGDisplayStreamCreate.skipped = true
struct.__IOSurface.skipped = true

# Needs io_service_t from the kernel
fn.CGDisplayIOServicePort.skipped = true
Expand Down
13 changes: 10 additions & 3 deletions framework-crates/objc2-core-image/Cargo.toml

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

11 changes: 0 additions & 11 deletions framework-crates/objc2-core-image/translation-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ class.CIImage.categories.AVDepthData.skipped = true
class.CIImage.categories.AVPortraitEffectsMatte.skipped = true
class.CIImage.categories.AVSemanticSegmentationMatte.skipped = true

# Needs `IOSurfaceRef` from IOKit
class.CIRenderDestination.methods."initWithIOSurface:".skipped = true
protocol.CIImageProcessorInput.methods.surface.skipped = true
protocol.CIImageProcessorOutput.methods.surface.skipped = true
class.CIContext.methods."render:toIOSurface:bounds:colorSpace:".skipped = true
class.CIImage.methods."imageWithIOSurface:".skipped = true
class.CIImage.methods."imageWithIOSurface:options:".skipped = true
class.CIImage.methods."initWithIOSurface:".skipped = true
class.CIImage.methods."initWithIOSurface:options:".skipped = true
class.CIImage.methods."initWithIOSurface:plane:format:options:".skipped = true

# Needs `EAGLContext`
class.CIContext.methods."contextWithEAGLContext:".skipped = true
class.CIContext.methods."contextWithEAGLContext:options:".skipped = true
Expand Down
17 changes: 12 additions & 5 deletions framework-crates/objc2-core-video/Cargo.toml

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

4 changes: 0 additions & 4 deletions framework-crates/objc2-core-video/translation-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ fn.CVOpenGLESTextureCacheCreateTextureFromImage.skipped = true
fn.CVOpenGLESTextureGetTarget.skipped = true
fn.CVOpenGLESTextureGetName.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
Expand Down
70 changes: 70 additions & 0 deletions framework-crates/objc2-io-surface/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-io-surface/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-io-surface/src/generated

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

Loading

0 comments on commit 62b6b79

Please sign in to comment.