Commit Graph

221 Commits

Author SHA1 Message Date
Bruce Mitchener 18df9aafe7 Some clippy fixes. (#624) 2023-08-03 14:20:26 +00:00
Bruce Mitchener 062041a921 docs.rs: Document with all-features enabled. (#626)
This will help people find the functionality that is feature-gated.

Fixes #540.
2023-08-01 15:29:29 +00:00
micolous b009c87f2d Auto-format code with "cargo fmt" and check in CI (#615)
* add rustfmt check to CI

* Run "cargo fmt" (rustfmt) over core-foundation-rs
2023-07-25 02:22:25 +00:00
Jeff Muizelaar 127f2be94c Revert "mach_port: Removed redundant pub use" (#620)
This reverts commit 6d00383baf.

It broke semver because it removed the export of CFIndex which
which older versions of the core-foundation crate are depending on.

Fixes #619
2023-07-24 17:00:42 +00:00
Michael Farrell a1df3385f7 mark CFRunLoop as Send+Sync, and test it 2023-07-11 11:42:29 +10:00
michaelwright235 695f9500d6 Bump core-foundation-sys to 0.8.5 2023-06-29 01:12:16 +03:00
Jeff Muizelaar d10ad8dead Get tests passing on macOS 13
macOS 13 uses NSTaggedPointerString for short CFStrings
which means the retain counts aren't meaningful. Increasing the length
of the strings avoids this.

Empty arrays also seem to refer to a shared constant object that
doesn't have meaningful retain counts either.

Fixes #597
2023-06-20 09:49:19 -04:00
michaelwright235 6d00383baf mach_port: Removed redundant pub use 2023-05-29 22:31:11 +03:00
Alex Touchet 1632edee66 Use SPDX license format 2023-04-02 22:43:22 -07:00
Nabil Elqatib 9856555517 Bump core-foundation crate version 2021-11-23 10:13:56 +01:00
Jeff Muizelaar 3d5df0a167 Bump the required version of core-foundation-sys 2021-11-02 16:21:20 -04:00
Jeff Muizelaar 91ff2cb513 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.
2021-10-28 10:22:43 -04:00
bors-servo 4960762637 Auto merge of #460 - xanathar:wip/mmp/runloop_ext, r=jrmuizel
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.
2021-10-27 12:51:22 -04:00
Nabil Elqatib f57966fd36 Publish core-foundation-sys, core-foundation 2021-10-12 13:43:34 +02:00
Marco Mastropaolo d83794c3ab Adds run_in_mode wrapper over CFRunLoopRunInMode 2021-08-16 10:28:04 +02:00
bors-servo f7e0b97e0b Auto merge of #436 - AsafFisher:master, r=jrmuizel
Add CGEventTap

https://github.com/servo/core-graphics-rs/issues/111
2021-05-26 13:18:34 -04:00
Jeff Muizelaar ce17c9aa59 Add CFData::from_arc
This allows creating a zero-copy CFData wrapping existing data.
2021-02-14 11:52:04 -05:00
Asaf Fisher edb187a17c core-foundation: Add basic CFMachPort 2021-01-23 03:24:30 +02:00
Jeff Muizelaar d30dd87bbd Implement Debug on the generic CFArray
This is the same kind of thing as #423
2020-12-21 16:45:49 -05:00
Jeff Muizelaar e7c5320639 Increase the threshold of acceptible values.
This test sometimes fails on github actions.
2020-11-03 09:20:04 -05:00
bors-servo 29588625c7 Auto merge of #423 - jrmuizel:dict-debug, r=emilio
Implement Debug on the generic CFDictionary
2020-10-29 20:48:32 -04:00
Jeff Muizelaar 2ee8facbd6 Implement Debug on the generic CFDictionary 2020-10-27 17:22:26 -04:00
Jeff Muizelaar faf0d7c0ff Implement Debug on CFPropertyList 2020-10-26 23:11:12 -04:00
Yu Shimura 437be24cdb CFBundleCopyResourcesDirectoryURL 2020-10-14 11:10:39 +09:00
Josh Matthews d3336c3a21 Version bumps for cocoa, core-foundation-sys, core-foundation, core-text, core-graphics-types, core-graphics. 2020-09-15 12:19:56 -04:00
Kornel Lesiński 71a0d68abf Fix docs.rs build 2020-08-26 17:28:10 +01:00
Josh Matthews 762a01b90f Major version update for core-foundation-sys and all other dependencies. 2020-06-29 11:45:17 -04:00
Josh Matthews 7487580958 Publish core-foundation-sys 0.7.2. 2020-06-29 11:23:29 -04:00
bors-servo 40a787f0e6 Auto merge of #397 - servo:major-bump, r=jdm
Major version change for core-foundation.

https://github.com/servo/core-foundation-rs/commit/b68e9c782af87534d50596d7c2a7b965e067eaef changed a public API, so we can't have a minor version change.
2020-06-29 11:06:02 -04:00
Josh Matthews 56d8b6c161 Major version change for core-foundation, core-graphics, io-surface, core-text, cocoa. 2020-06-29 11:03:28 -04:00
Bryan Burgers a4e2983219 Add CFTimeZone::name
Add a `name` method to `CFTimeZone` to get the time zone ID (e.g.,
"America/Los_Angeles") of the current time zone.

Core Foundation calls this "name" instead of "id" in its method
signatures, but acknowledges it in the closely-related NSTimeZone
related docs. Since most of the other methods in this library match
closely with CF naming, also use `name` here.

> Time zone database entries such as “America/Los_Angeles” are IDs, not
> names. An example of a time zone name is “Pacific Daylight Time”.
> Although many NSTimeZone symbols include the word “name”, they
> actually refer to IDs.
2020-06-29 07:18:58 -05:00
Adam Perry 9c264d2904 Bump core-foundation(-sys) to 0.7.1 for release. 2020-06-28 09:44:43 -07:00
bors-servo 01d6921340 Auto merge of #363 - roblabla:fix-missing-null-checks, r=jdm
Assert when creating a CFType from null

What's the reason behind IOSurface not using `impl_TCFType`? It feels dangerous not to use it.

Fixes #361
2020-05-17 13:01:30 -04:00
bors-servo 14ee94aef7 Auto merge of #359 - roblabla:cfset-missing-methods, r=jdm
CFSet: Add missing methods in -sys

Adds a handful of missing methods from the CFSet family.
2020-05-17 12:50:08 -04:00
bors-servo 4b765df60c Auto merge of #378 - kornelski:compstr, r=jdm
Make CFString comparable

Fixes #104

The `PartialEq` has to be on `CFString`, not `CFStringRef` due to orphan rules.
2020-05-08 11:56:31 -04:00
Kornel be0c03033b Test 64-bit NSNumbers 2020-05-08 14:07:03 +01:00
Kornel 977d4bbebd Make CFString comparable 2020-05-08 13:03:14 +01:00
Kornel 6ded5c360f CFBundleCopyBundleURL 2020-05-08 11:38:31 +01:00
brunohgouveia b68e9c782a Change CFMutableAttributedString::set_attribute argument type 2020-04-17 20:35:11 +01:00
roblabla 63a8dc37c3 CFSet: Add missing methods in -sys 2020-03-21 18:34:08 +00:00
roblabla bf5977f007 Assert when creating a CFType from null 2020-03-21 18:33:22 +00:00
Vasiliy Badanov aa6d1cd4c1 Fix for link error "Undefined symbols for architecture x86_64: _CFMutableAttributedStringGetTypeID" 2020-02-21 23:40:36 +03:00
Max Brunsfeld d95d3fa743 Fix miscellaneous compile warnings 2020-01-08 20:47:41 -08:00
bors-servo 0a3ac83c1b Auto merge of #349 - wez:timertypes, r=jdm
Fix CFRunLoop types to avoid UB

A number of callback functions associated with the CFRunLoop types are
allowed to be NULL to evoke default behavior.

Prior to this commit the definition of those structs prevented passing
in null which meant resorting to transmute or other tricks to
effectively set null, but with recent compiler versions the compiler
emits `ud2` instructions and triggers a fault at runtime.

The correct resolution for this is to define these fields as `Option`al
callbacks and that is what this commit does.

I've used this approach successfully here in another project:
Refs: https://github.com/wez/wezterm/commit/398f333c32fb1ff4ccd9cc001a66ae22522eb60c

I've bumped up the version for the crate as part of this commit
because it effectively changes the API around these structs.
2019-11-12 18:08:51 -05:00
Qifan Lu 83b6f5d20a Use zero-initialized array in CFURL::to_path 2019-11-12 12:37:41 -08:00
Wez Furlong 3126f15fd6 adjust test 2019-11-11 22:46:10 -08:00
Qifan Lu 727837f12e Use MaybeUninit instead of mem::uninitialized 2019-11-11 20:55:59 -08:00
Wez Furlong e7f687e3d4 moar version bumps 2019-11-11 20:29:01 -08:00
Wez Furlong 31d0d4e970 need to bump this version also 2019-11-11 20:22:49 -08:00
Wez Furlong cf3659fc6f Fix CFRunLoop types to avoid UB
A number of callback functions associated with the CFRunLoop types are
allowed to be NULL to evoke default behavior.

Prior to this commit the definition of those structs prevented passing
in null which meant resorting to transmute or other tricks to
effectively set null, but with recent compiler versions the compiler
emits `ud2` instructions and triggers a fault at runtime.

The correct resolution for this is to define these fields as `Option`al
callbacks and that is what this commit does.

I've used this approach successfully here in another project:
Refs: https://github.com/wez/wezterm/commit/398f333c32fb1ff4ccd9cc001a66ae22522eb60c

I've bumped up the version for the crate as part of this commit
because it effectively changes the API around these structs.
2019-11-11 19:57:48 -08:00