Commit Graph

203 Commits

Author SHA1 Message Date
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
Josh Matthews ae995daaab Minor version update for core-foundation-sys and core-foundation. 2019-11-05 12:54:59 +01:00
Wesley Moore ad416b4890 Add CFCharacterSet to core-foundation 2019-10-10 15:35:21 +11:00
Eike Siewertsen 1a0e69872a add shared_support_url to CFBundle 2019-08-05 10:50:58 +02:00
Jeff Muizelaar 87bd8a4d1a Add an unsafe method to convert CFDictionary to CFMutableDictionary 2019-03-28 18:02:12 -04:00
Bruce Mitchener 0fbabb35e9 Use assert_eq! when possible instead of assert! 2019-03-21 21:55:00 +07:00
Bruce Mitchener 585437bb3a core-foundation: Remove unnecessary transmutes. 2019-03-18 15:45:11 +07:00
Kornel 68b75cd9fd Add keywords to Cargo.toml 2019-03-16 21:58:49 +00:00
Bruce Mitchener 8632671479 clippy: Remove transmutes to the same type. 2019-03-16 22:07:27 +07:00
bors-servo 058fdd8f43 Auto merge of #300 - waywardmonkeys:clippy-use-is-null, r=jdm
clippy: Use is_null instead of != ptr::null().

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/300)
<!-- Reviewable:end -->
2019-03-14 10:24:46 -04:00
bors-servo 920db7be0d Auto merge of #297 - waywardmonkeys:macro-docs, r=jdm
Begin documenting core-foundation macros.

I started doing this after talking through some issues with @raphlinus. Clearly more to do, but would like to get this in sooner rather than later.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/297)
<!-- Reviewable:end -->
2019-03-14 10:12:14 -04:00
Bruce Mitchener 3e8acddee2 clippy: Use is_null instead of != ptr::null(). 2019-03-14 21:12:12 +07:00
bors-servo 348f7de691 Auto merge of #296 - waywardmonkeys:clippy-core-foundation-missing-default, r=jdm
clippy: Add missing Default impls.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/296)
<!-- Reviewable:end -->
2019-03-14 10:03:40 -04:00
bors-servo f8c1aaa3d3 Auto merge of #295 - waywardmonkeys:clippy-core-foundation-expect-with-function-call, r=jdm
clippy: Don't call expect with the result of a function call.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/295)
<!-- Reviewable:end -->
2019-03-14 09:55:14 -04:00
Bruce Mitchener d2d3b3362a Refer to macOS rather than OS X. 2019-03-14 17:47:00 +07:00
Bruce Mitchener ea446521fb Begin documenting core-foundation macros. 2019-03-14 15:19:39 +07:00
Bruce Mitchener 291a606fec clippy: Don't call expect with the result of a function call. 2019-03-14 09:40:33 +07:00
Bruce Mitchener 20d3a3f102 clippy: Add missing Default impls. 2019-03-14 09:36:00 +07:00
Wolfgang Silbermayr e2ae28c815 Use libc c_char instead of i8 for libc strlen() call 2018-12-07 07:06:09 +01:00