Publish core-graphics
Like #465, but for core-graphics. #436 in particular was merged five months ago, which was awesome, but there hasn't been a release to crates.io yet since then. Hopefully this PR should suffice for doing so?
Remove filedescriptor test_consumed
This test was failing intermittently on github actions.
There's no safe way to check that a file descriptor has been closed,
because a new file could have been reopened with the same number. We'd
then end up closing that new file instead of having close() fail.
This test was failing intermittently on github actions.
There's no safe way to check that a file descriptor has been closed,
because a new file could have been reopened with the same number. We'd
then end up closing that new file instead of having close() fail.
Added missing macOS 10.6+ IOSurface functions
This adds a few `sys` entry points for IOSurface functions.
I also made those public, so that code outside the IOSurface module can call and use them. I didn't add "rusty" wrappers as most of these functions are likely to be used in unsafe contexts anyway.
I limited this to all functions supported in macOS 10.6.
Adds run_in_mode wrapper over CFRunLoopRunInMode
Adds a `run_in_mode` wrapper function which just makes `CFRunLoopRunInMode` a little more "rusty".
Also adds a `CFRunLoopRunResult` enum to type the return value.
Add NSSavePanel binding
This PR adds bindings to some basic `NSSavePanel` APIs. In Cocoa, `NSSavePanel` is a superclass of `NSOpenPanel`, which I added bindings for in #454.
Example:
```rust
let panel = NSSavePanel::savePanel(nil);
panel.setDirectoryURL(the_url);
let response = panel.runModal();
if response == NSModalResponse::NSModalResponseOk {
let url_ptr = panel.URL().absoluteString().UTF8String();
let url = CStr::from_ptr(url_ptr).to_string_lossy();
eprintln!("You picked URL {}", url);
}
```
Add bindings for NSOpenPanel
This PR adds bindings for the main `NSOpenPanel` APIs, which let you present a modal for selecting files or directories. Usage:
```rust
let panel = NSOpenPanel::openPanel(nil);
panel.setCanChooseDirectories_(YES);
panel.setCanChooseFiles_(NO);
panel.setAllowsMultipleSelection_(YES);
let response = panel.runModal();
if response == NSModalResponse::NSModalResponseOk {
let urls = panel.URLs();
for i in 0..urls.count() {
let url_ptr = urls.objectAtIndex(i).absoluteString().UTF8String();
let url = CStr::from_ptr(url_ptr).to_string_lossy();
eprintln!("You picked URL {}", url);
}
}
```
Adds function for fetching ID of a core_graphics::display::CGDisplayMode
This adds a `mode_id()` function on `CGDisplayMode` which returns the unique (to that display) integer ID the system uses to identify the display mode. It internally calls down to `CGDisplayModeGetIODisplayModeID()` in the CoreGraphics framework. The FFI for this function was previously missing and has also been added.
This adds a mode_id() function on CGDisplayMode which returns the unique (to that display) integer ID the system uses to identify the display mode. It internally calls down to CGDisplayModeGetIODisplayModeID() in the CoreGraphics framework. The FFI for this function was previously missing and has also been added.
Add create_font_descriptor_with_data
This allows create a font from a CFData instead of slice.
More importantly this allows using a CFData that was created
with a custom allocator.