My work on fixing upstream issues in core-foundation-rs (or at least opening new issues in this repo to track them). Similar to #22 . See also #692 .
I'm a bit unsure how to handle this sort of stuff, I wanted to make sure that nothing in the core-foundation-rs repo is lost in the eventual migration, but I also didn't want to spam the repo with comments like "this is fixed in objc2-core-foundation".
Issues:
CGEvent set_flags does not work randomly servo/core-foundation-rs#721
Seems like an issue with Apple's CGEventSetFlags.
Soundness issue with Dictionary find/get servo/core-foundation-rs#720
Fixed/prevented in 006b2e6 (getters retain by default, and the ones that don't are unsafe).
Expose data property for CGEvent servo/core-foundation-rs#711
Incorrect function parameters for CFCalendarGetIdentifier servo/core-foundation-rs#685
objc2_core_foundation::CFCalendarGetIdentifier is correct.
Tags are missing for crate releases servo/core-foundation-rs#684
Incorrect behavior of CGEventTap servo/core-foundation-rs#664
Usage of CGSRegionRelease in core-graphics prevents publishing to the Mac AppStore servo/core-foundation-rs#656
CGSRegionRelease isn't present in objc2-core-graphics.
Does not compile if objc has verify_message feature turned on servo/core-foundation-rs#655
Message verification is a central part of objc2, and objc2-core-foundation supports this by implementing Encode for all its types when the "objc2" feature is activated.
Remove link feature? servo/core-foundation-rs#651
link feature not present in objc2 crates (I'll have to see a really compelling use-case before I add such a thing).
Safe CFRunLoop methods accept and dereference a raw pointer servo/core-foundation-rs#648
objc2_core_foundation::CFRunLoopAddSource does not accept raw pointer.
Panic on assert!(!result.is_null()) servo/core-foundation-rs#644
objc2_core_graphics::CGImageCreate returns an Option, so it's up to the user themselves to handle errors.
Usage of dispatch_queue_t ? servo/core-foundation-rs#635
Next breaking semver? servo/core-foundation-rs#633
proposal: core-foundation-rs hosted IOKit bindings servo/core-foundation-rs#632
objc2-io-kit is available.
macOS deployment targets servo/core-foundation-rs#627
objc2's approach to macOS versions is different, it don't have a feature-flag per OS version, instead everything is always available, and it's up to you to only use the parts that are available on your supported OS version.
rustc's deployment target is what's tested in CI, and I regularly test on an old MacBook with macOS 10.12 installed.
Drop foreign-types usage from core-graphics crate servo/core-foundation-rs#604
objc2 crates don't use foreign-types.
Question about how to list all running window app names [Code Review/Question] servo/core-foundation-rs#535
objc2-core-foundation provides CFArray::to_vec and array iterators which are safer and retains like you'd expect.
Rust wrapper for NSAlert class servo/core-foundation-rs#531
objc2_app_kit::NSAlert is available.
Restructure cocoa crate servo/core-foundation-rs#496
How to call new_keyboard_event with NULL source? servo/core-foundation-rs#490
objc2_core_graphics::CGEventCreateKeyboardEvent accepts None event source.
Should IOSurface be a part of core-graphics-types? servo/core-foundation-rs#483
IOSurface should be in objc2-io-surface, that's the framework it belongs to. objc2 provides a lot of feature flags to tune which crates to depend on, so the dependency problem should be a non-issue there.
Should CGColorSpaceRef be a part of core-graphics-types? servo/core-foundation-rs#479
There is no split of objc2-core-graphics, feature flags are used instead to keep compile-times down.
CFRunLoop has no rustdoc servo/core-foundation-rs#467
objc2_core_foundation::CFRunLoop's docs are also kinda empty. Adding some examples would be a good idea. EDIT: Added in 81c4254 .
Change argument type from &CGImage to &CGImageRef servo/core-foundation-rs#466
objc2_core_foundation::CFRetained makes this distiction of ownership clear, and avoids unnecessary retains.
Additional PRs to core-foundation-rs servo/core-foundation-rs#462
objc2_core_graphics::CGDisplayStream is available.
CGS Display calls and CGVirtualDisplay are not available, I would accept a PR adding behind a "private" feature flag.
Transition CI to github actions servo/core-foundation-rs#461
No obvious contribution guidelines servo/core-foundation-rs#453
Should CFError(Ref) be made Sync? servo/core-foundation-rs#448
CGDataProvider and SIGSEGV servo/core-foundation-rs#431
objc2-core-foundation doesn't provide an abstraction on top of CGDataProvider.
Encoding missing for CGPoint, CGSize, CGRect, etc, so can't be passed as arguments to msg_send servo/core-foundation-rs#404
objc2-core-foundation works with objc2 and Objective-C message sending.
It is unclear how to get a CGImage from a *mut CGImage servo/core-foundation-rs#373
objc2 doesn't use foreign-types, so this is a non-issue here.
TCFType should be an unsafe trait servo/core-foundation-rs#364
objc2_core_foundation::Type is an unsafe trait.
CFMutableDictionary's API is unsound servo/core-foundation-rs#362
objc2_core_foundation::CFMutableDictionary does not have the listed problems (it doesn't allow safe operations when the type parameters are unknown).
Add NSThread bindings servo/core-foundation-rs#352
objc2_foundation::NSThread is available.
add bindings for CoreWLAN servo/core-foundation-rs#338
objc2-core-wlan is available.
Add safe bindings for creating run loop observers servo/core-foundation-rs#331
All objc2_core_foundation::CFRunLoopObserver functions are safe except CFRunLoopObserverCreate[WithHandler], since the callbacks must be thread-safe, and that's hard to ensure. Also discussed in CoreFoundation thread safety #696 .
CGDisplayMode::all_display_modes segmentation fault servo/core-foundation-rs#319
core_graphics::CGDisplayMode::all_display_modes ends up taking ownership of more than it should. objc2_core_graphics::CGDisplayCopyAllDisplayModes does not have this issue.
CFArray::from_copyable can corrupt memory servo/core-foundation-rs#291
objc2-core-foundation intentionally does not provide CFArray::from_copyable.
wait_200_milliseconds sometimes fails. servo/core-foundation-rs#284
Options should be implemented as bitflags, not enum servo/core-foundation-rs#280
objc2_app_kit::NSApplicationActivationOptions uses bitflags!.
Rewrite cocoa crate to mirror Swift APIs instead of ObjC APIs servo/core-foundation-rs#278
Create a core-graphics-types crate to avoid having to update so many crates when core-graphics makes breaking changes servo/core-foundation-rs#236
objc2-core-graphics is a single crate. Incompatible dependency versions are unfortunate, but IMO better mitigated with infrequent releases.
Support for CAMetalLayer in NSView? servo/core-foundation-rs#222
CAMetalLayer can be set as the layer in objc2_app_kit::NSView::setLayer.
The size of CGDisplay servo/core-foundation-rs#218
I agree that the naming should match Apple's name. But docs around this could be useful.
How to get untyped CFDictionary? servo/core-foundation-rs#215
objc2_core_foundation::CFDictionary can be converted from CFDictionary<K, V> with .as_opaque().
Missing CFMutableArray bindings and types servo/core-foundation-rs#211
objc2_core_foundation::CFMutableArray is available.
Higher-level interface to create delegates servo/core-foundation-rs#205
objc2::define_class! is available.
Implement a builder API for font variations servo/core-foundation-rs#201
I'm inclined to not bother unless it's really widely used (since it quickly becomes out of sync with Apple adding new string keys).
Improve type safety in cocoa crate servo/core-foundation-rs#200
objc2's header translator creates newtypes.
Make safe ways to create CGDataProvider servo/core-foundation-rs#185
Missing types servo/core-foundation-rs#183
objc2_foundation::NSURL and objc2_foundation::NSModalResponse are available.
Empty string when calling NSEvent::characters on a event created by a Quote press servo/core-foundation-rs#181
Seems like an issue with Apple's -[NSEvent characters].
Document usage paradigms servo/core-foundation-rs#180
Inheritance and method overloading is supported in objc2::define_class!.
Class methods and nullability are well supported in objc2::extern_class!.
Consider implementing Drop for NSAutoreleasePool? servo/core-foundation-rs#179
objc2::rc::autoreleasepool is available, that's the only (barely) sound API.
[NSEvent type] produces value 21 with no associated NSEventType variant causing SEGFAULT. servo/core-foundation-rs#178
objc2_app_kit::NSEventType is a struct over NSUInteger instead of an enum.
Multiple definitions of initWithFrame_ servo/core-foundation-rs#177
Specific to cocoa's handling of methods as traits, not an issue in objc2 crates.
Assertion error with basic usage of NSStatusBar servo/core-foundation-rs#176
Seems like an issue with Apple's -[NSStatusBar systemStatusBar].
Automatic binding generation? servo/core-foundation-rs#175
objc2 has automatically generated bindings.
Lots of type misalignment building under stable-i686-apple-darwin servo/core-foundation-rs#174
32-bit targets are regularly tested.
Newtypes instead of monolithic id servo/core-foundation-rs#173
objc2's header translator creates newtypes.
What is the scope of this crate? servo/core-foundation-rs#172
The scope of each crate is what their linking and headers expose.
Have font_path() return a PathBuf instead of a String servo/core-foundation-rs#167
No longer an issue upstream.
Update structs to remove 'zero type structs' for consumers. servo/core-foundation-rs#166
No longer an issue upstream.
Clean up the code servo/core-foundation-rs#165
How to use nsview.layer? servo/core-foundation-rs#164
Troubleshooting, not clear if there's an issue with the user's code or the library.
[RFC] Add a bunch of safe ways to create a CGDataProvider servo/core-foundation-rs#163
Rewrite all the bindings with the new CF bindings servo/core-foundation-rs#162
Project-specific and outdated.
Serialize implementation won't work with fonts created CGFontCreateWithDataProvider servo/core-foundation-rs#161
objc2-core-graphics doesn't try to serialize for you.
Remove warnings for zero-sized structs. servo/core-foundation-rs#106
No longer an issue upstream.
[NSEvent type] produces value 21 with no associated NSEventType variant causing SEGFAULT. servo/core-foundation-rs#401
Encode retaining and releasing in types servo/core-foundation-rs#83
No longer an issue upstream.
Audit for overflows servo/core-foundation-rs#22
No longer an issue upstream (and objc2-core-foundation has comments on most casts).
PRs:
[breaking][core-graphics] Enforce Sendness of CGEventTap callback (soundness fix) servo/core-foundation-rs#725
[breaking][core-graphics] Allow dropping event from CGEventTap callback servo/core-foundation-rs#724
Bump core-graphics to v0.25.0 servo/core-foundation-rs#722
core-graphics: add catalina feature flag for srgb cgcolor binding servo/core-foundation-rs#719
Differences in approach to API availability.
feat: CGEventSourceGetLocation servo/core-foundation-rs#715
CGEventSourceGetLocation is private API not even available in .tbd files.
Bump core-foundation to 0.10.1 servo/core-foundation-rs#706
Remove core_graphics::private::CGSRegion servo/core-foundation-rs#700
CGSRegion is not present in objc2-core-graphics.
Fix typo Applicatin -> Application servo/core-foundation-rs#696
objc2_app_kit::NSDockTile is auto-generated, and does contain such typos.
Cancel event when CGEventTap callback returns nullptr servo/core-foundation-rs#665
NSColor: add AppKit-defined colors servo/core-foundation-rs#660
These are available in objc2_app_kit::NSColor.
Remove duplicate definitions of CGWindow-related constants and types servo/core-foundation-rs#659
These duplicates are not present in objc2-core-graphics.
Make CFRunLoopMode a safe wrapper with a lifetime servo/core-foundation-rs#650
Impl Send+Sync for CFRunLoopTimer, CFRunLoopSource, CFRunLoopObserver servo/core-foundation-rs#649
Replace objc with objc2 servo/core-foundation-rs#628
ci: Remove Travis configs. servo/core-foundation-rs#623
Project-specific. I instead run tests manually before each release on macOS 10.12.
Add missing CFRangeMake function servo/core-foundation-rs#618
objc2_core_foundation::CFRangeMake is not available, should be added for documentation purposes. Done in 557cf98 .
core-foundation-sys: Enable no_std environment servo/core-foundation-rs#609
no_std is supported in objc2-core-foundation, though objc2 doesn't support it.
Add CALayer::from_raw servo/core-foundation-rs#536
Possible with objc2::rc::Retained::<objc2_quartz_core::CALayer>::from_raw.
GitHub Workflows security hardening servo/core-foundation-rs#532
Merge upstream changes from Warp's core-foundation-rs fork servo/core-foundation-rs#517
The raw APIs are available in objc2-core-text, PRs for wrappers welcome.
Use objc2 more idiomatically servo/core-foundation-rs#514
gate the build with target_os = "macos" servo/core-foundation-rs#506
Not gonna happen, we support GNUStep.
CGEventTap: Allow dropping events from callback servo/core-foundation-rs#492
Add a "gl" feature for OpenGL related functionality. servo/core-foundation-rs#484
[nomerge] Cg context type servo/core-foundation-rs#451
WIP: Variable pres servo/core-foundation-rs#445
The raw APIs are available in objc2-core-text, PRs for wrappers welcome.
Add an api to construct font data servo/core-foundation-rs#444
The raw APIs are available in objc2-core-text, PRs for wrappers welcome.
More variation tests servo/core-foundation-rs#441
The API is available in objc2_core_graphics::CGFontCopyVariations.
WIP: Add a test for variations on constructed font data servo/core-foundation-rs#440
Extra tests for API we do not expose.
Add a test for variation preservation. servo/core-foundation-rs#439
Extra tests for API we do not expose.
fix: new_from_descriptor lose font variations, such as font-weight servo/core-foundation-rs#430
Discussion about objc2-core-text APIs that I don't really plan on exposing.
WIP descriptor cache tests servo/core-foundation-rs#428
Extra tests for API we do not expose.
Improve CFData and add CFMutableData type servo/core-foundation-rs#351
Add CGImageDestination servo/core-foundation-rs#292
This API is exposed in objc2-image-io.
Update CGNumber servo/core-foundation-rs#82
My work on fixing upstream issues in
core-foundation-rs(or at least opening new issues in this repo to track them). Similar to #22. See also #692.I'm a bit unsure how to handle this sort of stuff, I wanted to make sure that nothing in the
core-foundation-rsrepo is lost in the eventual migration, but I also didn't want to spam the repo with comments like "this is fixed inobjc2-core-foundation".Issues:
CGEventSetFlags.unsafe).CGEvent.datais Swift-only?CFCalendarGetIdentifierservo/core-foundation-rs#685objc2_core_foundation::CFCalendarGetIdentifieris correct.CGEventTaphelpers? #720.CGSRegionReleaseincore-graphicsprevents publishing to the Mac AppStore servo/core-foundation-rs#656CGSRegionReleaseisn't present inobjc2-core-graphics.objc2, andobjc2-core-foundationsupports this by implementingEncodefor all its types when the"objc2"feature is activated.linkfeature? servo/core-foundation-rs#651linkfeature not present inobjc2crates (I'll have to see a really compelling use-case before I add such a thing).objc2_core_foundation::CFRunLoopAddSourcedoes not accept raw pointer.objc2_core_graphics::CGImageCreatereturns anOption, so it's up to the user themselves to handle errors.libdispatch#77.objc2-io-kitis available.objc2's approach to macOS versions is different, it don't have a feature-flag per OS version, instead everything is always available, and it's up to you to only use the parts that are available on your supported OS version.rustc's deployment target is what's tested in CI, and I regularly test on an old MacBook with macOS 10.12 installed.objc2crates don't useforeign-types.objc2-core-foundationprovidesCFArray::to_vecand array iterators which are safer and retains like you'd expect.objc2_app_kit::NSAlertis available.objc2_core_graphics::CGEventCreateKeyboardEventacceptsNoneevent source.IOSurfaceshould be inobjc2-io-surface, that's the framework it belongs to.objc2provides a lot of feature flags to tune which crates to depend on, so the dependency problem should be a non-issue there.objc2-core-graphics, feature flags are used instead to keep compile-times down.objc2_core_foundation::CFRunLoop's docs are also kinda empty. Adding some examples would be a good idea. EDIT: Added in 81c4254.&CGImageto&CGImageRefservo/core-foundation-rs#466objc2_core_foundation::CFRetainedmakes this distiction of ownership clear, and avoids unnecessary retains.objc2_core_graphics::CGDisplayStreamis available.CGVirtualDisplayare not available, I would accept a PR adding behind a"private"feature flag.objc2-core-foundationdoesn't provide an abstraction on top ofCGDataProvider.objc2-core-foundationworks withobjc2and Objective-C message sending.CGImagefrom a*mut CGImageservo/core-foundation-rs#373objc2doesn't useforeign-types, so this is a non-issue here.objc2_core_foundation::Typeis anunsafetrait.objc2_core_foundation::CFMutableDictionarydoes not have the listed problems (it doesn't allow safe operations when the type parameters are unknown).objc2_foundation::NSThreadis available.objc2-core-wlanis available.objc2_core_foundation::CFRunLoopObserverfunctions are safe exceptCFRunLoopObserverCreate[WithHandler], since the callbacks must be thread-safe, and that's hard to ensure. Also discussed in CoreFoundation thread safety #696.CGDisplayMode::all_display_modessegmentation fault servo/core-foundation-rs#319core_graphics::CGDisplayMode::all_display_modesends up taking ownership of more than it should.objc2_core_graphics::CGDisplayCopyAllDisplayModesdoes not have this issue.objc2-core-foundationintentionally does not provideCFArray::from_copyable.objc2_app_kit::NSApplicationActivationOptionsusesbitflags!.objc2's header translator. See also Figure out naming scheme in framework crates #284.objc2-core-graphicsis a single crate. Incompatible dependency versions are unfortunate, but IMO better mitigated with infrequent releases.CAMetalLayercan be set as the layer inobjc2_app_kit::NSView::setLayer.CGDisplayservo/core-foundation-rs#218objc2_core_foundation::CFDictionarycan be converted fromCFDictionary<K, V>with.as_opaque().objc2_core_foundation::CFMutableArrayis available.objc2::define_class!is available.objc2's header translator creates newtypes.CGDataProviderabstraction could be useful. Tracked in AddCGDataProviderinitializers #732.objc2_foundation::NSURLandobjc2_foundation::NSModalResponseare available.-[NSEvent characters].objc2::define_class!.objc2::extern_class!.DropforNSAutoreleasePool? servo/core-foundation-rs#179objc2::rc::autoreleasepoolis available, that's the only (barely) sound API.[NSEvent type]produces value21with no associatedNSEventTypevariant causing SEGFAULT. servo/core-foundation-rs#178objc2_app_kit::NSEventTypeis a struct overNSUIntegerinstead of an enum.initWithFrame_servo/core-foundation-rs#177cocoa's handling of methods as traits, not an issue inobjc2crates.-[NSStatusBar systemStatusBar].objc2has automatically generated bindings.objc2's header translator creates newtypes.objc2-core-graphicsdoesn't try to serialize for you.[NSEvent type]produces value21with no associatedNSEventTypevariant causing SEGFAULT. servo/core-foundation-rs#401[NSEvent type]produces value21with no associatedNSEventTypevariant causing SEGFAULT. servo/core-foundation-rs#178.objc2-core-foundationhas comments on most casts).PRs:
CGEventTaphelpers? #720.CGEventTaphelpers? #720.CGEventSourceGetLocationis private API not even available in.tbdfiles.core_graphics::private::CGSRegionservo/core-foundation-rs#700CGSRegionis not present inobjc2-core-graphics.Applicatin->Applicationservo/core-foundation-rs#696objc2_app_kit::NSDockTileis auto-generated, and does contain such typos.CGEventTapcallback returns nullptr servo/core-foundation-rs#665CGEventTaphelpers? #720.objc2_app_kit::NSColor.objc2-core-graphics.objc2_core_foundation::CFRunLoopAddSourcedoes not accept raw pointer.objcwithobjc2servo/core-foundation-rs#628objc2.objc2_core_foundation::CFRangeMakeis not available, should be added for documentation purposes. Done in 557cf98.no_stdenvironment servo/core-foundation-rs#609no_stdis supported inobjc2-core-foundation, thoughobjc2doesn't support it.objc2::rc::Retained::<objc2_quartz_core::CALayer>::from_raw.objc2-core-text, PRs for wrappers welcome.objc2more idiomatically servo/core-foundation-rs#514objc2.CGEventTaphelpers? #720.objc2-core-text, PRs for wrappers welcome.objc2-core-text, PRs for wrappers welcome.objc2_core_graphics::CGFontCopyVariations.objc2-core-textAPIs that I don't really plan on exposing.objc2-image-io.