Commit Graph

240 Commits

Author SHA1 Message Date
Bruce Mitchener f23baea603 Fix clippy::needless_lifetimes lints (#717)
* Fix `clippy::needless_lifetimes` lints

* Fix `clippy::doc_markdown` lints
2025-01-08 05:20:49 +00:00
Tyler Mandry 9d8c74ea34 Fix TCFType macros for generic types (#652)
* Improve TCFType macros

This adds the following new features:

* `declare_TCFType!`: Generics are accepted.
* `impl_TCFType!`: Non-defaulted generics are accepted, and impls are
  fixed to be for all generics.

In addition, some warnings are silenced and the macros no longer depend
on any traits being in scope in the caller.

* Support generics in impl_CFComparison

* Add generic test for macros
2024-08-13 11:13:17 +00:00
Bruce Mitchener fb71d45b30 Enable clippy, suppress lots, fix a couple. (#703)
This enables clippy in CI and suppresses most of the existing
warnings. We can drill down and fix those later, but this will
help start getting things under control.
2024-08-13 04:25:49 +00:00
Bruce Mitchener 39a39555c0 Use workspace inheritance. (#701)
Consolidate package configuration where possible. This also
removes the `homepage` key as it only points to the repository
so isn't providing anything additional.

Use workspace dependencies for the crates provided by the workspace
and used within the workspace. This centralizes the version number
maintenance a bit.
2024-08-12 07:41:37 +00:00
Bruce Mitchener 84b8365425 Use CFIndex::MAX rather than CFIndex::max_value() (#699)
Since `CFIndex` is just `isize`, we can use the `CFIndex::MAX`
constant. The `max_value` and other functions are pending
deprecation and cause a clippy lint warning.
2024-08-12 02:42:23 +00:00
Bruce Mitchener b10b72c0cc core-foundation: Use dep syntax for with-uuid feature. (#691)
This removes an implicit feature due to the optional dependency
`uuid`.

While this is user visible, any use of `uuid` as a feature previously
would not have enabled the support code and so it wouldn't have had
any benefit.
2024-08-11 20:25:03 +00:00
Bruce Mitchener 9f33b121fb Use core::ffi over std::os::raw and libc::c_* (#692)
`core::ffi` is the preferred way to access these type definitions.
Begin removing uses of the versions from `libc`.

`libc::c_void` is not exactly the same as `core::ffi::c_void` but
some code has tried using them interchangeably (like in io-surface).

`libc::size_t` is `usize` on all current platforms.
2024-08-11 20:24:22 +00:00
Bruce Mitchener 42ec06106d Bump MSRV to 1.65 (#694)
This will allow us to use `dep:` syntax and also move to using types
from `core::ffi` as well as some other more modern constructs.
2024-08-11 16:15:49 +00:00
Ngo Iok Ui (Wu Yu Wei) 652bab0a62 Bump version of core-foundation-sys to 0.8.7 (#683)
* Bump version of core-foundation-sys to 0.9.0

* Bump patch version instead
2024-08-09 16:47:06 +00:00
Bruce Mitchener 31a92cd2fc Fix typos. (#689) 2024-07-20 10:26:35 +00:00
Kornel 3570256ecc Avoid UB if the CFData pointer is NULL (#688) 2024-07-14 17:50:44 +00:00
Bruce Mitchener 6940925635 Remove remaining chrono code. (#682)
In 9721646053, the `with-chrono`
feature was removed, but this dead code lingered.
2024-05-27 07:01:47 +00:00
Bruce Mitchener 8d2b732db5 Remove usages of extern crate. (#672) 2024-05-27 06:40:54 +00:00
Bruce Mitchener 48d6bdf9be Update uuid dep to 1.x (#228)
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-09 11:00:07 +00:00
Dirkjan Ochtman 9721646053 foundation: remove optional chrono dependency (#666)
* foundation: remove optional chrono dependency

* Bump version numbers for semver-incompatible changes
2024-04-08 10:20:45 +00:00
Jeff Muizelaar 795398aa37 Bump the version of core-foundation and the dependency on core-foundation-sys 2023-11-30 10:56:38 -05:00
Bruce Mitchener 58972aef0a Update to 2018 edition. (#642)
This is the minimum fix required. It updates to use crate-relative
imports.
2023-10-24 00:30:22 +00:00
Bruce Mitchener 3ff7cc2795 docs: Fix various markdown issues. (#639) 2023-10-10 15:22:46 +00:00
Leo Kettmeir c4f4ad20b6 feat: add link feature (#608)
adjust docs

Update cocoa/Cargo.toml

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>

fmt
2023-10-10 14:46:20 +00:00
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