servo / core-foundation-rs

Rust bindings to Core Foundation and other low level libraries on Mac OS X and iOS
Other
987 stars 216 forks source link

NSColor: add AppKit-defined colors #660

Open mattjbray opened 5 months ago

mattjbray commented 5 months ago

Add AppKit-defined UI Element Colors and Standard Colors.

See https://developer.apple.com/documentation/appkit/nscolor#1651631

mattjbray commented 5 months ago

Looks like quaternarySystemFillColor et al are only available on macOS 14.0+, but the tests run on os: [macos-11.0, macos-12, macos-13].

Is there any preprocessor/directive already in use to detect what version of macOS is being built against? Or should I just remove them?

waywardmonkeys commented 4 weeks ago

Part of the issue here is that you're running tests that need the new symbols, but if you didn't do that, then things would compile, leaving up to the person using the crate to sort it out. I'm not sure what's better.

mattjbray commented 4 weeks ago

An option is to add a macos_14 cargo feature (set by default) and disable/enable it in the test matrix. I can have a go at that if you want.

mattjbray commented 4 weeks ago

There is some precedent for using cargo features:

I was thinking along the lines of how it's done in core-text: include the feature by default, and you can exclude it if building on older osx versions.